Grasshopper project system now uses csproj extension
[mono.git] / mcs / mcs / ChangeLog
1 2007-02-12  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #80749
4         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5         its parent container.
6
7         * class.cs (DefineFieldInitializers): Each initializer can has different
8         resolve context.
9
10         * const.cs: Updated.
11
12 2007-02-11  Miguel de Icaza  <miguel@novell.com>
13
14         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
15         now all the heavy lifting to check that embedded statements or
16         expressions have the right form is done in the ContextualReturn.
17
18         (ContextualReturn): New class.  
19
20         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
21         method that can be invoked to report 201, so we do not replicate
22         this everywhere.
23
24         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
25         
26         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
27         treating tabs as spaces. 
28
29 2007-02-09  Marek Safar  <marek.safar@gmail.com>
30
31         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
32         * assign.cs: Use full implicit conversion for right side check.
33
34 2007-02-09  Marek Safar  <marek.safar@gmail.com>
35
36         * statement.cs (Switch): Switch over boolean type is not standardized.
37
38 2007-02-08  Marek Safar  <marek.safar@gmail.com>
39
40         A fix for bug #80755
41         * decl.cs (FindBaseEvent): Don't use method cache for events.
42
43 2007-02-07  Marek Safar  <marek.safar@gmail.com>
44
45         * cs-parser.jay: Better syntax error handling.
46
47         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
48         instead of underlying type value.
49
50 2007-02-06  Marek Safar  <marek.safar@gmail.com>
51
52         * driver.cs: Check define identifier before is registered.
53
54         * namespace.cs: Use existing error message.
55
56         * report.cs: New warning.
57
58 2007-02-06  Marek Safar  <marek.safar@gmail.com>
59
60         A fix for bug #80742
61         * expression.cs: Delegate Invoke method can be called directly.
62
63 2007-02-06  Marek Safar  <marek.safar@gmail.com>
64
65         A fix for bug #80676
66         * class.cs (IsEntryPoint): The Main method can have params modifier.
67
68 2007-02-04  Miguel de Icaza  <miguel@novell.com>
69
70         * parameter.cs (Parameter, Parameters): Add Clone method.
71
72         * anonymous.cs (Compatible): Turn method into virtual method, so
73         LambdaExpression can implement a different behavior.
74
75         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
76         out the basic checking here, so it can be used by
77         LambdaExpressions.
78         
79         * lambda.cs: Introduce "Compatible" function that will do the
80         heavy lifting.
81
82 2007-02-02  Marek Safar  <marek.safar@gmail.com>
83
84         * attribute.cs: Unified one error message.
85
86         * class.cs (Class): Use type attributes and not properties to test static
87         class.
88         (IsEntryPoint): Don's pass local variable.
89
90         * convert.cs: Removed duplicate check.
91
92         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
93
94         * driver.cs: Don't crash when soft reference does not exist.
95
96         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
97         (UsingEntry): Removed redundant allocation.
98
99         * parameter.cs: Add fast path for type parameters.
100
101         * support.cs: Don't allocate attribute when it's not used.
102
103 2007-01-30  Miguel de Icaza  <miguel@novell.com>
104
105         * anonymous.cs
106         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
107         this into a virtual method, so we can override it in LambdaExpression.
108
109         * driver.cs: Improve diagnostics in case of failure. 
110
111         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
112         write a function that is slightly more complex and that parses:
113
114         type identifier [, type identifier]* )
115
116         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
117         this expression:
118
119                 (canEmpty ? i >= 0 : i > 0)
120
121 2007-01-30  Raja R Harinath  <rharinath@novell.com>
122
123         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
124         exception on possibly valid code.
125
126 2007-01-29  Raja R Harinath  <rharinath@novell.com>
127
128         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
129         Push/PopPosition.
130         (parse_opt_type_arguments): Remove.  It's almost the same as
131         parse_less_than.
132         (parse_namespace_or_typename): Use parse_less_than.
133
134 2007-01-28  Miguel de Icaza  <miguel@novell.com>
135
136         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
137         this bug took a few hours to find, because the state saved and
138         restored by PushPosition and PopPosition was ignoring the state of
139         parse_generic_less_than.
140
141         I can also now remove the handling of OP_LT and OP_GT, this solves
142         the big mistery.
143         
144         * cs-tokenizer.cs: store the location for the ARROW token, we use
145         that in the parser.
146
147         (PushPosition, PopPosition): save/restore also `current_token',
148         restore `parse_generic_less_than' (was missing).
149
150         (parse_opt_type_arguments): use parse_type, not
151         parse_namespace_or_typename to parse types.
152
153         * lambda.cs: Empty new file, will eventually have the lambda
154         expression implementation.
155
156         * lambda.test: used to test the internal tokenizer. 
157
158         * report.cs (FeatureIsNotISO1): Rename from
159         FeatureIsNotStandardized, because it was about the language level
160         (1 vs 2) it was not about standarization.
161
162         (FeatureRequiresLINQ): New.
163
164         * support.cs (SeekableStreamReader): Only require that the reader
165         is a TextReader, not a StreamReader, so we can plug StringReader. 
166
167         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
168         given position in the input stream the following tokens can be
169         parsed as a type followed by an identifier.
170
171         (is_punct): after a '(' if parse_type_and_parameter returns true,
172         then return a special token OPEN_PARENS_LAMBDA which is used to
173         avoid reduce/reduce errors in the grammar for the
174         lambda_expression rules.
175
176         (parse_type): implement a type parser inside the
177         tokenizer, the parser only returns true or false depending on
178         whether the input at a given position can be parsed as a type.
179
180         (peek_token): new method used during type parsing.
181
182 2007-01-28  Raja R Harinath  <rharinath@novell.com>
183
184         Fix #80531
185         * anonymous.cs (ScopeInfo.InflateParameters): New.
186         (AnonymousContainer.Resolve): Use it to redirect types of
187         delegate parameters.
188
189 2007-01-27  Raja R Harinath  <rharinath@novell.com>
190
191         Fix #80530
192         * expression.cs (Error_InvalidArguments): Don't use two different
193         messages for CS1503.  Use ExtraInformation and
194         SymbolRelatedToPreviousError instead.
195
196         Fix #80358
197         * decl.cs (DeclSpace.initialize_type_params): Don't access
198         'type_params' of a partial class directly.
199
200 2007-01-26  Miguel de Icaza  <miguel@novell.com>
201
202         * constant.cs: Removed a handful of out-of-range checks that were
203         not necessary. 
204
205 2007-01-25  Marek Safar  <marek.safar@gmail.com>
206
207         * expression.cs (CheckUselessComparison): Add additional check for char
208         constants.
209
210         * namespace.cs: Fixed typo.
211
212 2007-01-23  Miguel de Icaza  <miguel@novell.com>
213
214         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
215         gone, instead we inline the test, preventing the needless casts to
216         longs, ulongs and doubles for the parameters, avoiding calls to
217         methods that overchecked stuff, and instead inlined things
218         nicely. 
219
220 2007-01-20  Marek Safar  <marek.safar@gmail.com>
221
222         * cs-parser.jay: Better parameter error handling.
223
224 2007-01-17  Marek Safar  <marek.safar@gmail.com>
225
226         A fix for bug #80368, #80522
227         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
228         whether array initializer contains constants only.
229         (ArrayCreation.Emit): Use better formula to decide when
230         are array initializers for static initialization.
231         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
232         have to emit even constants otherwise they are pre-initialized.
233
234 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
235             Raja R Harinath  <rharinath@novell.com>
236
237         Fix emit order of 'get' vs. 'set'.
238         * support.cs (Accessors): New.
239         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
240         Note the order in which accessors are declared in the source.
241         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
242         Refactored from Property.Define and Indexer.Define.
243         (PropertyBase.DefineAccessors): New helper that calls the above in
244         appropriate order as noted by the parser.
245         (Property.Define, Indexer.Define): Update to changes.
246         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
247
248 2007-01-17  Raja R Harinath  <rharinath@novell.com>
249
250         Fix cs0029-6.cs and gcs0029-2.cs (regression)
251         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
252         there's an implicit conversion from the current type to the target
253         type before converting the underlying constant.
254
255 2007-01-16  Marek Safar  <marek.safar@gmail.com>
256
257         * const.cs (ResolveValue): Updated after constant conversion was made more
258         generic.
259
260         * constant.cs (GetAttributableValue): constant to object conversion is
261         used for attributes only.
262         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
263         constant conversions.
264         (LongConstant.ConvertImplicitly): Ditto.
265
266         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
267         (ImplicitConversionStandard): Handle constant conversion as extra step.
268         It solves the issue when constant conversion was called indirectly like
269         inside array initializer and constant folding was skipped.
270
271         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
272         this change.
273
274         * statement.cs(ImplicitConversionStandard): Updated after constant
275         conversion was made more generic.
276
277 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
278
279         * expression.cs (As.DoResolve): Use GenericConstraints instead of
280         Constraints, solves the problem where the compiler incorrectly
281         reported that a type parameter was not constrained to a class (Bug
282         80518)
283
284 2007-01-14  Marek Habersack  <grendello@gmail.com>
285
286         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
287
288 2007-01-14  Marek Safar  <marek.safar@gmail.com>
289
290         A fix for bug #80368
291         * assign.cs (FieldInitializer): New class implements field
292         initializer statement.
293
294         * attribute.cs: Update after FieldMember rename.
295
296         * class.cs (PropertyBasedMember): New common class for property based
297         types.
298         (InterfaceMemberBase): New base class for all members which can be used as
299         an interface members.
300         (MethodCore): Moved really common code to InterfaceMemberBase.
301         (Method.Define): Equal and GetHasCode detection is relevant for methods
302         only.
303         (MethodData.Define): Don't assume that public event implements an
304         interface automatically.
305         (MethodData.DefineMethodBuilder): Issue an error even if only extern
306         modifier is used.
307         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
308         (FieldMember): Merged with FieldBase.
309         (EventProperty.AEventPropertyAccessor): New specialization to check whether
310         event extern modifier can be used.
311         (EventField.EventFieldAccessor): Moved event field specific code here.
312         (Event.AllowedModifiers): Even event can be extern.
313         (Event.FindOutBaseMethod): New override specific to events.
314         (Indexer.parameters): Reintroduce parameters because base class holds
315         only properties common data.
316         (Indexer.CheckForDuplications): Indexers are threated as methods so we
317         need do extra parameters check.
318
319         * const.cs: Update after FieldMember rename.
320
321         * decl.cs (MemberCache.FindBaseEvent): New method.
322
323         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
324         to reflect that indexer is now derived from PropertyBased.
325
326         * ecore.cs (GetMemberType): Made public.
327         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
328         obsolete event.
329
330         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
331         
332         * typemanager.cs (CSharpSignature): Correctly print event accessors.
333         (RegisterEvent): Removed.
334         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
335         (GetPrivateFieldOfEvent): Renamed to GetEventField.
336
337 2007-01-11  Raja R Harinath  <rharinath@novell.com>
338
339         Fix #80249
340         * statement.cs (CollectionForeach.TryType): Prefer generic
341         GetEnumerator over non-generic variant.  Fix code to follow comments.
342
343 2007-01-09  Raja R Harinath  <rharinath@novell.com>
344
345         Fix #80446
346         * support.cs (ReflectionParameter): Don't use an invalid index on
347         the generic parameter data.
348
349 2007-01-08  Miguel de Icaza  <miguel@novell.com>
350
351         * driver.cs: Just add a tiny bit of infrastructure.
352
353 2007-01-02  Marek Safar  <marek.safar@gmail.com>
354
355         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
356         where field type is struct from current assembly.
357         
358         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
359         it is possible.
360
361 2007-01-02  Marek Safar  <marek.safar@gmail.com>
362
363         A fix for bug #80381
364         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
365         the core types.
366
367         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
368         messages.
369         (Namespace.LookupType): Always use core types from corlib when speficied.
370
371         * report.cs: A new warning.
372
373         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
374         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
375         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
376
377         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
378         (InitCoreTypes): Set expression type of object_type and value_type
379         immediately after lookup.
380
381 2007-01-01  Miguel de Icaza  <miguel@novell.com>
382
383         * cs-tokenizer.cs: Accept Pc class characters (Connector
384         Punctuation) as valid identifiers.  Fixes #78259
385
386         * expression.cs (Invocation.DoResolve): Moved the check for the
387         use of `this' for doing method calls to the Invocation resolution
388         step, after overload resolution has taken place instead of doing
389         the check at the low-level `This.DoResolve' level.
390
391         The `This.DoResolve' happens before overload resolution, so it has
392         no way of knowing if the method that will be called will be
393         instace or static, triggering an erroneous report for cs0188 (Bug
394         78113).
395
396         We now do the check for instance method invocations after we know
397         what method will be called.
398
399         (This.CheckThisUsage): Move the actual use of this structure
400         checking into its own method and expose it. 
401
402         * Everywhere that called Error_ValueCannotBeConverted: pass a new
403         EmitContext.
404
405         Exceptions: Null.ConvertImplicitly,
406         Constant.ImplicitConversionRequired as there are too many call
407         sites for passing the ec. 
408
409         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
410         EmitContext, if the value is null, then we do not try to provide
411         the extra information from the error (If a userdefined conversion
412         exists, as UserDefinedConversion requires a non null-EmitContext).
413
414         Fixes: #80347
415
416 2006-12-30  Raja R Harinath  <rharinath@novell.com>
417
418         * flowanalysis.cs (MyBitVector): Document some invariants.
419         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
420         introduced below, and add a couple of others, 
421
422 2006-12-30  Marek Safar  <marek.safar@gmail.com>
423
424         * attribute.cs (GetMethodObsoleteAttribute): Uses new
425         GetPropertyFromAccessor and GetEventFromAccessor.
426         
427         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
428         overrides non-obsolete one.
429         (Indexer.Define): Error message has been moved to the parser.
430
431         * cs-parser.jay: Better syntax errors handling.
432
433         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
434         when an invocation has no arguments.
435
436         * ecore.cs: Removed not used caching.
437
438         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
439         implementation.
440
441         * report.cs: Add a new warning.
442
443         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
444
445         * typemanager.cs (enumeration_type): Removed.
446         (CSharpSignature): Reuses IsSpecialMethod.
447         (IsEqual): Hack for MS BCL.
448         (GetPropertyFromAccessor): New method.
449         (GetEventFromAccessor): New method.
450         (IsSpecialMethod): Fixed to handle more cases.
451
452 2006-12-30  Marek Safar  <marek.safar@gmail.com>
453
454         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
455         Made white spaces array static.
456
457         * ecore.cs (RemoveGenericArity): Optimized.
458
459         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
460         10 times faster).
461         (MyBitVector.initialize_vector): Simplified.
462
463 2006-12-22  Miguel de Icaza  <miguel@novell.com>
464
465         * ecore.cs: Am not entirely happy with this hack, but it seems to
466         address the issue in 80257 (a small test case for
467         CreativeDocs.NET). 
468
469         I set the MethodGroupExpr.Type to an internal compiler type
470         (itself in this case) to force the resolution to take place.   Why
471         it does not take place with a null is beyond me.
472
473 2006-12-20  Marek Safar  <marek.safar@gmail.com>
474
475         A fix for bug #80288
476         * expression.cs (ResolveOperator): Consider user defined conversion for
477         logical and operator too.
478         (EmitBranchable): Optimization for logical and when full constant folding
479         could not be applied but one operand is constant.
480
481 2006-12-19  Marek Safar  <marek.safar@gmail.com>
482
483         * class.cs (GetClassBases): Write 5 times every day, will never use
484         FullName for error reporting.
485
486         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
487
488 2006-12-19  Martin Baulig  <martin@ximian.com>
489
490         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
491         the symbol file info here.
492
493 2006-12-18  Marek Safar  <marek.safar@gmail.com>
494
495         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
496         of `elseif' is taking then following sections are not taking.
497         Fixes an issue reported on mono mailing list.
498
499 2006-12-18  Marek Safar  <marek.safar@gmail.com>
500
501         A fix for bug #80300
502         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
503         a caller is not taking.
504
505 2006-12-18  Raja R Harinath  <rharinath@novell.com>
506
507         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
508         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
509         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
510         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
511         * class.cs: Update to changes.
512
513 2006-12-17  Marek Safar  <marek.safar@gmail.com>
514
515         A fix for bug #79934
516         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
517         partial container.
518
519         * class.cs (ResolveMembers): Register an iterator in current container and
520         not in shared one.
521
522 2006-12-16  Raja R Harinath  <rharinath@novell.com>
523
524         Fix test-543.cs
525         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
526         satisfy a params annotated parameter.
527
528 2006-12-16  Marek Safar  <marek.safar@gmail.com>
529
530         A fix for bug #77014
531         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
532         paramters correctly and not rely on hacks in Parameters class.
533         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
534         at any possition.
535         (Invocation.VerifyArgumentsCompat): Ditto.
536         (Invocation.EmitArguments): Changed to correctly emit params arguments at
537         any possition.
538
539         * parameter.cs (HasParams): Don't assume that params is the last one.
540
541         * support.cs (ReflectionParameters.ctor): Look for params attribute
542         correctly.
543         (ReflectionParameters.ParameterType): Removed hack when we returned last
544         parameter for out of range parameters.
545         (ParameterName, ParameterModifier): Ditto.
546
547 2006-12-14  Marek Safar  <marek.safar@gmail.com>
548
549         A fix for bug #79987
550         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
551         when assembly is not CLS compliant but type is. I have no idea why is this
552         allowed.
553
554         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
555
556 2006-12-13  Miguel de Icaza  <miguel@novell.com>
557
558         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
559         in struct constructors, they are basically no-ops.
560
561 2006-12-12  Marek Safar  <marek.safar@gmail.com>
562
563         * cs-tokenizer.cs (Position): Save preprocessor status too.
564
565 2006-12-12  Marek Safar  <marek.safar@gmail.com>
566
567         A fix for bug #77794
568         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
569
570 2006-12-12  Marek Safar  <marek.safar@gmail.com>
571
572         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
573         Fixes #69299.
574         (pp_expr): Report error for an invalid expression.
575         (handle_preprocessing_directive): Simplified; add more error checking.
576
577 2006-12-11  Marek Safar  <marek.safar@gmail.com>
578
579         A fix for bug #74939
580         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
581         directives handling.
582
583 2006-12-10  Marek Safar  <marek.safar@gmail.com>
584
585         A fix for bugs #80093, and #75984
586         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
587         logic, it seems to me as it worked before "by coincidence".
588         (xtoken): Simplified to use reworked handle_preprocessing_directive.
589         (cleanup): Enabled endif check.
590
591 2006-12-09  Marek Safar  <marek.safar@gmail.com>
592
593         A fix for bug #80162
594         * statement.cs (CollectionForeach.TryType): Generics and non-generics
595         enumerators are never ambiguous.
596
597 2006-12-08  Raja R Harinath  <rharinath@novell.com>
598
599         Fix #80060
600         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
601
602 2006-12-06  Marek Safar  <marek.safar@gmail.com>
603
604         A fix for bug #80144
605         * class.cs (EventProperty.Define): Explicit implementation means
606         that an even is used.
607
608 2006-12-06  Marek Safar  <marek.safar@gmail.com>
609
610         Fixes the operators implementation (part II)
611
612         * cfold.cs (DoConstantNumericPromotions): Renamed to
613         DoBinaryNumericPromotions and simplified.
614         (BinaryFold): Couple of conversion fixes; simplified.
615
616         * constant.cs, ecore.cs, literal.cs
617         (ToType): Renamed to ConvertImplicitly.
618         (Reduce): Renamed to ConvertExplicitly.
619
620         * class.cs, convert.cs: Updated.
621
622         * expression.cs: TryReduce doesn't throw an exception.
623
624 2006-12-01  Marek Safar  <marek.safar@gmail.com>
625
626         A fix for bug #80108
627         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
628         compatible.
629
630 2006-11-30  Marek Safar  <marek.safar@gmail.com>
631
632         Fixes unary operators implementation (part I)
633         Also fixes #80026
634
635         * cfold.cs (Error_CompileTimeOverflow): Made internal
636
637         * const.cs (IConstant): Changed to use reference to constant and
638         not constant itself.
639         Updated IConstant implementations.
640
641         * constant.cs (CreateConstant): New factory method.
642         Updated IConstant implementation.
643
644         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
645
646         * ecore.cs: Updated to use CreateConstantReference.
647
648         * enum.cs: Reflects IConstant changes.
649
650         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
651
652         * literal.cs (NullConstant): Change to be independently usable.
653
654 2006-11-29  Martin Baulig  <martin@ximian.com>
655
656         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
657         we need to emit the scope initializer before calling the base .ctor.
658
659         * anonymous.cs: Merged back from the new anonymous methods branch.
660         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
661
662         * expression.cs (ParameterReference.DoResolveBase): Create a
663         "normal" ScopeInfo when capturing parameters rather than using the
664         root scope; this makes things work with anonymous methods having
665         parameters.
666
667         * statement.cs
668         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
669
670 2006-11-22  Marek Safar  <marek.safar@gmail.com>
671
672         A fix for bug #79987
673         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
674         check to a base class.
675         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
676         only when assembly has missing attribute.
677         * report.cs: Update.
678
679 2006-11-21  Marek Safar  <marek.safar@gmail.com>
680
681         * cs-tokenizer.cs: Merged with gmcs version.
682
683 2006-11-20  Marek Safar  <marek.safar@gmail.com>
684
685         * cs-tokenizer.cs,
686         * cs-parser.jay: Better error message when partial keyword is misplaced.
687
688 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
689
690         A fix for bug #79810
691         report.cs: CS1058 only applies to 2.0 profile (gmcs).
692         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
693         a RuntimeWrappedException by default.
694
695 2006-11-18  Marek Safar  <marek.safar@gmail.com>
696
697         A fix for bug #79843
698         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
699         implementation.
700         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
701
702 2006-11-18  Marek Safar  <marek.safar@gmail.com>
703
704         * driver.cs, namespace.cs: Uses faster IndexOf version.
705
706 2006-11-17  Marek Safar  <marek.safar@gmail.com>
707
708         A fix for bug #79941
709         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
710         operators.
711         (Operator.Define): Implicit/Explicit operator of same type is duplicate
712         even if internal name is different.
713         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
714         (UserDefinedConversion): Simplified as the operators cannot be internal.
715         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
716         conversions.
717         (MethodLookup): Replaced EmitContext with parentType.
718         * expression.cs: Updated.
719
720 2006-11-09  Raja R Harinath  <rharinath@novell.com>
721
722         * driver.cs (BadAssembly): Handle all the ugliness of
723         DefineDynamicAssembly.
724
725 2006-11-08  Raja R Harinath  <rharinath@novell.com>
726
727         Address parts of #58244 -- most of what's left is in the runtime
728         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
729         CS1509 error checks, and handle them for all assembly loads, not
730         just the first invocation.
731         (LoadModule): Likewise.  Move handling of 'adder_method' ...
732         * codegen.cs (AssemblyClass.AddModule): ... here.
733
734 2006-11-02  Marek Safar  <marek.safar@gmail.com>
735
736         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
737         IEnumerable<T> is ambiguous.
738
739 2006-10-31  Marek Safar  <marek.safar@gmail.com>
740
741         A fix for bug #67689
742         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
743         GetEnumerator is ambiguous.
744
745         * report.cs: Add new warning.
746
747 2006-10-29  Marek Safar  <marek.safar@gmail.com>
748
749         A fix for bug #78602
750         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
751         to protected member can be nested type.
752
753 2006-10-28  Marek Safar  <marek.safar@gmail.com>
754
755         A fix for bug #78965
756         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
757         to protected member must derive from current type.
758
759 2006-10-27  Marek Safar  <marek.safar@gmail.com>
760
761         assign.cs: Reuses error method.
762
763         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
764         instead of type for constants.
765         (Expression.Error_ValueAssignment): Common error method.
766
767         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
768         for any assignment.
769
770 2006-10-27  Marek Safar  <marek.safar@gmail.com>
771
772         A fix for bug #79081
773         * expression.cs (MemberAccess.DoResolve): Check nested type
774         accessibility.
775
776 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
777
778         * doc.cs : nested delegates were not handled. Fixed bug #79754.
779
780 2006-10-26  Marek Safar  <marek.safar@gmail.com>
781
782         A fix for bug #76591
783         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
784
785 2006-10-26  Marek Safar  <marek.safar@gmail.com>
786
787         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
788         type forwarder of the same type multiple times.
789
790 2006-10-26  Raja R Harinath  <rharinath@novell.com>
791
792         Fix #78820
793         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
794         instance as an rvalue, even when we later resolve as an lvalue.
795
796 2006-10-25  Martin Baulig  <martin@ximian.com>
797
798         * anonymous.cs: Fix #79673.
799
800 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
801
802         A fix for bug #79666
803         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
804         ignored when is optimized (= default value) as its value is already set.
805
806 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
807
808         A fix for bug #79724
809         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
810         TypeContainer for type lookup.
811
812 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
813
814         A fix for bug #79231
815         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
816         * expression.cs (OverloadResolve): Always convert type name for
817         an error message.
818         (ResolveNamespaceOrType): Don't confuse a nested type with any 
819         other member.
820
821 2006-10-18  Martin Baulig <martin@ximian.com>
822
823         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
824
825 2006-10-17  Miguel de Icaza  <miguel@novell.com>
826
827         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
828         an int32, but requesting an int64 from the conversion
829
830 2006-10-12  Martin Baulig  <martin@ximian.com>
831
832         * anonymous.cs
833         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
834         
835 2006-10-12  Martin Baulig  <martin@ximian.com>
836
837         * statement.cs
838         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
839
840 2006-10-11  Miguel de Icaza  <miguel@novell.com>
841
842         * convert.cs: Remove broken code: I was doing the "Existance"
843         tests for Implicit conversions.
844
845 2006-10-10  Miguel de Icaza  <miguel@novell.com>
846
847         * convert.cs: Added one missing case in
848         ImplicitStandardConversionExists uint64 to intptr.
849
850         Fixes #59800
851         
852         * typemanager.cs (uintptr_type): another core known type.   
853
854         * ecore.cs (OperatorCast): routine used to do cast operations that
855         depend on op_Explicit.  We could change some of the Decimal
856         conversions to use this.
857
858         This one has a probe mechanism that checks both types for an op_
859         which it coudl be used to eliminate two classes: CastToDecimal
860         and CastFromDecimal.
861
862         * convert.cs: Implement the conversions documented in #59800
863         
864 2006-10-10  Martin Baulig  <martin@ximian.com>
865
866         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
867         before RootScope.ResolveMembers().
868
869         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
870         `CurrentType' if appropriate.
871
872 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
873
874         A fix for bug #78568
875         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
876         when contains binary operators.
877         * cs-parser.jay: Updated.
878
879 2006-10-09  Martin Baulig  <martin@ximian.com>
880
881         * delegate.cs
882         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
883         moved that into Define() and also do the other type parameter
884         checks there.  Fixes #79094.  Added gtest-292.cs.
885
886         * expression.cs
887         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
888         since that doesn't include type parameters; don't use `Ldelema'
889         for type parameters.  Fixes #78980.  Added gtest-293.cs.
890
891 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
892
893         A fix for #77796
894         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
895         conversion is allowed.
896
897 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
898
899         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
900         error reporting when no error occurs.
901
902 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
903
904         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
905         does not exist.
906
907 2006-10-06  Raja R Harinath  <rharinath@novell.com>
908
909         Fix #79584
910         * class.cs (DefineTypeBuilder): Check circular dependencies before
911         setting the parent of the TypeBuilder.
912         (CheckRecursiveDefinition): Don't use 'BaseType', since
913         it may not be valid until after DefineTypeBuilder.  Use
914         'base_type' instead.
915
916 2006-10-04  Martin Baulig  <martin@ximian.com>
917
918         Merged the Anonymous Methods patch.
919
920         * anonymous.cs, iterators.cs: The new anonymous methods code.
921
922         * statement.cs (Variable): New public abstract class.
923         (LocalInfo.Variable): New public property.
924         (LocalInfo.ResolveVariable): New public method.
925         (Block.Flags): Add `IsIterator'.
926         (Block.AddVariable): Improved the CS0136 check.
927         (Block.AnonymousChildren): New public property.
928         (Block.AddAnonymousChild): New public method.
929         (ToplevelBlock): Update to use the new anonymous method framework.
930         (ToplevelBlock.ctor): `container' is now a `Block' and not a
931         `ToplevelBlock'; this is required to correctly implement the
932         CS0136 check.
933         (Fixed, Using): Use `TemporaryVariable' instead of directly
934         creating the `LocalBuilder'.
935
936         * parameter.cs (Parameter.ResolveVariable): New public method.
937         (Parameters.ResolveVariable): Likewise.
938
939         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
940
941         * class.cs (TypeContainer): Replaced the `iterators' list and
942         corresponding methods with a list of `CompilerGeneratedClass'es.
943         (TypeContainer.ResolveMembers): New public method.
944         (Method): `IIteratorContainer' has been replaced by
945         `IAnonymousHost'.
946
947         * expression.cs (VariableReference): New public abstract base
948         class for `LocalVariableReference', `ParameterReference' and
949         `This'.
950
951         * codegen.cs (EmitContext): Removed `capture_context',
952         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
953         (EmitContext.EmitThis): Removed.
954
955         * cs-parser.jay: Replace `iterator_container' with
956         `anonymous_host'.       
957
958 2006-10-04  Martin Baulig  <martin@ximian.com>
959
960         * generic.cs (GenericMethod): Don't make this abstract.
961         (Constraints.Clone): Added dummy implementation.
962
963 2006-10-04  Raja R Harinath  <harinath@gmail.com>
964
965         Fix #79577
966         * namespace.cs (LookForAnyGenericType): Avoid nullref on
967         'declspaces'.  Avoid allocating arrays willy-nilly.
968
969         Fix #79553
970         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
971         cases out of the switch.
972
973 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
974
975         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
976         message when non-generic type is used with the type arguments.
977         * expression.cs: Updated.
978
979 2006-09-28  Raja R Harinath  <rharinath@novell.com>
980
981         Fix #79013
982         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
983         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
984         Change semantics slightly.  Don't insist on having only one
985         temporary EmptyExpression -- just throttle the creation of new ones.
986
987         Fix #79451
988         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
989         non-interfaces too.  If no methods are found, don't try to create
990         a MethodGroupExpr.
991
992 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
993
994         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
995         generic type.
996
997         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
998         us produce better error message.
999
1000 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
1001
1002         * expression.cs (Binary.ResolveOperator): Warn about a side effect
1003         of the `|' operator.
1004
1005         * report.cs: A new warning added.
1006
1007 2006-09-27  Martin Baulig  <martin@ximian.com>
1008
1009         * generic.cs (GenericMethod): Don't make this abstract.
1010
1011 2006-09-27  Martin Baulig  <martin@ximian.com>
1012
1013         * report.cs
1014         (InternalErrorException): Added overloaded ctor taking a params array.
1015
1016 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
1017
1018         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1019         Fixed the cases when same error was reported twice.
1020
1021         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1022         now report symbol information.
1023
1024 2006-09-25  Martin Baulig  <martin@ximian.com>
1025
1026         * class.cs: Completely unified with the gmcs version.
1027
1028 2006-09-25  Martin Baulig  <martin@ximian.com>
1029
1030         * typemanager.cs (TypeManager.IsNullableType): New public function.
1031         (TypeManager.IsNullableTypeOf): Likewise.
1032         (TypeManager.IsNullableValueType): Likewise.
1033
1034         * class.cs (MethodCore): Added the `GenericMethod' argument from
1035         gmcs and also unified all classes derived from `MethodCore' with gmcs.
1036
1037 2006-09-24  Raja R Harinath  <harinath@gmail.com>
1038
1039         * convert.cs: Unify with gmcs version.
1040
1041 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1042
1043         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1044         verify them as well.
1045
1046         * report.cs: New warning.
1047
1048 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1049
1050         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1051         for anonymous block with out argument.
1052
1053 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1054
1055         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1056         not used private events only.
1057
1058 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
1059
1060         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1061
1062         * const.cs (Const.Define): Check for constant type.
1063         (Const.IsConstantTypeValid): Looks for valid constant types.
1064
1065         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1066
1067         * ecore.cs (EmptyConstantCast): New common class for all constant based
1068         EmptyCast(s).
1069
1070         * expression.cs (Is.DoResolve): Handle null constant especially.
1071         (New.DoResolve): Check for new void().
1072         (MemberAccess.DoResolve): Cope with all kind of nulls.
1073
1074         * literal.cs (NullConstant): Uses EmptyConstantCast.
1075         (NullDefault): Based on EmptyConstantCast.
1076         (NullLiteral): Uses EmptyConstantCast.
1077
1078         * statement.cs (Block.ResolveMeta): Check for constant type.
1079
1080 2006-09-22  Martin Baulig  <martin@ximian.com>
1081
1082         * delegate.cs, attribute.cs: Merged with the gmcs versions.
1083
1084 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1085
1086         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1087         not the null type.
1088
1089         Fix part of #79451
1090         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1091         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
1092         code slightly.
1093
1094 2006-09-22  Martin Baulig  <martin@ximian.com>
1095
1096         * ecore.cs: Merged with the gmcs version.
1097
1098         * generic.cs (ConstructedType): New dummy class.
1099         (TypeArguments): Don't make this abstract.
1100
1101         * typemanager.cs
1102         (TypeManager.IsGenericTypeDefinition): New method.
1103         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1104
1105 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1106
1107         * expression.cs (ComposedCast): Check for arrays of TypedReference
1108         before creating the type, not after.
1109
1110 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
1111
1112         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1113         after ToType change.
1114
1115         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1116         when constant must be implicitly convertible.
1117
1118         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1119
1120         * ecore.cs (NullCast): Derives from NullConstant.
1121
1122         * expression.cs (Is.DoResolve): Removed useless variables.
1123         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1124         (New.Constantify): Add enum support.
1125         (MemberAccess.DoResolve): Add warning when accessing null constant or
1126         variable.
1127
1128         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1129         property.
1130
1131         * literal.cs (NullConstant): New abstract class with common
1132         functionality for all null specializations.
1133         (NullDefault): Represents default(X) when result can be
1134         reduced to null.
1135         (NullLiteral): Updated.
1136
1137         * report.cs: Add new warning.
1138
1139 2006-09-21  Martin Baulig  <martin@ximian.com>
1140
1141         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1142
1143 2006-09-21  Martin Baulig  <martin@ximian.com>
1144
1145         * generic.cs (GenericConstraints): New dummy class.
1146         (Constraints): Likewise.
1147         (TypeParameter): Likewise.
1148         (TypeParameterName): Likewise.
1149         (GenericMethod): Likewise.
1150
1151         * typemanager.cs (TypeManager.GetGenericArguments): New method.
1152
1153         * decl.cs: Merged with the gmcs version.
1154
1155 2006-09-21  Raja R Harinath  <rharinath@novell.com>
1156
1157         * generic.cs (TypeParameter): Implement IMemberContainer.
1158         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
1159
1160         * rootcontext.cs: Unify with gmcs version.
1161
1162         * report.cs: Unify with gmcs version.
1163         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1164         from gmcs/generics.cs.
1165         * generics.cs (TypeParameter): New dummy class.
1166
1167         * support.cs: Unify with gmcs version.
1168
1169 2006-09-20  Raja R Harinath  <rharinath@novell.com>
1170
1171         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1172         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1173
1174         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1175         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1176         * mcs.exe.sources: Add generic.cs.
1177
1178         * codegen.cs: Unify with gmcs version.
1179
1180         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1181         (EmitContext): Add GenericDeclContainer implementation.
1182         * decl.cs (MemberCore, DeclSpace): Likewise.
1183         * namespace.cs: Remove #ifdef GMCS_SOURCE.
1184
1185         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1186         MCS TypeManager has a corresponding dummy method.
1187
1188 2006-09-19  Martin Baulig  <martin@ximian.com>
1189
1190         * expression.cs: Completely merged with the gmcs version.
1191
1192 2006-09-19  Martin Baulig  <martin@ximian.com>
1193
1194         * expression.cs (Invocation): Merged with the gmcs version.
1195         (ArrayAccess.GetStoreOpcode): Likewise.
1196
1197 2006-09-19  Martin Baulig  <martin@ximian.com>
1198
1199         * typemanager.cs
1200         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1201         (TypeManager.IsGenericMethodDefinition): Likewise.
1202
1203 2006-09-19  Martin Baulig  <martin@ximian.com>
1204
1205         * typemanager.cs
1206         (TypeManager.IsEqual): Moved the gmcs implementation here.
1207         (TypeManager.DropGenericTypeArguments): Likewise.
1208         (TypeManager.DropGenericMethodArguments): Likewise.
1209         (TypeManager.GetTypeArguments): Moved here from gmcs.
1210         (TypeManager.HasGenericArguments): Likewise.
1211
1212 2006-09-19  Martin Baulig  <martin@ximian.com>
1213
1214         * expression.cs (Binary): Merged with the gmcs version.
1215
1216 2006-09-19  Martin Baulig  <martin@ximian.com>
1217
1218         * expression.cs (Probe, As, Is): Merged with the gmcs version.
1219
1220 2006-09-19  Martin Baulig  <martin@ximian.com>
1221
1222         * typemanager.cs: Merged with the gmcs version.
1223
1224 2006-09-16  Raja R Harinath  <rharinath@novell.com>
1225
1226         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1227         * driver.cs: Likewise.
1228
1229 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
1230
1231         A fix for #79401
1232         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1233         only if parent type is class.
1234         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1235         update.
1236
1237 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
1238
1239         * cs-parser.jay,
1240         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1241         keywords are used.
1242         * typemanager.cs(CSharpName): Converts NullType to null.
1243
1244 2006-09-15  Martin Baulig  <martin@ximian.com>
1245
1246         * typemanager.cs
1247         (TypeManager.GetMethodName): Added mcs implementation.
1248         (TypeManager.IsEqual): Likewise.
1249
1250         * ecore.cs
1251         (SimpleName.RemoveGenericArity): Added dummy implementation.
1252
1253         * pending.cs: Merged with the gmcs version.     
1254
1255 2006-09-15  Martin Baulig  <martin@ximian.com>
1256
1257         * statement.cs: Merge with the gmcs version.
1258
1259 2006-09-15  Martin Baulig  <martin@ximian.com>
1260
1261         * statement.cs (Switch): Merge with the gmcs implementation
1262         (without nullables), which is newer.
1263
1264 2006-09-15  Martin Baulig  <martin@ximian.com>
1265
1266         * statement.cs (Block.Variables): Make this public.
1267         (ToplevelBlock.Parameters): Make this a property.
1268         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1269
1270 2006-09-15  Martin Baulig  <martin@ximian.com>
1271
1272         * namespace.cs: Merge with the gmcs version.
1273
1274 2006-09-15  Martin Baulig  <martin@ximian.com>
1275
1276         * decl.cs (MemberName): Minor code cleanups.
1277
1278 2006-09-15  Martin Baulig  <martin@ximian.com>
1279
1280         * parameter.cs: Merge with the gmcs version.
1281
1282 2006-09-15  Martin Baulig  <martin@ximian.com>
1283
1284         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1285         and an error in mcs.
1286
1287 2006-09-15  Martin Baulig  <martin@ximian.com>
1288
1289         * flowanalysis.cs: Merged from GMCS; added the generics code into
1290         a `GMCS_SOURCE' conditional so we can share this file.
1291
1292 2006-09-08  Martin Baulig  <martin@ximian.com>
1293
1294         * typemanager.cs (TypeManager.interlocked_type): New public field.
1295         (TypeManager.int_interlocked_compare-exchange): New public field.
1296         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1297         enumerator types here and call InitGenericCoreTypes().
1298         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1299         after calling InitEnumUnderlyingTypes().
1300
1301         * rootcontext.cs
1302         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1303         `classes_second_stage'. 
1304
1305 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
1306
1307         * assign.cs, ecore.cs, expression.cs: Share error message text.
1308         * class.cs (FieldMember.Define): Check for varible of static type.
1309         * driver.cs (LoadAssembly): Uses error output for errors.
1310         * statement.cs: Updated.
1311
1312 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
1313
1314         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1315         type instance.
1316
1317 2006-09-07  Martin Baulig  <martin@ximian.com>
1318
1319         * driver.cs
1320         (MainDriver): Revert r62663 from Marek; see #70506 for details.
1321
1322 2006-08-29  Miguel de Icaza  <miguel@novell.com>
1323
1324         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1325         
1326 2006-08-17  Miguel de Icaza  <miguel@novell.com>
1327
1328         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1329         #52019 and #79064, the use of the \uXXXX sequence in source code
1330         to represent unicode characters.
1331
1332 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
1333
1334         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1335         support.
1336         * class.cs, ecore.cs, statement.cs: Merged to one error message.
1337
1338 2006-08-13  Miguel de Icaza  <miguel@novell.com>
1339
1340         * assign.cs: Catch attempts to assign to a method groups in += and
1341         report as 1656
1342
1343 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
1344
1345         A fix for #79056
1346         * cs-parser.jay: Don't destroy current array type by typeof of array's.
1347
1348 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
1349
1350         * class.cs (Method.Define): Issue a warning when generic method looks like
1351         an entry point.
1352         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1353         as well.
1354
1355 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
1356  
1357         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1358         looking for ctor.
1359         * decl.cs (MemberCache.FindMembers): When container is interface we need to
1360         search all base interfaces as a member can be ambiguous.
1361         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1362         Constructor member type filter. 
1363         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1364         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1365         reporting for returned memberinfos.
1366         * report.cs: Updated.
1367         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1368         version to work on all runtimes.
1369         (TypeManager.RealMemberLookup): Removed members filtering.
1370
1371 2006-08-08  Raja R Harinath  <rharinath@novell.com>
1372
1373         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1374         (PropertyExpr.EmitAssign): Likewise.
1375         * expression.cs (Indirection.EmitAssign): Likewise.
1376         (LocalVariableReference.EmitAssign): Likewise.
1377         (ParameterReference.EmitAssign): Likewise.
1378         (Invocation.EmitArguments): Likewise.
1379         (ArrayAccess.EmitAssign): Likewise.
1380         (IndexerAccess.EmitAssign): Likewise.
1381         (This.EmitAssign): Likewise.
1382         (ConditionalLogicalOperator.Emit): Likewise.
1383
1384         Fix #79026
1385         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
1386         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
1387         leave it in after returning it.
1388         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
1389
1390 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
1391
1392         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1393         message.
1394
1395 2006-08-03  Raja R Harinath  <rharinath@novell.com>
1396
1397         Fix cs0146-3.cs and cs0146-4.cs.
1398         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1399         enclosing types don't depend on the current type.
1400
1401 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1402
1403         Fix #77963
1404         * class.cs (TypeContainer.DoDefineMembers): Use
1405         FindBaseMemberWithSameName on Parent, since we're interested in
1406         whether we hide inherited members or not.
1407         (FindBaseMemberWithSameName): Make slightly more robust.
1408
1409         Fix the non-generic testcase from #77396
1410         * decl.cs (DeclSpace.DeclContainer): Remove override.
1411
1412         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1413         declspaces for doppelgangers too.
1414         (UsingEntry): Implement IResolveContext.
1415         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1416         'this' as the resolve context.
1417         (LocalAliasEntry): Likewise.
1418
1419         Implement parts of #77403
1420         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1421         toplevel declaration space.  Each namespace declaration introduces
1422         a "partial" root declaretion space.
1423         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1424         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1425         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1426         from 'current_namespace.SlaveDeclSpace'.
1427         (namespace_declaration): Likewise.
1428         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1429         check.  It can't happen now.
1430         * decl.cs (DeclSpace.LookupType): Likewise.
1431         * driver.cs (MainDriver): Sanity check.
1432
1433 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1434
1435         * decl.cs (DeclSpace.FindNestedType): Remove.
1436         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1437         LookupTypeContainer to get the container of the nested type.
1438         * class.cs (TypeContainer.FindNestedType): Make non-override.
1439
1440 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1441
1442         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1443         * class.cs (TypeContainer.PartialContainer): ... here.
1444         (TypeContainer.AddBasesForPart): New helper.
1445         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1446         instead.
1447         * cs-parser.jay (current_class): Convert to DeclSpace.
1448         (struct_declaration, interface_declaration, class_declaration):
1449         Use AddBasesForPart instead of .Bases directly.
1450         * const.cs, iterators.cs: Update to changes.
1451
1452 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1453
1454         * class.cs (TypeContainer.AddMemberType): Rename from
1455         AddToTypeContainer.
1456         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1457         (AddTypeContainer): New.  Combine AddClassOrStruct and
1458         AddInterface.
1459         (AddPartial): Update.  Add 'is_partial' argument.
1460         * roottypes.cs: Update to changes.
1461         * cs-parser.jay (push_current_class): New helper for handling
1462         current_container and current_class.
1463         (struct_declaration, interface_declaration, class_declaration):
1464         Use it.
1465
1466 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1467
1468         * roottypes.cs: Rename from tree.cs.
1469
1470         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1471         * tree.cs (Tree, ITreeDump): Remove types.
1472         * rootcontext.cs (tree, Tree): Remove fields.
1473         (root, ToplevelTypes): New.
1474         * *.cs: Update to rename.
1475
1476         * tree.cs (Tree.RecordDecl): Remove.
1477         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1478         namespace here.
1479         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1480
1481 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1482
1483         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1484         DoFlowAnalysis and OmitStructFlowAnalysis here.
1485         (ec.With): Rename from WithUnsafe and generalize.
1486         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1487         (ec.WithFlowAnalyis): New.
1488         * ecore.cs, expression.cs, statement.cs: Update.
1489
1490 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1491
1492         * statement.cs (Block.ResolveMeta): Simplify slightly.
1493
1494         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1495         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1496         check_state to flags.
1497         (CheckState, ConstantCheckState): Update.
1498         (InUnsafe): New read-only property.
1499         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1500         arbitrary flags.
1501         (WithUnsafe): New helper similar to WithCheckState.
1502         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1503         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1504
1505 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1506
1507         Make comparisons use the same IL irrespective of whether they're
1508         in a 'checked' or 'unchecked' context: one of the issues in #78899
1509         * codegen.cs (EmitContext.CheckState): Make read-only property.
1510         (EmitContext.ConstantCheckState): Likewise.
1511         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1512         helper that implement a save/restore stack for CheckState
1513         values.  This is the only way to change check-state.
1514         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1515         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1516         (CheckedExpr.EmitBranchable): New forwarding method.
1517         (UnCheckedExpr): Likewise.
1518         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1519         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1520         (Checked.Resolve, checked.DoEmit): Likewise.
1521
1522 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1523
1524         * anonymous.cs: Cache the resolved anonymous delegate, and return
1525         this so that the ResolveTopBlock is only triggered once, not
1526         twice.
1527
1528         Currently we trigger ResolvetopBlock twice due to a first pass of
1529         argument check compatibility, and a second pass that does the
1530         actual resolution.   
1531         
1532 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1533
1534         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1535         modifiers.
1536         * rootcontext.cs (Reset): Add helper_classes.
1537
1538 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1539
1540         A fix for #78860
1541         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1542         correctly.
1543
1544 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1545
1546         * statement.cs (Lock): Handle expressions of type
1547         TypeManager.null_type specially.  Fixes #78770
1548
1549 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1550
1551         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1552         to an event.
1553
1554 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1555
1556         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1557         for accessors as well.
1558         * ecore.cs (EventExpr): Add AccessorTable.
1559
1560 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1561
1562         A fix for #78738
1563         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1564         for CS0122 where appropriate.
1565         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1566         level attributes.
1567         (Filter): Assembly can be null in the case of top level attributes.
1568
1569 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1570
1571         A fix for #78690
1572
1573         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1574         is done at global level.
1575
1576 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1577
1578         A fix for #77002, Implemented TypeForwarder support.
1579
1580         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1581         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1582         * typemanager.cs (): Add type_forwarder_attr_type.
1583
1584 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1585
1586         * report.cs: Add CS0469 warning.
1587
1588 2006-06-21  Martin Baulig  <martin@ximian.com>
1589
1590         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1591         the `try'-block, so we also report CS0016 etc. there.
1592
1593 2006-06-21  Martin Baulig  <martin@ximian.com>
1594
1595         * delegate.cs
1596         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1597
1598 2006-06-21  Martin Baulig  <martin@ximian.com>
1599
1600         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1601         also report CS1686 for parameters.
1602
1603 2006-06-21  Martin Baulig  <martin@ximian.com>
1604
1605         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1606         instead of an error if the value is not implicitly convertible to
1607         the switch types; fixes #77964.
1608
1609 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1610
1611         Fix #78673
1612         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1613         FieldBuilder is null.
1614
1615         Fix #78662
1616         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1617         'left' and 'right' before error-checking.
1618
1619 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1620
1621         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1622         Fixed bug #78601.
1623         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1624         (FieldExpr.DoResolve): likewise.
1625         (PropertyExpr.InstanceResolve): likewise.
1626         (EventExpr.InstanceResolve): likewise. 
1627
1628 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1629
1630         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1631         attribute applicable tests for attribute argument.
1632
1633 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1634
1635         Fix #78079
1636         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1637         (Binary.OverloadResolve_PredefinedIntegral): New.
1638         (Binary.OverloadResolve_PredefinedFloating): New.
1639         (Binary.OverloadResolve_PredefinedString): New.
1640         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1641         Follow the standard more closely, and treat numeric promotions in
1642         terms of overload resolution.
1643         (Binary.CheckShiftArguments): Simplify.
1644
1645 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1646
1647         * flowanalysis.cs (MyBitVector): Simplify representation.
1648         (MyBitVector.Clone): Avoid allocating BitArray.
1649         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1650         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1651         (*): Update.  Change all references to MyBitVector.And and
1652         MyBitVector.Or to &= and |=.
1653
1654 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1655
1656         Fix cs0231-[34].cs.
1657         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1658         to param arguments too.
1659
1660 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1661
1662         * cs-parser.jay: Catch another parsing form for arglist being
1663         followed by other arguments.  Fixes #78313.
1664
1665 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1666
1667         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1668         checking of out parameters to ...
1669         (FlowBranchingToplevel.Merge): ... here.
1670         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1671         set, propagate the origin upward, and only complain if there was
1672         no other error.
1673         (FlowBranchingException.AddContinueOrigin): Likewise.
1674         (FlowBranchingException.AddReturnOrigin): Likewise.
1675         (FlowBranchingException.AddGotoOrigin): Likewise.       
1676
1677 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1678
1679         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1680         unreachable, skip it.
1681         (FlowBranchingException.Merge): Always propagate jumps, even if
1682         the finally block renders subsequent code unreachable.
1683
1684 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1685
1686         Fix #77601
1687         * statement.cs (Goto.Resolve): Move responsibility for resolving
1688         'goto' to FlowBranching.AddGotoOrigin.
1689         (Goto.SetResolvedTarget): New.  Callback to set the
1690         LabeledStatement that's the target of the goto.
1691         (Goto.DoEmit): Use Leave instead of Br when crossing an
1692         unwind-protect boundary.
1693         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1694         LookupLabel and adjust to new semantics.
1695         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1696         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1697         Goto.SetResolvedTarget to update target.
1698         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1699         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1700         AddBreakOrigin & co.  Delay propagation until ...
1701         (FlowBranchingException.Merge): ... this.
1702
1703         * statement.cs (Block.Resolve): Always depend on flow-branching to
1704         determine unreachability.  Kill workaround that originally emitted
1705         only one statement after an "unreachable" label (see infloop in
1706         test-515.cs).
1707
1708         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1709         This is still "wrong", but anything better would probably need a
1710         multi-pass algorithm.
1711         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1712         usage vector.  Force current usage vector to be reachable, to
1713         optimistically signify backward jumps.
1714         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1715         detected.
1716         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1717         detected, return the original salted-away usage vector instead,
1718         updated with appropriate changes.  Print unreachable warning if
1719         necessary.
1720         * statement.cs (Block.Resolve): Don't print unreachable warning on
1721         a labeled statement.
1722
1723 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1724
1725         * driver.cs: Pass filename without path to AssemblyBuilder's 
1726         AddResourceFile. Fixes bug #78407.
1727
1728 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1729
1730         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1731         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1732         (FlowBranching.MergeChild): Overwrite
1733         reachability information from Labeled branchings too.
1734
1735 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1736
1737         * statement.cs (Goto.Resolve): Merge jump origins here ...
1738         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1739
1740         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1741         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1742         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1743         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1744         here, ...
1745         * statement.cs (Goto.Resolve): ... not here.
1746         (Goto.Emit): Remove CS1632 check.
1747
1748 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1749
1750         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1751         error message.
1752
1753 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1754
1755         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1756         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1757         (FlowBranchingException.Label): Likewise.
1758
1759         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1760         given value.
1761         (MyBitVector.Or): Use it to avoid losing information (Count).
1762         (FlowBranching.MergeOrigins): Likewise.
1763
1764         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1765         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1766         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1767         (UsageVector.ToString): Simplify.
1768         (UsageVector.MergeSiblings): Move here from ...
1769         (FlowBranching.Merge): ... here.
1770         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1771         not a MyBitVector.
1772
1773 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1774
1775         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1776         null bitvector is treated as all-true.
1777
1778         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1779         (MyBitVector): Rationalize invariants.  'vector != null' implies
1780         that we have our own copy of the bitvector.  Otherwise,
1781         'InheritsFrom == null' implies all inherited bits are true.
1782
1783 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1784
1785         * statement.cs (LocalInfo): Add IsConstant.
1786         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1787         local variable for constants.
1788
1789 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1790
1791         * flowanalysis.cs (MyBitVector.Empty): New.
1792         (MyBitVector): Don't allow InheritedFrom to be null.
1793         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1794         (UsageVector, FlowBranching): Update to changes.
1795
1796         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1797         recursion.  The 'Parent == null' condition isn't sufficient for
1798         anonymous methods.
1799         (FlowBranching.AddBreakOrigin): Likewise.
1800         (FlowBranching.AddContinueOrigin): Likewise.
1801         (FlowBranching.AddReturnOrigin): Likewise.
1802         (FlowBranching.StealFinallyClauses): Likewise.
1803         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1804         (FlowBranching.CheckOutParameters): Likewise.
1805         (FlowBranchingToplevel): Terminate all the above recursions here.
1806         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1807         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1808
1809         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1810         toplevel block.
1811         (FlowBranchingToplevel): New.  Empty for now.
1812         (FlowBranching.MergeTopBlock): Update.
1813         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1814         branching for the anonymous delegate.
1815         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1816
1817         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1818         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1819         information at the start of the merge.  Reorganize.
1820
1821 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1822
1823         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1824
1825 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1826
1827         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1828         to newly introduced ctor.
1829
1830         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1831         message to one place.
1832         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1833         global namespace.
1834
1835 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1836
1837         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1838
1839         * ecore.cs (Expression.ResolveAsConstant): Updated.
1840
1841         * statement.cs (ResolveMeta): Updated.
1842
1843 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1844
1845         * cs-parser.jay: __arglist cannot be used in initializer.
1846
1847 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1848
1849         A fix for #77879
1850         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1851         private types.
1852
1853 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1854
1855         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1856         (LabeledStatement): Add 'name' parameter.
1857         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1858         (Block.AddLabel): Update to changes.
1859         * cs-parser.jay (labeled_statement): Likewise.
1860
1861         * flowanalysis.cs (BranchingType.Labeled): New.
1862         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1863         (FlowBranchingLabeled): New.  Does nothing for now, but will
1864         eventually handle 'goto' flows.
1865         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1866         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1867         that's terminated ...
1868         (Block.Resolve): ... here.
1869
1870         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1871         (UsageVector.MergeFinallyOrigins): Likewise.
1872         (FlowBranching.InTryOrCatch): Likewise.
1873         (FlowBranching.AddFinallyVector): Likewise.
1874         (FlowBranchingException): Update to changes.
1875
1876         Fix #78290
1877         * statement.cs (Return.Resolve): Move error checking to ...
1878         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1879         (FlowBranchingException): Handle return origins like break and
1880         continue origins.
1881         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1882
1883 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1884
1885         A fix for #76122
1886         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1887         filter.
1888
1889 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1890
1891         A fix for #77543
1892         * class.cs (MethodData.Define): Do public accessor check only when method
1893         implements an interface.
1894
1895 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1896
1897         Remove special handling of 'break'
1898         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1899         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1900         (UsageVector.Break): Remove.
1901         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1902         reachability.
1903         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1904
1905         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1906         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1907
1908 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1909
1910         A fix for #75726
1911         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1912         be the interface member.
1913
1914 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1915
1916         A fix for #60069
1917         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1918         for emitting small (int) values.
1919
1920 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1921
1922         Fix #59427
1923         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1924         control-flow passes through the 'finally' after merging-in all the
1925         control-flows from 'try' and the 'catch' clauses.
1926
1927         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1928         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1929         always true at the only non-recursive entry point.
1930         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1931         FlowBranchingBreakable.
1932         (FlowBranchingLoop): Remove.
1933         * statement.cs (Return.DoResolve): Update to changes.
1934
1935         Fix #76471, #76665
1936         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1937         (FlowBranching.CreateBranching): Handle it: create a
1938         FlowBranchingContinuable.
1939         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1940         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1941         except that it handles the 'continue' command.
1942         (FlowBranching.UsageVector.MergeOrigins): Rename from
1943         MergeBreakOrigins.
1944         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1945         except that it overrides AddContinueOrigin.
1946         (FlowBranchingException): Override AddContinueOrigin, similar to
1947         AddBreakOrigin.
1948         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1949         Create a new branching around the embedded statement.
1950         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1951         control flow after the embedded statement.
1952         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1953
1954         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1955         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1956         FlowBranchingBreakable.
1957         (FlowBranchingSwitch): Remove.
1958
1959         Fix test-503.cs
1960         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1961         error reporting to ...
1962         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1963         Rename from 'AddBreakVector'.  Add new location argument.  Return
1964         a bool indicating whether the 'break' crosses an unwind-protect.
1965         (FlowBranchingException.AddBreakOrigin): Add.
1966         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1967         flowbranching after updating with the effects of the 'finally'
1968         clause.
1969         (FlowBranchingBreakable): New common base class for
1970         FlowBranchingLoop and FlowBranchingSwitch.
1971
1972         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1973         embedded statement.
1974         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1975
1976 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1977
1978         * statement.cs (Do.Resolve): If the loop is infinite, set the
1979         barrier.
1980         (While.Resolve, For.Resolve): Set a barrier after the embedded
1981         statement.  There's no direct control flow that goes from the end
1982         of the embedded statement to the end of the loop.
1983         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1984         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1985         above ensure that the reachability is correctly computed.
1986
1987         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1988         (UsageVector.MergeBreakOrigins): If the current path is
1989         unreachable, treat it as if all parameters/locals are initialized.
1990         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1991         infinite loops before merging-in break origins.
1992
1993         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1994         (Reachability.Reachable): Split part into ...
1995         (Reachability.Unreachable): ... this.  Simplify.
1996         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1997
1998         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1999         (Reachability.SetThrowsSometimes): Likewise.
2000         (FlowBranchingBlock.MergeTopBlock): Don't compare against
2001         TriState.Always, use corresponding property.
2002         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2003         (Block.Resolve): Likewise.  Remove some redundant checks.
2004
2005 2006-05-02  Raja R Harinath  <harinath@gmail.com>
2006
2007         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2008         (Reachability.Meet): Don't bother checking AlwaysThrows --
2009         barrier is always set.
2010         (FlowBranchingBlock.Merge): Likewise.
2011
2012 2006-05-01  Raja R Harinath  <harinath@gmail.com>
2013
2014         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2015         checks for unreachable.
2016
2017 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
2018
2019         A fix for #77980
2020         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2021
2022         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2023         whether field is really assigned.
2024
2025 2006-04-30  Raja R Harinath  <harinath@gmail.com>
2026
2027         * flowanalysis.cs (Reachability): Make 4-argument constructor
2028         private.
2029         (Reachability.Meet): Rename from 'And'.  Remove static variant.
2030         (Reachability.Always): Rename from the highly misleading
2031         'Reachability.Never'.
2032         (FlowBranching.Merge): Update to changes.  Mark an impossible
2033         situation with a 'throw'.
2034         (*): Update to changes.
2035
2036 2006-04-29  Raja R Harinath  <harinath@gmail.com>
2037
2038         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2039         Remove 'Undefined'.
2040         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2041         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2042         (*): Update to changes.
2043         * statement.cs: Update to changes.
2044
2045 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
2046
2047         A fix for #78049
2048         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2049
2050 2006-04-28  Raja R Harinath  <harinath@gmail.com>
2051
2052         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2053         dummy UsageVector.
2054
2055         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2056         argument to two arguments: an usage-vector and a bool.  Move call
2057         to FlowBranching.Merge () ...
2058         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2059
2060         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2061         handling of loop and switch reachability to ...
2062         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2063
2064 2006-04-27  Raja R Harinath  <harinath@gmail.com>
2065
2066         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2067         handling to FlowBranchingLoop.InLoop.
2068         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2069
2070 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
2071
2072         A fix for #78115
2073         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2074         anonymous method is allowed from AnonymousContainer here.
2075
2076         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2077
2078 2006-04-24  Raja R Harinath  <rharinath@novell.com>
2079
2080         Fix #78156
2081         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2082
2083 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
2084
2085         A fix for #49011.
2086         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2087         (DoubleConstant.Reduce): Ditto.
2088
2089 2006-04-23  Raja R Harinath  <rharinath@novell.com>
2090
2091         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2092         Remove 'lvalue_right_side' argument.  Move parts to ...
2093         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2094         (LocalVariable.DoResolveLValue): ... these.
2095
2096 2006-04-21  Raja R Harinath  <rharinath@novell.com>
2097
2098         Fix cs1655.cs
2099         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2100         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2101         (LocalVariableReference.DoResolveBase): Use it to implement new
2102         CS1655 check.
2103         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2104         (Argument.Resolve): Simplify.  Move CS1510 check ...
2105         * ecore.cs (Expression.ResolveLValue): ... here.
2106         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2107         (PropertyExpr.DoResolveLValue): Likewise.
2108         (FieldExpr.Report_AssignToReadonly): Likewise.
2109         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
2110         LValueMemberAccess or LValueMemberOutAccess on instance depending
2111         on it.
2112         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2113         DoResolve as appropriate.
2114
2115 2006-04-20  Raja R Harinath  <rharinath@novell.com>
2116
2117         Fix #75800
2118         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2119         implicit conversions on 'out' and 'ref' arguments.
2120
2121         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2122         improve clarity.  Remove dead code.
2123
2124         Fix #66031
2125         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2126         (Catch.Resolve): Resolve VarBlock if it exists.
2127
2128 2006-04-19  Miguel de Icaza  <miguel@novell.com>
2129
2130         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2131         twice, this was some residual code, the enumerator was emitted
2132         properly in the two branche of if later.
2133
2134 2006-04-19  Raja R Harinath  <rharinath@novell.com>
2135
2136         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
2137         cast is never an lvalue.
2138         (Cast.DoResolve, Cast.ResolveRest): Combine.
2139         (Argument.Emit): Simplify slightly.  Move 'Expr is
2140         IMemoryLocation' check ...
2141         (Argument.Resolve): ... here.
2142         (Argument.Error_LValueRequired): Remove.  Inline into only user.
2143
2144         Simplifications.  Fix cs0191-2.cs
2145         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2146         CS1649 and CS1651 to ...
2147         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
2148         the actual selection of the error code and message to a lookup
2149         table.  Add a dummy return value to simplify callsites.
2150         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2151         readonly fields of other instances of the same type.  Move CS0197
2152         warning from ...
2153         * expression.cs (Argument.Resolve): ... here.  Simplify code.
2154         Ensure that ec.InRefOutArgumentResolving is only set during LValue
2155         resolution of an out or ref argument.  The code simplification
2156         above uses this invariant.
2157
2158 2006-04-18  Raja R Harinath  <rharinath@novell.com>
2159
2160         Possibly fix #77752.  Fix cs1690-[4-7].cs.
2161         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2162         CheckMarshallByRefAccess.  Drop parameter.
2163         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
2164         warning.
2165         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2166         InstanceExpression.
2167         * report.cs (AllWarnings): Add CS1690.
2168         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2169         for ref access too.
2170         (LocalVariableReference.DoResolveBase): Update.
2171
2172 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2173
2174         * class.cs (MethodOrOperator): Moved common parts from method class.
2175         detect obsolete attributes.
2176         (Method.Define): Simplified as it reuses code from base.
2177         (Constructor.ValidAttributeTargets): Fixed issue found during
2178         refactoring.
2179         (Destructor.ValidAttributeTargets): Fixed issue found during
2180         refactoring.
2181         (Operator): Finished refactoring set off by #78020. Operator class is now
2182         ordinary method class.
2183
2184         * anonymous.cs: Updated.
2185
2186         * decl.cs (DeclSpace): Add IsGeneric
2187
2188 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2189
2190         * class.cs (Constructor.Emit): Don't emit the attributes twice.
2191
2192 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2193
2194         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2195         detect obsolete attributes.
2196         (Method.CreateEmitContext): Moved to MethodOrOperator.
2197
2198 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2199
2200         A fix for #78048.
2201         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2202         customized exception to make crash detection easier.
2203         (MethodOrOperator): Started to work on new base class for methods and
2204         operators.
2205         (Method): Derives from MethodOrOperator.
2206         (Constructor.Emit): Emits its own attributes.
2207         (AbstractPropertyEventMethod.Emit): Ditto.
2208         (Operator): Derives from MethodOrOperator, will refactor fully in extra
2209         patch.
2210         (Operator.Emit): It's temporary more tricky than should be.
2211         
2212         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2213
2214         * report.cs (InternalErrorException): Add ctor with inner exception.
2215
2216 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2217
2218         A fix for #76744.
2219         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2220         only not visible.
2221
2222 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
2223
2224         A fix for #77916.
2225         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2226         array.
2227
2228 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2229
2230         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2231         attribute is present and Guid not.
2232         (Interface.ApplyAttributeBuilder): Ditto.
2233
2234         * attribute.cs: Add error message.
2235
2236 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2237
2238         A fix for #78020.
2239
2240         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2241         sources (it's composite) so hold them in extra array as they are used in
2242         Emit phase only. It worked in the previous versions by mistake.
2243         (Attribute.Emit): Emit attribute for more owners when exist.
2244
2245         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2246         it has now different behaviour.
2247
2248 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2249
2250         * constant.cs (Constant.IsDefaultInitializer): New method.
2251
2252         * class.cs: Updated.
2253
2254         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2255         re-initialize default values. It saves KBs almost for every assembly.
2256         Thanks Zoltan for the idea.
2257         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2258         (ArrayCreation.DoResolve): Resolve only once.
2259         (ArrayCreation.Emit): Emit static initializer only when it is faster.
2260         (ArrayCreation.GetAttributableValue): Cope with optimized values.
2261
2262 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
2263
2264         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2265         From #77961.
2266
2267 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2268
2269         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2270         in an embedded statement too.
2271
2272 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2273
2274         Fix #77958
2275         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2276
2277 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2278
2279         A fix for #77966.
2280
2281         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2282         was not specified.
2283
2284         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2285
2286 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
2287
2288         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2289         phase.
2290
2291         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2292         LocalTemporary change.
2293
2294         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2295         TypeContainer.
2296         (ClassOrStruct.DefineFieldInitializers): Implemented static field
2297         initializers optimization.
2298         (ClassOrStruct.TypeAttr): Moved from modifiers.
2299         (Constructor.CheckBase): Don't crash when static ctor has parameters.
2300         (FieldBase.ResolveInitializer): Resolves initializer.
2301         (FieldBase.HasDefaultInitializer): New property.
2302
2303         * cs-parser.jay: Removed message.
2304
2305         * expression.cs (CompilerGeneratedThis): New specialization.
2306
2307         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2308
2309 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
2310
2311         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2312
2313 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2314
2315         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2316         be now EnumConstants only.
2317
2318 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2319
2320         * attribute.cs, driver.cs: Reset more caches.
2321
2322 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2323
2324         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2325
2326 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2327
2328         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2329         for easier reuse. Updated all overrides.
2330         (IntegralConstant): New base class for all integral constants.
2331         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2332         of the constant range, report custom error.
2333         (UIntConstant.Reduce): Fixed uint conversion.
2334
2335         * ecore.cs, literal.cs: Reduce updates.
2336
2337 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2338
2339         A fix for #75813.
2340
2341         * class.cs (Constructor.Define): Removed extra if for default ctors.
2342         A patch from Atsushi Enomoto.
2343
2344 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2345
2346         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2347         GetAttributableValue.
2348
2349         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2350         when required.
2351
2352         * convert.cs (ImplicitConversionRequired): Error message moved to
2353         DoubleLiteral.
2354
2355         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2356         automatic implicit conversion of an output value.
2357         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2358
2359         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2360         conversion.
2361         (TypeOf.GetAttributableValue): Add extra handling for object type.
2362
2363         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2364         special error message.
2365
2366 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
2367
2368         * class.cs (Constructor.Emit): Don't crash when struct ctor is
2369         InternalCall.
2370         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2371         compatible with MS runtime.
2372
2373 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
2374
2375         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2376         attribute arguments here.
2377
2378         * class.cs (Indexer.Define): The check was moved to attribute class.
2379
2380 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
2381
2382         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2383         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2384         easier.
2385
2386 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2387
2388         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2389         mcs to keep code differences small.
2390         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2391         * typemanager.cs (parameter_default_value_attribute_type): New.
2392         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2393         CS1908 check.
2394
2395 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2396
2397         * expression.cs (StringConcat.Append): Reverted back to no warning state.
2398
2399 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2400
2401         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2402
2403         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2404         the blocks too.
2405
2406 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2407
2408         * doc-bootstrap.cs : fix build.
2409
2410 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2411
2412         * expression.cs (StringConcat.Append): Issue a warning when empty string
2413         is going to append.
2414
2415 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2416
2417         * assign.cs (CompoundAssign.ResolveSource): Removed.
2418
2419         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2420         clean up.
2421
2422         * class.cs (TypeContainer.FindMethods): Removed.
2423         (TypeContainer.CheckMemberUsage): Made static.
2424
2425         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2426
2427         * constant.cs (CheckRange): Removed unused type argument.
2428         (CheckUnsigned): Removed unused type argument.
2429
2430         * cs-parser.jay: Updated after MemberAccess clean up.
2431         Uses Length for empty string test.
2432
2433         * cs-tokenizer.cs: Uses Length for empty string test.
2434         (IsCastToken): Made static.
2435         (is_hex): Made static.
2436         (real_type_suffix): Made static.
2437
2438         * decl.cs (SetupCache): Made static.
2439         (OnGenerateDocComment): Removed unused ds argument.
2440
2441         * delegate.cs (VerifyDelegate): Removed unused argument.
2442
2443         * doc.cs: Uses Length for empty string test.
2444
2445         * driver.cs: Uses Length for empty string test.
2446
2447         * enum.cs (IsValidEnumType): Made static
2448
2449         * expression.cs (EnumLiftUp): Removed unused argument.
2450         (ResolveMethodGroup): Ditto.
2451         (BetterConversion): Ditto.
2452         (GetVarargsTypes): Ditto.
2453         (UpdateIndices): Ditto.
2454         (ValidateInitializers): Ditto.
2455         (MemberAccess.ctor): Ditto.
2456         (GetIndexersForType): Ditto.
2457
2458         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2459
2460         * iterators.cs: Updated after MemberAccess clean up.
2461
2462         * location.cs: Uses Length for empty string test.
2463
2464         * namespace.cs: Uses Length for empty string test.
2465
2466          * report.cs (CheckWarningCode): Made static.
2467
2468         * statement.cs (LabeledStatement): Removed unused argument.
2469
2470         * typemanager.cs (FilterNone): Removed.
2471
2472 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2473
2474         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2475         obsolete.
2476
2477         * class.cs: Updated.
2478
2479 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2480
2481         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2482
2483 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2484
2485         A fix for #77822.
2486
2487         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2488         reporting, it's more tricky than I thought.
2489
2490 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2491
2492         A fix for #77816.
2493
2494         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2495         host container.
2496         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2497         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2498         Add more error reporting; Fixed issue with params.
2499
2500         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2501
2502         * cs-parser.jay: AnonymousMethod requires host container.
2503
2504         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2505
2506 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2507
2508         * class.cs: Change 'TypeContainer ds' constructor argument to
2509         'DeclSpace parent'.  Some classes were missed below due to
2510         different naming convention.
2511
2512         * class.cs (MemberCore.Parent): Delete.  This makes the
2513         ParentContainer changes below enforceable by the compiler.
2514
2515         Treat pointers to enclosing declaration space as 'DeclSpace', not
2516         'TypeContainer'.
2517         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2518         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2519
2520         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2521         of TypeContainer.
2522         (Block.AddThisVariable): Likewise.
2523         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2524         (AbstractPropertyEventMethod.Emit): Likewise.
2525         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2526         (GetMethod.Define, SetMethod.Define): Likewise.
2527         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2528         (DelegateMethod.EmitMethod): Likewise.
2529
2530         Fix regression test-partial-13.cs.
2531         Rationalize use of PartialContainer.  Ensure that the partial
2532         class semantics can be tied to type-correctness, i.e., any
2533         violation will cause a compile error.
2534         * class.cs, const.cs: Access all fields that belong to class
2535         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2536         Resolve()-like functions still use 'Parent'.
2537
2538         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2539         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2540         (PropertyMethod.CheckModifiers): Remove unused argument.
2541         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2542         DeclSpace.
2543
2544 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2545
2546         Make semantics of PartialContainer simpler.
2547         * decl.cs (DeclSpace.IsPartial): Remove.
2548         * class.cs (TypeContainer.IsPartial): Likewise.
2549         (TypeContainer..ctor): Set PartialContainer to point to self.
2550         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2551         (TypeContainer.FindNestedType): Likewise.
2552         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2553
2554 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2555
2556         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2557
2558 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2559
2560         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2561         classes.
2562
2563 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2564
2565         * class.cs (Operator.Define): An error for base conversion was not
2566         reported correctly.
2567
2568 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2569
2570         * iterator.cs : yield break is allowed in try statement which has
2571           catch clauses. Fixed bug #77767.
2572
2573 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2574
2575         A fix for #77593, #77574.
2576
2577         * class.cs (MethodCore.CheckBase): Another if for operator.
2578
2579 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2580
2581         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2582         were not resolved
2583
2584         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2585         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2586         conversion test.
2587         
2588         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2589         not needed.
2590
2591         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2592         Updated after another emitcontext usage was clean up. It should help us to
2593         synchronize with gmcs easier.
2594
2595 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2596
2597         A fix for #77353.
2598
2599         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2600         (Event.Define): ditto
2601         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2602
2603         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2604         Removed redundant code and set NewSlot for Invoke method too.
2605
2606         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2607         (Parameters.MergeGenerated): New method. Use this method when you merge
2608         compiler generated argument with user arguments.
2609
2610 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2611
2612         * attribute.cs (ResolveAsTypeTerminal): Removed.
2613
2614         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2615         specialization for predefined types; 30% speed up.
2616         Finally placed obsolete check to right place.
2617         (Expression.ResolveType): Removed.
2618
2619         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2620         Updated after ResolveType was removed.
2621
2622         * expression.cs (Cast.ctor): Check void cast.
2623         (Binary.ResolveAsTypeTerminal): Is never type.
2624         (Conditional.ResolveAsTypeTerminal): Is never type.
2625
2626         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2627
2628 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2629
2630         Fix #77679.
2631         * expression.cs (ParameterReference.DoResolveBase): Change return
2632         type to bool.
2633         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2634         Update.
2635
2636         Fix #77628.
2637         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2638
2639         Fix #77642.
2640         * typemanager.cs (GetFullNameSignature): Don't nullref on
2641         protected accessors.
2642
2643 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2644
2645         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2646         these two separated members to simplify the code.
2647         (Attribute.Resolve): Refactored to use new fields and methods.
2648         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2649         implemented obsolete attribute checking.
2650         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2651         implemented obsolete checking again. It look line never ending quest ;-)
2652         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2653
2654         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2655
2656         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2657
2658         *class.cs (Property.Define): Add RegisterProperty call.
2659
2660         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2661         argument groups (only 2).
2662
2663         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2664         encoding expression to arguments.
2665         (Expression.ExprClassToResolveFlags): Just turned to property.
2666
2667         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2668         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2669         optimized as well as implemented support for zero-length attributes.
2670
2671         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2672         Add caching of PropertyInfo's.
2673
2674 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2675
2676         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2677         error multiple times.
2678
2679 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2680
2681         New partial class implementation.
2682         A fix for #77027, #77029, #77403
2683
2684         * attribute.cs (Attributable): Made attributes protected.
2685
2686         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2687         the replacements of ClassPart and PartialContainer.
2688         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2689         (TypeContainer.AddInterface): Ditto.
2690         (TypeContainer.AddPartial): The main method for partial classes. It checks
2691         for errors and merges ModFlags and attributes. At the end class is added to
2692         partial_parts list.
2693         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2694         required here.
2695         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2696         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2697         from the rest of partial classes.
2698         (TypeContainer.GetClassBases): Simplified.
2699         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2700         DefineType.
2701         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2702         (TypeContainer.HasExplicitLayout): Uses Flags now.
2703         (PartialContainer): Removed.
2704         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2705         (StaticClass): Was merged with Class.
2706         (Class.GetClassBases): class and static class bases are verified here.
2707         (Class.TypeAttr): Added static attributes when class is static.
2708         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2709         (MemberBase): In some cases we need to call parent container for partial
2710         class. It should be eliminated but it's not easy now.
2711
2712         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2713
2714         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2715         partial classed to accumulate class comments.
2716         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2717
2718         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2719
2720         * driver.cs (MainDriver): Tree.GetDecl was removed.
2721
2722         * modifiers.cs (Modifiers): Add partial modifier.
2723
2724         * tree.cs (Tree.decl): Removed.
2725         (RootTypes): Started to use this class more often for root types
2726         specializations.
2727
2728 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2729
2730         A fix for #77615
2731
2732         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2733         external interface does not have an attribute.
2734
2735 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2736
2737         Another prerequisites for new partial classs implementation.
2738         
2739         * attribute.cs (Attribute.Equal): Implemented.
2740         (Attribute.Emit): Changed as attributes can be applied more than twice.
2741         (Attributes.Emit): Check for duplicate attributes here.
2742
2743         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2744         as a parameter, clean-up.
2745
2746 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2747
2748         A fix for #77485
2749
2750         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2751         contains obsolete attribute check which can in some cases look for base
2752         type of current class which is not initialized yet.
2753         (TypeContainer.BaseType): Replacement of ptype.
2754
2755         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2756
2757 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2758
2759         First of prerequisites for new partial classs implemention.
2760         
2761         * attribute.cs (Attributable): Extended by ResolveContext;
2762         Attributes finally have correct context for resolving in all cases.
2763         (AttachTo): Attribute owner is assigned here.
2764
2765         * codegen.cs (IResolveContext): Introduce new interface to hold
2766         all information needed in resolving phase.
2767         (EmitContext): Implements IResolveContext; more clean-up needed here.
2768         
2769         * decl.cs (MemberCore): Implemented IResolveContext.
2770
2771         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2772         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2773         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2774         Refactored to use new IResolveContext instead of EmitContext; cleanup
2775
2776 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2777
2778         * codegen.cs (EmitScopeInitFromBlock): check here the
2779         capture_context, there is no need to make two calls to the
2780         EmitContext. 
2781
2782         * anonymous.cs: Add some debugging messages that might help me
2783         track other instances of this problem in the future (the
2784         regression of test 467).
2785
2786         * cs-parser.jay: track the variable block, as we need to initalize
2787         any captured variables declared in this block for the "catch"
2788         portion of the "Try" statement.
2789
2790         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2791         scope initialization for captured variables. 
2792
2793         Also, move the emit for the variables after the block location has
2794         been marked.
2795
2796 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2797
2798         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2799
2800 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2801
2802         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2803         commit yesterday, the initialization for the roots is necessary.
2804         What is not necessary is the scope activation.
2805
2806 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2807
2808         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2809         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2810         CS0206 checks.
2811         (Argument.Resolve): Remove CS0206 checks.
2812
2813 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2814
2815         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2816         scopes for all the roots, the scopes will now be emitted when the
2817         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2818
2819         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2820         code.  This reduces a lot of existing cruft.
2821         
2822         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2823         that the ScopeInfo is generated as we enter the scope, not at the
2824         time of use, which is what we used to do before.
2825
2826         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2827         every time a Block is about to be emitted if we have a
2828         CaptureContext. 
2829
2830 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2831
2832         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2833         (Reset): Update.
2834         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2835
2836         * typemanager.cs (cons_param_array_attribute): Make private.
2837         (Reset): Set it to null.
2838         (InitCoreHelpers): Don't initialize it.
2839         (ConsParamArrayAttribute): New.  Initialize it as needed.
2840         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2841
2842 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2843
2844         * expression.cs: There might be errors reported during the
2845         selection of applicable methods.  If there are errors, do not
2846         continue execution as it will lead the compiler to crash.
2847
2848 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2849
2850         * expression.cs: Member access is not allowed on anonymous
2851         methods.  Fixes #77402.
2852
2853 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2854
2855         Fix #77401
2856         * cs-parser.jay (VariableDeclaration): Don't set
2857         current_array_type to null.
2858         (field_declaration, event_declaration, declaration_statement):
2859         Set it to null here.
2860
2861 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2862
2863         * typemanager.cs (GenericParameterPosition): New.
2864         * doc.cs: Use it.
2865
2866 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2867
2868         * doc.cs : To process "include" elements, first we should create
2869           another list than XmlNodeList, because it could result in node
2870           removal, which could result in that the XmlNodeList gives up
2871           yielding next node.
2872
2873           (Also made code identical to gmcs again.)
2874
2875 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2876
2877         * ecore.cs: Introduce an error report that we were not catching
2878         before, if not silent, we must report the error.  Gonzalo ran into
2879         it.
2880
2881 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2882
2883         A fix for bug: #76957
2884         
2885         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2886         ComputeMethodHost before creating the method, this is a new
2887         requirement. 
2888
2889         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2890         that this method references (RegisterScope).  The actual scope
2891         where the method is hosted is computed with the ComputeMethodHost
2892         before we create the method.
2893
2894         Moved the Deepest routine here.
2895
2896         (AnonymousContainer.ComputeMethodHost): New routine used to
2897         compute the proper ScopeInfo that will host the anonymous method.
2898
2899         (ScopeInfo): Deal with multiple roots.  The problem was that we
2900         did not have a unique root where all ScopeInfos could be hanged
2901         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2902         of roots.  
2903
2904         Remove AdjustMethodScope which is now computed at the end.  Remove
2905         LinkScope which did a partial link, instead link all ScopeInfos
2906         before code generation from the new "LinkScopes" routine. 
2907
2908         Simplify all the Add* routines as they no longer need to maintain
2909         the tree, they just need to record that they are using variables
2910         from a ScopeInfo.
2911
2912         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2913         routines to produce the forest of ScopeInfo trees.
2914
2915         * class.cs (TypeContainer.AppendMethod): This is just like
2916         AddMethod, but ensures that an interface implementation method
2917         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2918         methods, but at the end.
2919
2920         We use this functionality to ensure that the generated MoveNext
2921         method in the iterator class is resolved/emitted before the
2922         enumerator methods created.   
2923
2924         This is required because the MoveNext method computes the right
2925         ScopeInfo for the method.  And the other methods will eventually
2926         need to resolve and fetch information computed from the anonymous
2927         method. 
2928
2929 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2930             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2931
2932         Fix rest of #76995.
2933         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2934         the 'aliases' hash.
2935         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2936         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2937
2938 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2939
2940         Fix #76656, cs0231-2.cs.
2941         * cs-parser.jay (formal_parameter_list): Make error case catch
2942         more issues.
2943         (parenthesized_expression_0): Add CS1026 check.
2944         (invocation_expression): Remove unused { $$ = lexer.Location }.
2945
2946 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2947
2948         Fix #76824.
2949         * cs-parser.jay (statement_expression): Don't list out the
2950         individual statement-expressions.  Convert syntax error into
2951         CS0201 check.
2952
2953 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2954
2955         Fix #76874.
2956         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2957         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2958         CheckIntermediateModification.
2959         (FieldExpr.DoResolve): Add new two-argument version that
2960         allows us to resolve the InstanceExpression as an lvalue.
2961         The one-argument variant is now just a wrapper.
2962         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2963         Resolve the lhs as an lvalue if the it has a value type.
2964         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2965         from Assign.DoResolve.
2966         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2967         resolved as an lvalue.
2968         (PropertyExpr.DoResolve): Update.
2969         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2970         has a value type.  Move CS1612 check here from
2971         CheckIntermediateModification.
2972         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2973         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2974         'right_side' of a ResolveLValue on an 'out' argument.
2975         (EmptyExpression.LValueMemberAccess): New.  Used as the
2976         'right_side' of a propagated ResolveLValue on a value type.
2977         (LocalVariableReference.DoResolveBase): Recognize
2978         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2979         Add CS1654 check.
2980         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2981         EmptyExpression.Null.
2982
2983 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2984
2985         * typemanager.cs : added IsGenericParameter(). In mcs it always
2986           return false.
2987         * doc.cs : for generic parameters, use GenericParameterPosition,
2988           not FullName.
2989
2990 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2991
2992         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2993
2994 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2995
2996         This fixes the problem where we used ldfld instead of ldflda to
2997         load the "THIS" pointer on captured parameters, when THIS is a
2998         value type.  See bug #77205.
2999         
3000         * iterators.cs (CapturedThisReference.Emit): Pass false to
3001         EmitThis (we do not need the address).
3002
3003         * codegen.cs (EmitThis): it needs to know whether we need the
3004         address of `this' or not.  This is used by value types.  
3005
3006         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3007         every other call passes false.
3008
3009 2006-01-12  Raja R Harinath  <rharinath@novell.com>
3010
3011         Fix #77221.
3012         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3013         GetOverride.
3014         * expression.cs (Invocation.OverloadResolve): Update.
3015         (Invocation.DoResolve): Avoid double resolution of invocation.
3016
3017 2006-01-11  Raja R Harinath  <rharinath@novell.com>
3018
3019         Fix #77180.
3020         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3021         unary negation of floating point types as 0-expr; negation cannot
3022         overflow in floating point types.
3023
3024         Fix #77204.
3025         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3026         on operands of 'void' type.
3027
3028         Fix #77200.
3029         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3030         and ExclusiveOr for boolean constants too.
3031
3032 2006-01-09  Raja R Harinath  <rharinath@novell.com>
3033
3034         Fix #75636.
3035         * expression.cs (Invocation.OverloadResolve): Replace reflected
3036         override methods with their base virtual methods, rather than
3037         skipping over them.
3038         * typemanager.cs (TypeManager.GetOverride): New.
3039
3040 2006-01-05  Jb Evain  <jbevain@gmail.com>
3041
3042         * class.cs (Property.Define, Indexer.Define): do not tag the
3043         properties as SpecialName | RTSpecialName.
3044
3045 2006-01-04  Miguel de Icaza  <miguel@novell.com>
3046
3047         * class.cs (MethodCore.IsDuplicateImplementation): This method was
3048         doing a low-level comparission of parameter types.  It was lacking
3049         a check for __argslist. 
3050
3051 2005-12-30  Miguel de Icaza  <miguel@novell.com>
3052
3053         * expression.cs (ParameterReference.DoResolveBase): Allow
3054         reference parameters if they are local to this block. 
3055
3056         This allows the ref and out parameters of a delegate to be used in
3057         an anonymous method, for example:
3058
3059         delegate void set (out int x);
3060
3061         set s = delegate (out int x){
3062                 x = 0;
3063         };
3064
3065         This is used by functionality introduced late in the C# language.
3066         
3067         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3068         method that take ref and out parameters. 
3069
3070         Fixes #77119 which was a late change in the spec.
3071
3072 2005-12-23  Miguel de Icaza  <miguel@novell.com>
3073
3074         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3075         parent if its the same scope.  Fixes #77060.
3076
3077 2005-12-21  Miguel de Icaza  <miguel@novell.com>
3078
3079         * driver.cs: Report the case of no source files and no -out:
3080         argument provided.
3081
3082 2005-12-20  Raja R Harinath  <rharinath@novell.com>
3083
3084         Fix #77035.
3085         * expression.cs (ComposedCast.GetSignatureForError): Define.
3086
3087 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3088
3089         Fix #76995
3090
3091         * namespace.cs (NamespaceEntry): Add extern_aliases as a
3092         ListDictionary, to contain the ExternAliasEntry entries (in
3093         addition to the NamespaceEntry.aliases hashtable). This field is
3094         shared between the original entry and its doppelganger (bodyless 
3095         copy of it).
3096         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3097         extern_aliases field.
3098         (NamespaceEntry.Lookup): Move the IsImplicit check after the
3099         lookup in extern_aliases.
3100
3101 2005-12-16  Raja R Harinath  <rharinath@novell.com>
3102
3103         Fix #77006.
3104         * class.cs (TypeContainer.Mark_HasEquals): New.
3105         (TypeContainer.Mark_HasGetHashCode): New.
3106         (ClassPart): Override them.
3107         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3108
3109         Fix #77008.
3110         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3111         'parent' argument to the base constructor.
3112
3113         Remove all mention of TypeContainer from decl.cs.
3114         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3115         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3116         (DeclSpace.DeclSpace): Likewise.
3117         (DeclSpace.DefineMembers): Remove unused argument.
3118         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
3119         debugging check -- we don't care if the debug code throws an
3120         InvalidCastException instead of an InternalErrorException.
3121         * class.cs (TypeContainer.DefineMembers): Update to changes.
3122         (TypeContainer.DoDefineMembers): Likewise.
3123         (TypeContainer.GetMethods): Likewise.
3124         (PropertyMember.Define): Likewise.
3125         (MemberBase.Parent): New property that forwards to
3126         MemberCore.Parent, but ensures that we get a TypeContainer.
3127         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3128         (RootContext.PopulateTypes): Likewise.  Remove special case code
3129         for !RootContext.StdLib: DefineMembers is idempotent.
3130
3131 2005-12-14  Miguel de Icaza  <miguel@novell.com>
3132
3133         * convert.cs (ExplicitConversionCore): Check the return value from
3134         ExplicitConversionCore which can return null on failure.  Fixes #76914
3135
3136 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
3137
3138         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3139
3140 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
3141
3142         * doc.cs : The search for referenced namespace was insufficient to
3143           get global one as it used to do. Fixed bug #76965.
3144
3145 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
3146
3147         * doc.cs : check name in cref in the last phase that whether it is
3148           namespace or not.
3149
3150 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3151
3152         * cs-tokenizer.cs : reverted the latest change: it somehow broke
3153           Mono.C5.
3154
3155 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3156
3157         * doc.cs : so it turned out that we cannot skip override check for 
3158           interface members. Fixed bug #76954.
3159
3160 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3161
3162         * cs-tokenizer.cs : fixed bug #75984:
3163           - #warning and #error should not be handled when the source line
3164             is disabled.
3165           - #line is not checked strictly when the source line is disabled.
3166           - #define and #undef is on the other hand checked strictly at any
3167             state.
3168
3169 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
3170
3171         * cs-tokenizer.cs : missing Location (actually, filename) in one of
3172           CS1027 report.
3173
3174 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3175
3176         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3177
3178         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3179         event initializers.
3180         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3181         (FieldBase.Initializer): Initializer is now optional.
3182         (EventField.Define): Only event field can have initializer.
3183
3184         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3185
3186         * const.cs (Const): Reuse initializer.
3187
3188         * cs-parser.jay: Updated after FieldBase changes.
3189         Added current_array_type to simplify array initializers.
3190
3191         * ecore.cs (NullCast.IsDefaultValue): Implemented.
3192
3193         * expression.cs, iterators.cs: Updated.
3194
3195         * namespace.cs (NamespaceEntry): Made UsingFound private.
3196
3197 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3198
3199         * parameterCollection.cs: Obsolete, removed.
3200         * parser.cs: Obsolete, removed.
3201
3202 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3203
3204         Fix #76849.
3205         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3206
3207         * enum.cs (Enum.Define): Set obsolete context here.
3208
3209 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3210
3211         * doc.cs :
3212           - FindDocumentedMember() now expects 1) paramList as null
3213             when "we don't have to check the number of parameters" and
3214             2) Type.EmptyTypes when "there is no arguments".
3215           - Introduced FoundMember struct to hold the exact type which was
3216             used to find the documented member (the above change broke
3217             test-xml-044; it might be better just to use DeclaringType than
3218             what MS does, like this change does, but it depends on usage.)
3219
3220 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3221
3222         * doc.cs : documented member might be from DeclaringType for nested
3223           types. Fixed bug #76782.
3224
3225 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3226
3227         * anonymous.cs: Have the param code handle leaving copies on the
3228         stack etc. Allows anonymous params to take part in the assignment
3229         code (++, +=, etc). Fixes bug #76550
3230
3231         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3232         it down to the anon code.
3233
3234         * iterators.cs: Use dummy var here
3235
3236         * codegen.cs: Handle new vars
3237
3238 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3239
3240         Fix #76849.
3241         * class.cs (MethodData.Define): Set proper Obsolete context.
3242
3243         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3244         obsolete context.
3245         (FieldExpr.DoResolve): Ditto.
3246
3247 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3248
3249         Fix #76849.
3250         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3251         parent is not obsolete.
3252
3253 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3254
3255         * doc.cs : (FindDocumentedMember) find parameterless members first
3256           and get CS0419 in the early stage. Fixed first case of bug #76727.
3257
3258 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3259
3260         Fix #76859.
3261         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3262         no error was reported.
3263
3264         *expression.cs (Binary.DoResolve): left can be null.
3265
3266 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3267
3268         Fix #76783.
3269         * class.cs (MethodData.Emit): Parameters should be labeled first.
3270
3271 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3272
3273         Fix #76761.
3274         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3275
3276 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3277
3278         * attribute.cs (AreParametersCompliant): Moved to Parameter.
3279
3280         * class.cs (MethodCore): Parameter clean up.
3281         (IMethodData): Added ParameterInfo.
3282         (MethodData): Parameter clean up.
3283         (Indexer.Define): Parameter clean up.
3284
3285         * anonymous.cs,
3286         * codegen.cs,
3287         * cs-parser.jay,
3288         * decl.cs,
3289         * doc.cs,
3290         * ecore.cs,
3291         * flowanalysis.cs,
3292         * iterators.cs,
3293         * pending.cs,
3294         * statement.cs,
3295         * typemanager.cs: Parameter clean up.
3296
3297         * delegate.cs (Define): Get rid of duplicated code.
3298
3299         * expression.cs (ParameterReference): Removed useless parameters
3300         and simplified.
3301         (Invocation): Ditto.
3302
3303         * parameter.cs (ParamsParameter): New class, params specialization.
3304         (ArglistParameter): Attemp to separate arglist.
3305         (Parameter): Refactored to be reusable and faster.
3306         (Parameter.Modifier): Made understandable.
3307         (Parameters): Changed to be used as a class for `this' assembly
3308         parameters. Refactored to use new specialized classes.
3309
3310         * support.cs (ParameterData): Added Types property.
3311         (InternalParameters): Deleted.
3312
3313 2005-08-20  Martin Baulig  <martin@ximian.com>
3314
3315         Merging this patch from GMCS to fix #75867.
3316
3317         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3318         scope if we don't already have it.
3319
3320 2005-11-17  Martin Baulig  <martin@ximian.com>
3321
3322         * anonymous.cs
3323         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3324         inherit the scope from our parent.  Fixes #76653.
3325
3326 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3327
3328         * doc.cs : the previous patch does not actually fix the bug.
3329           PropertyInfo override check is now implemented and really fixed it.
3330         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3331
3332 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3333
3334         * doc.cs : apply "override filter" also to properties.
3335           Fixed bug #76730.
3336
3337 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3338
3339         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3340           no need to check overrides. For classes, omit those results from 
3341           interfaces since they must exist in the class. Fixed bug #76726.
3342
3343 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3344
3345         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3346           with different parameters. Fixed the second problem in #76685.
3347
3348 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3349
3350         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3351           get expected 'protected' access in CheckValidFamilyAccess()).
3352           Fixed bug #76692.
3353
3354 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3355
3356         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3357           Fixed bug #76705.  CS1569 was incorrectly commented out.
3358
3359 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3360
3361         * doc.cs : use Invocation.IsOverride() to do real override check.
3362         * expression.cs : made Invocation.IsOverride() internal.
3363
3364 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3365
3366         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3367           TypeBuilder.FindMembers() and filter overriden base members out.
3368           Fixed bug #76990.
3369
3370 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3371
3372         * doc.cs : ref/out parameters are represented as '@' (instead of
3373           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3374
3375 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3376
3377         * doc.cs : when there was no '.' in cref to methods in doc comment,
3378           then parameters were missing in the output. Fixed bug #76691.
3379
3380 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3381
3382         * driver.cs : don't output docs when there is an error.
3383           Fixed bug #76693.
3384
3385 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3386
3387         * doc.cs :
3388           Now it should detect indexers. Fixed primary concern in bug #76685.
3389           Fixed CS0419 message to not show the identical member signature in
3390           the message.
3391
3392 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3393
3394         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3395           instead of Type.FindMembers() since it does not handle events.
3396           Fixed bug #71604.
3397
3398 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3399
3400         * codegen.cs: Fixed typo (speficied -> specified).
3401
3402 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3403
3404         Fix #76369.
3405         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3406
3407 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3408
3409         * attribute.cs: Changed error message.
3410
3411         * cs-tokenizer.cs: One more check.
3412
3413 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3414
3415         * statement.cs (Block.Resolve): Ignore empty statement.
3416
3417 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3418
3419         * report.cs: Made error/warning methods more strict to avoid
3420         their misuse.
3421
3422         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3423         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3424         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3425         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3426
3427 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3428
3429         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3430         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3431
3432         * class.cs (TypeContainer.IsComImport): New property.
3433         (Constructor.Define): Create proper ctor for ComImport types.
3434
3435         * expression.cs (New.CheckComImport): Fixed.
3436
3437 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3438
3439         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3440         that a parameter has been captured does not mean that we do not
3441         have to do the rest of the processing.  This fixes the second part
3442         of #76592.  If there was another anonymous method capturing
3443         values in the past, the Scope would never be set for the second
3444         method that captured the same parameter.
3445
3446         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3447         properly manipulate the stack.   Second part of fix for #76592.
3448
3449         * expression.cs (New): Add support for invoking "new" on
3450         interfaces that have been flagged with the ComImport attribute and
3451         the CoClass.  Fixes #76637 
3452
3453         * statement.cs (Try.DoEmit): When a variable is captured, do not
3454         try to emit the vi.LocalBuilder variable as it has been captured.
3455         Create a temporary variable and store the results on the
3456         FieldBuilder.  Fixes #76642
3457
3458 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3459
3460         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3461
3462         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3463
3464         * expression.cs (Binary.DoResolve): Added && optimalization.
3465     
3466         * typemanager.cs (AddUserType): Removed useless argument.
3467
3468 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3469
3470         * statement.cs (Block.variables): Uses ListDictionary.
3471
3472 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3473
3474         Fix #75969.
3475         * class.cs (PartialContainer.EmitType): Customized to emit
3476         security attributes.
3477         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3478         for partial classes.
3479
3480 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3481
3482         Fix #76599.
3483         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3484         access has to be fixed.
3485         
3486         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3487
3488 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3489
3490         Fix #76590.
3491         * ecore.cs (NullCast.Reduce): Implemented.
3492
3493         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3494         constant type.
3495         
3496         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3497         properly.
3498         (Foreach.Resolve): Catch null properly.
3499
3500 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3501  
3502         * cs-tokenizer.cs: Warning text fix.
3503
3504         * driver.cs: AllWarningNumbers exposed on public interface.
3505
3506         * report.cs (): Reviewed warning numbers.
3507         (IsValidWarning): Use binary search.
3508
3509 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3510  
3511         * driver.cs: Implemeted resource visibility.
3512         (Resources): New class for code sharing between /res: and
3513         /linkres:
3514  
3515 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3516
3517         Fix #76568.
3518         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3519         folding.
3520         
3521         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3522         contants only.
3523         
3524         * ecore.cs (NullCast): Child is contant only.
3525         
3526         * literal.cs (NullLiteral.Reduce): null can be converted to any
3527         reference type.
3528
3529 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3530
3531         * driver.cs: Use Encoding.Default as default code page instead
3532           of ISO-28591.
3533
3534 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3535
3536         Fix #76085.
3537         * expression.cs (Invocation.Error_InvalidArguments): Handle
3538         __arglist parameters.
3539         (Invocation.VerifyArgumentsCompat): Likewise.
3540         * support.cs (ReflectionParameters.GetSignatureForError): Print
3541         __arglist parameters.
3542         (InternalParamters.GetSignatureForError): Likewise.
3543         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3544
3545 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3546
3547         * attribute.cs (GetPropertyValue): Made public.
3548
3549         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3550         Resolve.
3551         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3552         attribute.
3553         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3554         is not defined.
3555         
3556         * driver.cs: Reflect method name change.
3557         
3558         * statement.cs (Try.Resolve): Warn when try has both general
3559         exception handlers.
3560         
3561         * typemanager.cs: runtime_compatibility_attr_type new predefined
3562         type.
3563
3564 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3565
3566         Fix #76419.
3567         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3568         treat it as an empty parameter list.
3569
3570 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3571
3572         Fix #76271.     
3573         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3574         ResolveAsTypeStep silent.
3575         * statement.cs (Block.AddConstant): Mark block as used.
3576         (Block.ResolveMeta): Avoid piling on error messages
3577         if a constant initializer resolution fails.
3578
3579 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3580
3581         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3582         Remove.
3583         (NamespaceEntry.VerifyAllUsing): New.
3584         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3585         behaviour.  Delegates actual resolution of alias to ...
3586         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3587         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3588         Update.
3589         * driver.cs (Driver.MainDriver): Update.
3590         
3591         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3592         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3593         property.
3594         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3595         Remove.
3596         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3597         RootNamespace.DefineNamespacesForAll.
3598
3599 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3600
3601         * typemanager.cs (assemblies, external_aliases, modules)
3602         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3603         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3604         overhead.  Move resposibility ...
3605         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3606         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3607
3608 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3609
3610         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3611         cached_namespaces.  Improve usage.
3612         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3613         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3614         Move from GlobalRootNamespace and simplify.
3615         (RootNamespace.Global): Make instance variable.
3616         (RootNamespace.RootNamespace): Add "alias name" parameter.
3617         (GlobalRootNamespace): Simplify drastically.
3618         (Namespace.Lookup): Don't use GetNamespace.
3619         * typemanager.cs (GetRootNamespace): Rename from
3620         ComputeNamespaceForAlias.
3621         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3622
3623 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3624
3625         * anonymous.cs (AnonymousContainer): Don't crash when container
3626         doesn't exist.
3627
3628 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3629
3630         * expression.cs (Binary.DoResolve): Warn when comparing same
3631         values.
3632
3633 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3634
3635         Fix #76486.
3636         * expression.cs (Binary.DoResolve): It looks like there are no
3637         convetsion rules in enum context.
3638
3639 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3640
3641         Add support for extern alias qualifiers.
3642         * typemanager.cs: Move some LookupTypeReflection code
3643         to namespace.cs, to have cleaner code. Added some methods
3644         to help us keep track of the extern aliased references.
3645         * driver.cs: Add suport for extern alias assemblies on command
3646         line and check for their warnings/errors. Also keep track of the
3647         extern aliased assemblies.
3648         * namespace.cs: Move the global functionality of Namespace
3649         to GlobalRootNamespace/RootNamespace. Now the global namespace
3650         is GlobalRootNamespace.Globa. Also the code moved from 
3651         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3652         Finally added LocalAliasEntry (AliasEntry before) and
3653         ExternAliasEntry, to handle alias statements.
3654         * cs-parser.jay: Add support in the grammar for extern alias
3655         statement.
3656         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3657         Update callings to Namespace (now in GlobalRootNamespace).
3658
3659 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3660
3661         Fix #76371.
3662         * class.cs (TypeContainer.DefineType): Move updating of
3663         topological sort earlier in the code.
3664         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3665
3666 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3667
3668         Fix #76273.
3669         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3670         
3671         * constant.cs (Constant.TryReduce): Moved from Cast class.
3672         (Reduce): Made little bit more OO and fixed missing conversions.
3673         
3674         * ecore.cs (Reduce): Implemented.
3675         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3676         
3677         * literal.cs (Reduce): Implemented.
3678         
3679         * class.cs: Reverted Miguel's wrong commit.
3680
3681 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3682
3683         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3684
3685 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3686
3687         * cs-parser.jay, expression.cs : CS0214 was missing error location
3688           for constants. Fixed bug #76404.
3689
3690 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3691
3692         Fix #76370.
3693         * convert.cs (ExplicitConversionCore): Fixed object->enum
3694         conversion.
3695
3696 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3697
3698         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3699         InstanceExpression.
3700         (PropertyExpr.EmitCall): Likewise.
3701         * expression.cs (Invocation.EmitArguments): Handle case where
3702         arguments == null.
3703         (Invocation.EmitCall): Avoid allocating temporary variable if
3704         there are no arguments.
3705
3706 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3707
3708         Fix #76323.
3709         * convert.cs (ImplicitConversionStandard): Move conversion of
3710         void* to arbitrary pointer types ...
3711         (ExplicitConversionStandard): .. here.
3712         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3713         error to always print typenames.
3714
3715 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3716
3717         * convert.cs (GetConversionOperator): Rename from
3718         GetConversionOperators.  Move operator selection code from ...
3719         (UserDefinedConversion): ... here.
3720
3721 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3722
3723         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3724         conversion.
3725
3726 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3727
3728         * assign.cs (Assign.DoResolve): Error method changed.
3729
3730         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3731         
3732         * const.cs (ResolveValue): Reset in_transit immediately.
3733         
3734         * constant.cs: Error method changed.
3735         
3736         * convert.cs: Removed useless location parameter.
3737         (ExplicitNumericConversion): Don't do double enum check.
3738         (ExplicitConversionCore): Renamed from ExplicitConversion.
3739         (ExplicitUnsafe): Extracted from ExplicitConversion.
3740         (ExplicitConversion): Uses for error reporting.
3741         
3742         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3743         error messages.
3744         (ResolveBoolean): Uses common error method.
3745         (CastToDecimal): Get rid of ec.
3746         (CastFromDecimal): Optimized.
3747         (ConvCast): Get rid of ec.
3748         
3749         * enum.cs (ResolveValue): Reset in_transit immediately.
3750         (Emit): Return after first error.
3751         
3752         * expression.cs: Convert changes.
3753         
3754         * literal.cs: Error method changed.
3755         
3756         * statement.cs: Error method changed.
3757
3758 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3759
3760         * support.cs (SeekableStreamReader.Position): Don't error out when
3761         the requested position is just beyond the end of the current
3762         buffered data.
3763
3764 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3765
3766         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3767         try to keep in sync with the byte count of the underlying Stream.
3768         However, this limits us to a window size of 2048 characters: i.e.,
3769         the maximum lookahead of our lexer/parser can be 2048 characters.
3770
3771 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3772
3773         Fix #76255.
3774         * driver.cs: Fix compilation files with full root path.
3775
3776 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3777
3778         * report.cs (SymbolRelatedToPreviousError): Format the output so
3779         it does not use an open parenthesis that is never closed. 
3780
3781         * driver.cs: Follow coding guidelines
3782
3783 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3784
3785         Fix #72930.
3786         * const.cs (Const.ResolveValue): Check for assigning non-null
3787         value to reference type.
3788
3789 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3790
3791         * anonymous.cs: Implemented ExprClassName.
3792         
3793         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3794         delegate.
3795         
3796         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3797         check.
3798         
3799         * class.cs (StaticClass.DefineContainerMembers): Report protected
3800         members as error.
3801         
3802         * codegen.cs: if(ed) PRODUCTION.
3803         
3804         * convert.cs (Error_CannotImplicitConversion): Better error
3805         distinction.
3806         
3807         * cs-parser.jay: More error checks.
3808         
3809         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3810         
3811         * driver.cs (CSCParseOption): Enabled wrong option check.
3812         
3813         * ecore.cs (Expression.ExprClassName): Turned to property.
3814         (MemberExpr.CheckIntermediateModification): For checking boxed
3815         value types     modification.
3816         
3817         * statement.cs (Fixed.Resolve): Expression type must be
3818         convertible to fixed type.
3819         (CollectionForeach.GetEnumeratorFilter,TryType):
3820         Small refactoring for easier error checking.
3821
3822 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3823
3824         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3825         attributes.
3826         
3827         * class.cs (GeneratedBaseInitializer): New class for customization
3828         compiler generated initializers.
3829         (MemberBase.DoDefine): Check Obsolete attribute here.
3830         (FieldMember.DoDefine): Ditto.
3831         
3832         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3833         constants.
3834         
3835         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3836         (MemberCore.GetObsoleteAttribute): Removed argument.
3837         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3838         (MemberCore.CheckObsoleteType): New helper.
3839         
3840         * delegate.cs,
3841         * enum.cs,
3842         * statement.cs: Updates after MemberCore changes.
3843         
3844         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3845         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3846         
3847         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3848         obsolete attribute for compiler construct.
3849         (As.DoResolve): Cache result.
3850         
3851         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3852
3853 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3854
3855         Fix #76133.
3856         * expression.cs (This.VerifyFixed): In a value type T, the type of
3857         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3858         value type R, 'this' is treated as a value parameter.
3859
3860 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3861
3862         * statement.cs (Lock): Use the TemporaryVariable class instead of
3863         manually using local variables as those do not work when variables
3864         are captured.
3865
3866         * ecore.cs: Moved the TemporaryVariable class from being a nested
3867         class inside Foreach to be a public class that can be employed in
3868         other places. 
3869
3870 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3871
3872         * cs-parser.jay: interface_accessors replaced by
3873         accessor_declarations.
3874
3875         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3876         location.
3877         
3878         * statement.cs (GotoCase.Resolve): Convert null constant to
3879         null case.
3880         (SwitchLabel.ResolveAndReduce): Ditto.
3881         (SwitchLabel.NullStringCase): Custom null stamp.
3882         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3883         
3884         typemanager.cs (CSharpSignature): Don't skip first argument
3885         for full names.
3886
3887 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3888
3889         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3890
3891         * location.cs (InEmacs): in this mode, do not report column
3892         location as it confuses Emacs.
3893
3894 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3895
3896         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3897         expression.cs, iterators.cs, literal.cs: Store constants and
3898         literals location.
3899         
3900         * class.cs (MemberBase.ShortName): Pass location.
3901         
3902         * cs-parser.jay: Some location fixes.
3903         
3904         * ecore.cs (Expression.Location): Made virtual.
3905
3906 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3907
3908         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3909         if the underlying types are the same, otherwise we need to produce
3910         code that will do the proper cast.
3911
3912         This was exposed by Marek's constant rewrite which produced
3913         invalid code for the call site:
3914
3915         enum X : long { a }
3916         void Method (X v) {}
3917
3918         Method ((X) 5)
3919
3920         This fixes test-49.cs
3921
3922 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3923
3924         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3925           Type/Object should be allowed as well. Fixed bug #75968.
3926
3927 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3928
3929         * expression.cs : (Binary.DoResolve): when one is enum constant and
3930           another is constant 0, then return enum one *as enum type*.
3931           Fixed bug 74846.
3932
3933 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3934
3935         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3936         internal.
3937
3938         Fix #75941.
3939         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3940         flow-branching for LocalVariableReferences in case we were invoked
3941         from a MemberAccess.
3942         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3943         Carved out of ...
3944         (LocalVariableReference.DoResolveBase): ... this.
3945         (MemberAccess.Resolve): Do the check that was disabled during
3946         SimpleNameResolve.
3947
3948 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3949
3950         * class.cs :
3951           (PartialContainer.Create): check abstract/sealed/static strictly
3952           but abstract/sealed can exist only at one side. Fixed bug #75883.
3953
3954 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3955
3956         Fix #75945.
3957         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3958         specified, don't default to UnmanagedType.I4.
3959
3960 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3961
3962         * expression.cs : conditional operator should check possibly
3963           incorrect assign expression. Fixed bug #75946.
3964
3965 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3966
3967         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3968           Reverting the change. gmcs is much complex than mcs on this matter.
3969
3970 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3971
3972         * cs-tokenizer.cs : To read another token ahead of the actual 
3973           consumption, use new SavedToken and cache token instead of moving
3974           back the stream with SeekableStreamReader (it seemed problematic).
3975         * cs-parser.jay,
3976           driver.cs : Thus use StreamReader directly.
3977         * support.cs : Thus removed SeekableStreamReader.
3978
3979 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3980
3981         Fix #75934.
3982         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3983         (ScopeInfo.EmitScopeType): Use it to construct field names from
3984         names of captured locals.
3985
3986         Fix #75929.
3987         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3988         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3989         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3990         (ExplicitConversion): Remove enum cases already handled by
3991         implicit conversion.  Move implicit conversion check to the beginning.
3992         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3993         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3994         Don't treat System.Enum as a struct.
3995
3996 2005-08-30  Jb Evain  <jbevain@gmail.com>
3997
3998         * attribute.cs: handles as expression in parameters.
3999
4000 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4001
4002         Fix #75802.
4003         * class.cs (TypeContainer.VerifyClsName): Don't use a
4004         PartialContainer when verifying CLS compliance.
4005         (AbstractPropertyEventMethod): Set Parent here, ...
4006         (PropertyMethod): ... not here.
4007
4008 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
4009
4010         * attribute.cs : escaped attribute name should not be allowed to be
4011           resolved (e.g. @class as classAttribute). Fixed bug #75930.
4012
4013 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4014
4015         Fix #75927.
4016         * convert.cs (ImplicitStandardConversionExists): Allow zero also
4017         when converting a long constant to unsigned long.
4018         * expression.cs (Invocation.OverloadResolve): Add sanity check to
4019         detect where IsApplicable and VerifyArgumentsCompat disagree.
4020
4021 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4022         and Carlos Alberto Cortez  <carlos@unixmexico.org>
4023
4024         Fix #75848.
4025         * class.cs (TypeContainer.CanElideInitializer): New helper.
4026         (TypeContainer.EmitFieldInitializers): Use it to determine if we
4027         can safely emitting the initializer of a field.
4028
4029 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4030
4031         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4032           allowed inside a switch (without loop). Fixed bug #75433.
4033
4034 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4035
4036         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4037         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4038
4039 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4040
4041         * driver.cs : kinda reverting the default encoding changes (not exact 
4042           revert since I noticed that "codepage:reset" might not work fine).
4043
4044 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4045
4046         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4047           Location. Now getter and setter store location correctly.
4048           (errors/cs0111-12.cs now reports the expected location.)
4049
4050 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4051
4052         * driver.cs : Use default encoding on the environment.
4053           Removed (now that) extra parameter for SeekableStreamReader.
4054         * support.cs : (SeekableStreamReader) third .ctor() argument for
4055           StreamReader is not required (always true). preamble size could
4056           be acquired in simpler and safe way.
4057
4058 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4059
4060         * cs-parser.jay: report CS0642 at warning level 3
4061           and report CS0642 for an if else statement also
4062           fixes bug #74745. Patch by John Luke (and a bit
4063           modified by me).
4064           Removed extra CS0642 warning check for "while",
4065           "for" and "fixed".
4066         * statement.cs: In Block.Resolve(), CS0642 check
4067           is reimplemented to check a sequence of an empty
4068           statement and a block.
4069
4070           Both fix bug #66777.
4071
4072 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4073
4074         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4075         detection until I fix it.
4076         
4077         * cs-tokenizer.cs: Changed error message.
4078         
4079         * cs-parser.jay: Fixed 2 error locations.
4080         
4081         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4082         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4083         properties.
4084         
4085         * enum.cs (GetSignatureForError): Fixed.
4086         
4087         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4088         method detection.
4089         
4090         * class.cs,
4091         * typemanager.cs (RegisterProperty): Removed.
4092         
4093         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4094
4095 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4096
4097         Fix #75874.
4098         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4099         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4100
4101 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4102
4103         * expression.cs : tiny fix is required for not warning positive ulong.
4104           See test-441.cs.
4105
4106 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4107
4108         * expression.cs : add CS0652 check for constant and integral
4109           expression. Fixed bug #53974.
4110
4111 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4112
4113         * expression.cs : in DoNumericPromotions(), check if there is implicit
4114           conversion overload for string (to check CS0034). Fixed bug #52492.
4115
4116 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4117
4118         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4119
4120 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4121
4122         * ecore.cs : report location when it is *not* Null.
4123
4124 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4125
4126         * codegen.cs,
4127           ecore.cs,
4128           flowanalysis.cs,
4129           expression.cs:
4130           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4131           correctly. Fixed bug #75721.
4132
4133 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4134
4135         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4136         loop that performs 'min (pos, char_count)'.
4137
4138         Fix #75862.
4139         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4140         converted value in Operator.OnesComplement.
4141
4142 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4143
4144         * anonymous.cs: If the anon method is pulled into a helper class,
4145         it needs to be `internal' not `private'. Fixes runtime behavior on
4146         msft. bug #75704
4147
4148 2005-08-20  Martin Baulig  <martin@ximian.com>
4149
4150         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4151         scope if we don't already have it.
4152
4153         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4154         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4155         fixes #75867.
4156
4157 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4158
4159         Fix #75803
4160         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4161         is a partial class.
4162
4163 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4164
4165         The big constants rewrite
4166         Fix #75746, #75685 and more
4167         As a side effect saved 1MB for MWF ;-)
4168         
4169         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4170         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4171         enum based for corlib compilation.
4172         
4173         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4174         subtractions.
4175         
4176         * class.cs (FixedField.Define): Use ResolveAsConstant.
4177         
4178         * const.cs (IConstant): Interface constants and enums.
4179         (Const.ResolveValue): New method for constant resolvning.
4180         (ExternalConstant): Constants from imported assemblies.
4181         
4182         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4183         conversion; like enums.
4184         (Constant.ToType): Converts this constant to different type.
4185         (Constant.Increment): Adds 1.
4186         
4187         * convert.cs (ImplicitConversionRequired): Simplified.
4188         
4189         * cs-parser.jay: Create EnumMember directly.
4190         
4191         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4192         
4193         * doc.cs (GenerateEnumDocComment): Removed.
4194         
4195         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4196         (ConvertIntLiteral): Removed.
4197         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4198         
4199         * enum.cs (EnumMember): Implement IConstant.
4200         (Enum.IsValidEnumConstant): Removed.
4201         (Enum.GetNextDefaultValue): Removed.
4202         (Enum.FindMembers): Updated.
4203         (Enum.GenerateDocComment): Iterate enum members.
4204         
4205         * expression.cs (Cast.TryReduce): Handle enums correctly.
4206         (New.Constantify): Made public.
4207         (MemberAccess.DoResolve): Removed contant specific if(s).
4208         
4209         * literal.cs (NullLiteral): Implement new abstract methods.
4210         
4211         * statement.cs (GotoCase.Resolve): Use new constant methods.
4212         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4213         
4214         * typemanager.cs (LookupEnum): Removed.
4215         (IsEnumType): Fixed to work with corlib.
4216         (RegisterConstant): Removed.
4217         (LookupConstant): Removed.
4218         (GetConstant): Changed to work with IConstant.
4219
4220 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4221
4222         * location.cs : Fixed overflown (>255) column number.
4223
4224 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4225
4226         First cut of the qualified-alias-member feature.
4227         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4228         token.
4229         * cs-parser.jay (DOUBLE_COLON): New token.
4230         (namespace_or_type_name): Add rule for recognizing
4231         qualified-alias-members.
4232         (primary_expression): Likewise.
4233         (element_access): Allow QualifiedAliasMember as a possible
4234         type-bearing expression.
4235         (local_variable_type, local_variable_pointer_type): Likewise.
4236         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4237         aliases in the current and enclosing namespace declarations.
4238         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4239         * decl.cs (MemberName.is_double_colon): New.
4240         (MemberName.MemberName): Add new constructor for alias-member.
4241         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4242         * expression.cs (QualifiedAliasMember): New expression type.
4243
4244 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4245
4246         * location.cs : it borked when no argument was specified.
4247
4248 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4249
4250         * location.cs : tiny ToString() format fix.
4251
4252 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4253
4254         * statement.cs : oops, it was missing.
4255
4256 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4257
4258         A set of fixes for precise line/column location.
4259
4260         * location.cs :
4261           "token" field now holds a file/line "delta", a line number offset 
4262           from the segment, and a column number. See also:
4263           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4264           December/009508.html
4265           Removed static IsNull. Use instance IsNull property instead.
4266         * cs-tokenizer.cs :
4267           For some tokens it stores Location. For Identifier it stores
4268           LocatedToken which is a pair of string name and location.
4269           Column numbers are adjusted only at getChar().
4270         * report.cs :
4271           Use Location.ToString() for reporting (it now contains column).
4272         * cs-parser.jay :
4273           Largely modified to use LocatedToken instead of
4274           string (IDENTIFIER), and to acquire Location from some tokens.
4275         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4276           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4277           codegen.cs :
4278           Now MemberName holds Location. DeclSpace.ctor() receives Location
4279           as a parameter. Removed extra parameters to all derived classes.
4280           Replaced Location.IsNull() with instance property.
4281         * assign.cs, expression.cs :
4282           Added .ctor() overload that omits Location.
4283         * attribute.cs :
4284           Added "nameEscaped" flag that indicates the identifier was escaped
4285           in the source file. This fixes bug #57047.
4286
4287 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4288
4289         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4290         New method, looking for lo-case imported cls type.
4291
4292         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4293         here.
4294
4295         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4296
4297         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4298
4299         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4300         all_imported_types.
4301         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4302
4303         Optimized to save 3.5 MB for SWF compilation.
4304
4305 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4306
4307         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4308         (PartialContainer.Create): Moved logic AddToContainer.
4309         (PartialContainer.MarkForDuplicationCheck): Shares name.
4310         
4311         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4312         place.
4313         
4314         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4315         initialization.
4316         (Namespace.GetSignatureForError): New method.
4317         
4318         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4319         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4320
4321 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4322
4323         Fix #75669.
4324         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4325         member lookup rather than qualifier_type, since qualifier_type can
4326         be null.
4327
4328 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4329
4330         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4331         enum member.
4332
4333 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4334
4335         * statement.cs: Copy the local exception into the exception
4336         captured local.  Fixes 75674
4337
4338 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4339
4340         Fix #75658.
4341         * expression.cs (Invocation.OverloadResolve): Don't report error
4342         CS1501 if error CS1502 has been reported.
4343         (New.DoResolve): Delegate CS1501 reporting to
4344         Invocation.OverloadResolve.
4345
4346         Fix #75656.
4347         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4348         invariant-meaning-in-block property in an enclosing block if
4349         necessary.
4350
4351 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4352
4353         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4354         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4355         (Switch.CheckSwitch): Just save 50kb for SWF.
4356
4357 2005-07-27  Martin Baulig  <martin@ximian.com>
4358
4359         * anonymous.cs (CaptureContext.AddField): Added
4360         `AnonymousContainer am' argument; compute its toplevel scope if
4361         it's not already computed.  Fixes #75649.
4362
4363 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4364
4365         Fix #75628.
4366         * class.cs (Constructor.Emit): Reset block to null if the block
4367         resolve fails.
4368
4369 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4370
4371         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4372
4373 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4374
4375         * class.cs (MethodData.Define): Check whether accessor implementing
4376         interface is public.
4377
4378         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4379
4380 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4381
4382         Fix #57245
4383         * namespace.cs (LookupType): Moved same type check to...
4384         
4385         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4386         with the same name.
4387
4388 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4389
4390         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4391         already found a typebuilder.
4392         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4393         MemberNames, not strings.
4394
4395         * const.cs (Error_ExpressionMustBeConst): 
4396         Rename from Error_EpressionMustBeConst.
4397         * const.cs, class.cs, statement.cd: Update.
4398
4399 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4400
4401         Fix #65573
4402
4403         * const.cs (Const.LookupConstantValue): Report missing contant expression
4404         everytime.
4405         (Error_EpressionMustBeConstant): Only one error method.
4406
4407         * class.cs, statement.c: Updated.
4408
4409 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4410
4411         * statement.cs (Block.Flags): Add back HasVarargs.
4412         (Block.flags): Make protected.
4413         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4414
4415         * typemanager.cs (types, typecontainers, user_types): Remove.
4416         (UserTypes, TypeContainers): Likewise.
4417         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4418         (CleanUp, Reset): Update.
4419         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4420         (GetNestedType): Use Type.GetNestedType.
4421         (CoreLookupType): Take two arguments, the namespace and the
4422         basename of the type.  Update to use the Namespace.Lookup
4423         mechanism.
4424         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4425         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4426         string concatenation and substring matches.
4427         * class.cs, enum.cs, delegate.cs: Update to changes.
4428
4429 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4430
4431         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4432         Expression and made virtual.
4433
4434         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4435         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4436
4437         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4438
4439         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4440         error message.
4441
4442         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4443         change.
4444
4445 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4446
4447         Fix #57707
4448         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4449         AssemblyCultureAttribute is not used on executable.
4450
4451         * rootcontext.cs,
4452         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4453
4454 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4455
4456         Fix #60638.
4457         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4458         New.  Reports CS0252/CS0253.
4459         Mostly taken from preliminary patch by Duncak Mak.
4460         (Binary.DoResolveOperator): Store results of operator lookup.
4461         Use them to detect if we need to warn about unintended reference
4462         comparisons.
4463
4464 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4465
4466         Fix #72969.
4467         * namespace.cs (Namespace.Lookup): Add back location parameter.
4468         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4469         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4470
4471         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4472         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4473         (Namespace.LookupType): ... this.
4474         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4475         of namespaces.
4476         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4477         purported to handle pointers.
4478         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4479         CoreLookupType.
4480
4481 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4482
4483         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4484         type as namespace.
4485
4486 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4487
4488         * namespace.cs (Namespace.Lookup): Drop location parameter.
4489         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4490         (NamespaceEntry.Lookup): ... this.
4491         (NamespaceEntry.Error_AmbiguousTypeReference):
4492         Move here from DeclSpace.
4493         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4494         names ...
4495         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4496         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4497         Move to NamespaceEntry.
4498         * delegate.cs, expression.cs: Update to changes.
4499
4500 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4501
4502         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4503         CheckAttributeType and refactored.
4504         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4505         ResolveAsTypeTerminal error handling.
4506         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4507         handling.
4508         (GetSignatureForError): Print errors in same way.
4509
4510         * class.cs,
4511         * codegen.cs: Reflect attribute GetSignatureForError change.
4512
4513         * ecore.cs,
4514         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4515
4516         * namespace.cs (UsingEntry): Refactored to make fields private.
4517
4518         * assign.cs,
4519         statement.cs: Error_UnexpectedKind has extra parameter.
4520
4521 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4522
4523         * ecore.cs (IAlias): Remove.
4524         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4525         that implement the interface.
4526         * namespace.cs (Namespace): Likewise.
4527         (Namespace.declspaces): Renamed from 'defined_names'.
4528         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4529         DeclSpace instead of an IAlias.
4530         * tree.cs (Tree.AddDecl): Update.
4531
4532 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4533
4534         * statement.cs (Block.Flags); Remove HasVarargs.
4535         (Block.HasVarargs): Move to ToplevelBlock.
4536         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4537         (Block.Variables): Make protected.  Initialize variable hashtable
4538         if necessary.
4539         (Block.AddVariable): Update.
4540         (Block.Resolve): Update to changes.
4541         (ToplevelBlock.HasVarargs): New boolean.
4542         (ToplevelBlock.ThisVariable): Move here from Block.
4543         (ToplevelBlock.AddThisVariable): Likewise.
4544         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4545         * expression.cs (This.ResolveBase): Update to changes.
4546         (ArglistAccess.DoResolve): Likewise.
4547
4548 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4549
4550         Fix #75321
4551         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4552
4553         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4554         not used and not used & assigned.
4555         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4556
4557 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4558
4559         Fix #75053
4560         * expression.cs (Is.DoResolve): null is never provided type.
4561
4562 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4563
4564         Fix #52496
4565         * cs-parser.jay: Less strict event error rule to catch more errors.
4566
4567 2005-07-08  Martin Baulig  <martin@ximian.com>
4568
4569         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4570         gettter (allowed) or setter (not allowed).
4571
4572         * class.cs (Accessor): Implement IIteratorContainer.
4573         (Accessor.Yields): New public field.
4574         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4575         per-accessor basis.
4576
4577         * cs-parser.jay
4578         (get_accessor_declaration, set_accessor_declaration): Set the
4579         `yields' flag on the accessor, not the property.
4580         (property_declaration): Do the iterators check on a per-accessor
4581         basis and not for the whole property.
4582
4583 2005-07-08  Martin Baulig  <martin@ximian.com>
4584
4585         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4586         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4587
4588 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4589
4590         Fix #74975
4591         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4592         (ExtractSecurityPermissionSet): Cope with self referencing security
4593         attributes properly.
4594
4595         * driver.cs (SetOutputFile): Made public property OutputFile.
4596
4597 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4598
4599         Fix #75486.
4600         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4601         has_nonstatic_fields.  Make into a FieldBase pointer.
4602         (TypeContainer.AddField): Add CS0282 check.
4603         (TypeContainer.EmitType): Update.
4604
4605 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4606
4607         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4608         compare if they start with __.
4609
4610 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4611
4612         * statement.cs (Switch.SwitchGoverningType): Only look at
4613         UserCasts that don't need implicit standard conversions to one of
4614         the allowed switch types (Fixes test-322.cs).
4615         (LocalInfo.Resolve): Re-enable sanity-test.
4616
4617 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4618
4619         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4620         
4621         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4622         
4623         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4624
4625 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4626
4627         Fix #75472.
4628         * ecore.cs (SimpleName.GetSignatureForError): Add.
4629         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4630         (MemberAccess.GetSignatureForError): Add.
4631
4632 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4633  
4634         The big error and warning messages review.
4635         
4636         * anonymous.cs,
4637         * assign.cs,
4638         * attribute.cs,
4639         * class.cs,
4640         * codegen.cs,
4641         * convert.cs,
4642         * cs-parser.jay,
4643         * cs-tokenizer.cs,
4644         * decl.cs,
4645         * delegate.cs,
4646         * doc.cs,
4647         * driver.cs,
4648         * ecore.cs,
4649         * enum.cs,
4650         * expression.cs,
4651         * flowanalysis.cs,
4652         * iterators.cs,
4653         * literal.cs,
4654         * location.cs,
4655         * modifiers.cs,
4656         * namespace.cs,
4657         * parameter.cs,
4658         * pending.cs,
4659         * report.cs,
4660         * rootcontext.cs,
4661         * statement.cs,
4662         * support.cs,
4663         * tree.cs,
4664         * typemanager.cs: Updated.
4665         
4666         * class.cs: (MethodCore.SetYields): Moved here to share.
4667         (PropertyMethod.Define): Moved iterator setup here.
4668         
4669         * iterators.cs: Add orig_method to have full access to parent
4670         container.
4671
4672 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4673
4674         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4675         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4676         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4677         variable of struct type.
4678         * expression.cs (Unary.ResolveOperator): Update to change.
4679         (Indirection.VerifyFixed): Likewise.
4680         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4681         (ParameterReference.VerifyFixed): Value parameters are fixed.
4682         (This.VerifyFixed): Treat 'this' as a value parameter.
4683         * statement.cs (LocalInfo.IsFixed): Remove.
4684
4685 2005-07-01  Martin Baulig  <martin@ximian.com>
4686
4687         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4688         `ec.EmitThis ()' to get the correct scope.
4689
4690 2005-07-01  Martin Baulig  <martin@ximian.com>
4691
4692         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4693         instance is a ParameterReference; fixes #75299.
4694
4695 2005-07-01  Martin Baulig  <martin@ximian.com>
4696
4697         Reverted Marek's latest patch (r46725):
4698         - it contains structural changes which are neither mentioned in
4699           the ChangeLog nor explained anywhere; for example the additional
4700           argument of EmitContext's and Iterator's .ctor's and the
4701           TypeContainer.DefineMembers() change.
4702         - structural changes like this should go in in seperate patches
4703           and not be hidden in a huge patch which just seems to affect
4704           warnings and errors.
4705           a big and hard to understand patch.
4706         - it breaks iterators and causes regressions, for instance in
4707           test-iter-03.cs.      
4708
4709 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4710
4711         Fix #75412.
4712         * expression.cs (Indexers.map): Remove.
4713         (Indexers.Append): Filter out inaccessible setters and getters.
4714         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4715
4716         Fix #75283.
4717         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4718         Refactored from ...
4719         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4720         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4721         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4722         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4723
4724 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4725
4726         Fix #75322
4727         * class.cs (FieldBase.GetInitializerExpression): One more field
4728         for backup.
4729
4730 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4731
4732         * pending.cs: Do not define a proxy if the base method is virtual,
4733         it will be picked up by the runtime (bug 75270).
4734
4735 2005-06-08  Martin Baulig  <martin@ximian.com>
4736
4737         The big Iterators rewrite :-)
4738
4739         * iterators.cs: Rewrite this to use the anonymous methods framework.
4740
4741         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4742         before the TypeContainers; see 2test-21.cs.
4743
4744         * class.cs
4745         (TypeContainer.DefineType): Don't create a new EmitContext if we
4746         already have one (this only happens if we're an Iterator).
4747         (TypeContainer.Define): Also call Define() on all our iterators.
4748         (Method.CreateEmitContext): Added support for iterators.
4749
4750         * anonymous.cs
4751         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4752         (AnonymousContainer.CreateMethodHost): Moved here from
4753         AnonymousMethod and made abstract.
4754         (AnonymousContainer.CreateScopeType): New abstract method.
4755         (AnonymousContainer.IsIterator): New public property.
4756         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4757         get the ScopeTypeBuilder rather than manually defining it here. 
4758         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4759         iterators here.
4760
4761         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4762         before RootContext.DefineTypes().
4763
4764         * codegen.cs (EmitContext.RemapToProxy): Removed.
4765         (EmitContext.CurrentAnonymousMethod): Changed type from
4766         AnonymousMethod -> AnonymousContainer.
4767         (EmitContext.ResolveTopBlock): Protect from being called twice.
4768         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4769         (EmitContext.EmitThis): Removed the iterators hacks; use the
4770         anonymous methods framework for that.
4771
4772         * statement.cs
4773         (ToplevelBlock.Container): Make this a property, not a field.
4774         (ToplevelBlock.ReParent): New public method; move the
4775         ToplevelBlock into a new container.
4776         (Foreach.TemporaryVariable): Simplify.
4777
4778 2005-06-05  Martin Baulig  <martin@ximian.com>
4779
4780         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4781         (Block.AddTemporaryVariable): New public method; creates a new
4782         `LocalInfo' for a temporary variable.
4783         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4784         variables here.
4785         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4786         non-iterator variables.
4787
4788 2005-06-05  Martin Baulig  <martin@ximian.com>
4789
4790         * statement.cs (Foreach.TemporaryVariable): Create the
4791         LocalBuilder in the Emit phase and not in Resolve since in some
4792         situations, we don't have an ILGenerator during Resolve; see
4793         2test-19.cs for an example.
4794
4795 2005-06-04  Martin Baulig  <martin@ximian.com>
4796
4797         **** Merged r45395 from GCS ****
4798
4799         The big Foreach rewrite - Part II.
4800
4801         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4802         with `PropertyInfo ienumerator_getcurrent'.
4803
4804         * codegen.cs (VariableStorage): Removed.
4805
4806         * statement.cs
4807         (Foreach): Derive from Statement, not ExceptionStatement.
4808         (Foreach.CollectionForeach): New nested class.  Moved all the code
4809         dealing with collection foreach here.
4810         (Foreach.ForeachHelperMethods): Removed.
4811         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4812
4813 2005-05-23  Martin Baulig  <martin@ximian.com>
4814
4815         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4816         don't need to.  Fix #75014.
4817
4818 2005-05-20  Martin Baulig  <martin@ximian.com>
4819
4820         Merged r44808 from GMCS.
4821
4822         * class.cs (TypeContainer.CircularDepException): Removed.
4823         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4824         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4825         (CS0146) and interface (CS0529) dependencies here.
4826
4827 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4828
4829         * expression.cs (Invocation.EmitCall): Fix initialization
4830         'this_call' to reflect current behaviour.  Fix indentation.
4831
4832         * convert.cs (FindMostEncompassedType): Add two trivial special
4833         cases (number_of_types == 0 || number_of_types == 1).
4834         (FindMostEncompasingType): Likewise.
4835
4836 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4837
4838         Some cleanups preparing for the fix of #75283.
4839         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4840         error testing.
4841         (EventExpr.InstanceResolve): Likewise.
4842         (EventExpr.DoResolve): Remove redundant checks.
4843
4844 2005-06-10  Duncan Mak  <duncan@novell.com>
4845
4846         * cs-tokenizer.cs (process_directives): New flag for controlling
4847         the processing of preprocessor directives.
4848         (x_token): After seeing a '#', return Token.NONE instead of going
4849         to handle_preprocessing_directive() when not processing
4850         directives. This avoids unnecessary processing during the token peek in
4851         is_punct().
4852
4853         This fixes #74939.
4854
4855         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4856         the existing error reporting methods instead of Report.Error.
4857
4858         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4859         after Raja's rewrite.
4860
4861 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4862
4863         * class.cs: Small fix.
4864
4865 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4866
4867         Fix #75160.
4868         * class.cs (GetPartialBases): Fix return value check of
4869         part.GetClassBases.
4870
4871 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4872
4873         Ensure that partial classes are registered in their enclosing
4874         namespace.  Initial part of fix of #75160.
4875         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4876         Register declspace with namespace here, not in
4877         DeclSpace.RecordDecl.
4878         * cs-parser.jay: Pass namespace to RecordDecl.
4879         * class.cs (PartialContainer.Create): Likewise.
4880         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4881         called.
4882         * decl.cs (Declspace.RecordDecl): Remove.
4883         * namespace.cs (NamespaceEntry.DefineName): Remove.
4884
4885 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4886
4887         * rootcontext.cs: Reset TargetExt as well.
4888
4889 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4890
4891         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4892         -langversion:ISO-1.
4893
4894 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4895
4896         Fix #75080, cs0119.cs.
4897         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4898         of ...
4899         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4900         allowing ExprClass.Type and ExprClass.Namespace for
4901         ResolveFlags.VariableOrValue.
4902         (Expression.Resolve) [1-argument variant]: Change default resolve
4903         flags based on language version.
4904         (Expression.Error_UnexpectedKind): Use a simple string array
4905         rather than an ArrayList.
4906         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4907         not ExprClass.Type.
4908         (TypeOfVoid.DoResolve): Likewise.
4909         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4910         flags argument -- it always has the same value.
4911
4912 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4913
4914         Fix #75081.
4915         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4916         Use it in the error message.
4917         * assign.cs, expression.cs, statement.cs: Update.
4918
4919 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4920
4921         Fix #75088.
4922         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4923         the "almostMatchedMember" case too.
4924         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4925         that failed the accessibility checks to 'almost_match'.
4926
4927 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4928
4929         * attribute.cs: Use internal MethodBuilder methods to set
4930         ExactSpelling and SetLastError on PInvoke methods, instead
4931         of passing them via charset.  Fixes #75060.
4932
4933 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4934
4935         * parameter.cs (Parameter): Remove TODO comment.
4936         (Parameter.DefineParameter): Remove Location parameter.
4937         (Parameters.LabelParameters): Likewise.
4938         * class.cs (Constructor.Emit): Update to change.
4939         (MethodData.Emit): Likewise.
4940         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4941         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4942
4943 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4944
4945         * parameter.cs,
4946           Removed Parameters.Location and added Parameter.Location instead.
4947           Removed Location parameter from Emit() and GetSignature().
4948         * anonymous.cs,
4949           class.cs,
4950           cs-parser.jay,
4951           delegate.cs,
4952           iterators.cs,
4953           statement.cs :
4954           Modified all related calls.
4955
4956 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4957
4958         Improve user-defined conversion handling.
4959         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4960         applicable operators.
4961         (AddConversionOperators): New.  Helper for GetConversionOperators.
4962         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4963         there is only one most encompassed/encompassing type.
4964         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4965         "applicable operator" handling.
4966         (UserConversion): Move cache here from GetConversionOperators.
4967         Directly cache the chosen operator, rather than the whole
4968         MethodGroup.
4969         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4970         case.  Allow conversion of decimal to sbyte and byte too.
4971         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4972         New static methods.  Used to avoid allocating EmptyExpressions in
4973         convert.cs.
4974
4975 2005-05-24  Duncan Mak  <duncan@novell.com>
4976
4977         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4978         another class, used in Convert.ExplicitNumericConversion.
4979         (CastToDecimal): New class, similar to above, but casts to
4980         System.Decimal, used in Convert.ImplicitNumericConversion and also
4981         in explicit convesion from double/float to decimal.
4982
4983         * convert.cs (ImplicitNumericConversion): Handle implicit
4984         conversions to System.Decimal.
4985         (ExplicitNumericConversion): handle explicit conversions to
4986         System.Decimal.
4987
4988         This fixes #68711.
4989         
4990 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4991
4992         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4993         know the type at this stage, just break through.   Fixes #75008 
4994
4995 2005-05-19  Martin Baulig  <martin@ximian.com>
4996
4997         * delegate.cs
4998         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4999         to disable error reporting.
5000
5001         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5002         here since we don't want to report an error; see the new test-336.cs.
5003
5004 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5005
5006         * statement.cs (ToplevelBlock.GetParameterReference)
5007         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5008         Move here from class Block.
5009         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5010         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5011
5012 2005-05-18  Martin Baulig  <martin@ximian.com>
5013
5014         Fix #74978.
5015
5016         * flowanalysis.cs
5017         (FlowBranching.Reachability): Add non-static public And() and Or()
5018         methods.
5019         (FlowBranchingSwitch): New class; do the `break_origins' thing
5020         like in FlowBranchingLoop.
5021         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5022         reachability, not just locals and parameters.
5023         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5024         switch; MergeBreakOrigins() now takes care of that.
5025
5026 2005-05-18  Martin Baulig  <martin@ximian.com>
5027
5028         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5029         a loop and may leave it, reset the barrier; fixes #74974.
5030
5031 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5032         
5033         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5034         is back.
5035         
5036         * cs-parser.jay: Catch more lexical errors.
5037         
5038         * report.cs: Add one more Error method.
5039         
5040         * rootcontext.cs,
5041         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5042
5043 2005-05-17  Martin Baulig  <martin@ximian.com>
5044
5045         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5046         #70970. 
5047
5048 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5049
5050         Fix test-382.cs.  Emit values of decimal constants.
5051         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5052         Carved out of ...
5053         (TypeContainer.AddField): ... this.
5054         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5055         with initializers to include 'Const's.
5056         (ClassPart.RegisterFieldForInitialization): Forward to
5057         PartialContainer.
5058         * const.cs (Const.Const): Pass initializer to base class.
5059         (Const.Define): In case of decimal constants, register them for
5060         initialization in a static constructor.
5061
5062 2005-05-14  Martin Baulig  <martin@ximian.com>
5063
5064         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5065         do not call ResolveUnreachable() on unreachable statements in
5066         here, see the comment in the source code.
5067
5068 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5069
5070         Fix #74934.
5071         * expression.cs (BinaryResolveOperator): If one of the operands of
5072         an equality comparison is 'null' and the other is a pointer type,
5073         convert the null to a NullPointer.
5074         * convert.cs (ImplicitReferenceConversion): If the expression is a
5075         NullLiteral and the target type is a pointer type, return a
5076         NullPointer instead.
5077         (ImplicitConversionStandard): Likewise.
5078
5079 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5080         
5081         * cs-parser.jay: Set readonly context based on special constructs.
5082         
5083         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5084         readonly variable error handling.
5085         
5086         * rootcontext.cs (EmitCode): Don't verify members when error
5087         occurred.
5088         
5089         * statement.cs (LocalInfo): Add reaodnly context information.
5090         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5091
5092 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5093
5094         * statement.cs (Block.Resolve): Revert change below.  Modify fix
5095         for #74041 to initialize 'resolved' to false only for explicit
5096         blocks.  Fixes #74873.
5097
5098 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5099
5100         Fix #74920.
5101         * typemanager.cs (unmanaged_enclosing_types): New.
5102         (IsUnmanagedType): Avoid infloops by using
5103         'unmanaged_enclosing_types' to talk with recursive invocations.
5104
5105 2005-05-13  Martin Baulig  <martin@ximian.com>
5106
5107         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5108         instance variable, not a local.  Fix #74873.
5109         (Block.ResolveUnreachable): Set it to true here.
5110
5111 2005-05-11  Duncan Mak  <duncan@novell.com>
5112
5113         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5114         continuing to process for 'arg'.
5115         (handle_preprocessing_directive): Check the argument of the #endif
5116         directive and report error CS1025 if there are any trailing
5117         characters.
5118
5119         According to the C# spec, having even whitespace after the #endif
5120         directive is illegal; however, because we call arg.TrimEnd ()
5121         beforehand, we have the same behavior as csc, allowing whitespace
5122         after the directive.
5123
5124         Fixes #74892.
5125
5126 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5127
5128         Fix #74863.
5129         
5130         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5131         (Constructor.GetObsoleteAttribute): Implemented correctly.
5132
5133 2005-05-10  Martin Baulig  <martin@ximian.com>
5134
5135         * support.cs (ReflectionParameters.ParameterModifier): Use
5136         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5137         and `ParameterAttributes.In'.  Fixes #74884.
5138
5139 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5140
5141         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5142         
5143         * expression.cs (Argument.GetParameterModifier): Turned to property.
5144         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5145         
5146         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5147         its C# equivalent.
5148         
5149 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5150
5151         Fix #74852.
5152         * decl.cs (MemberCache.AddMethods): Register override methods,
5153         rather than non-override methods.
5154         * typemanager.cs (RegisterOverride): New.
5155         (IsOverride): Update.
5156
5157 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5158
5159         Fix #73105.
5160         
5161         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5162         recursive declaration.
5163         
5164         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5165         
5166 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5167
5168         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5169         
5170         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5171
5172 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5173
5174         Fix #74797.
5175         * decl.cs (DeclSpace.FamilyAccessible): 
5176         Use TypeManager.IsNestedFamilyAccessible.
5177
5178         Fix reopened #64812.
5179         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5180         internal'.
5181
5182 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5183             Abin Thomas  <projectmonokochi@rediffmail.com>
5184             Anoob V E  <projectmonokochi@rediffmail.com>
5185             Harilal P R  <projectmonokochi@rediffmail.com>
5186
5187         Fix #64812.
5188         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5189         allow access to all static members.
5190
5191 2005-05-04  Martin Baulig  <martin@ximian.com>
5192
5193         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5194
5195 2005-05-04  Martin Baulig  <martin@ximian.com>
5196
5197         Fix #74655.
5198
5199         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5200         section at the end; make things work if `default' is not the last
5201         section.        
5202
5203 2005-05-04  Martin Baulig  <martin@ximian.com>
5204
5205         Fix #70400.
5206
5207         * statement.cs (Switch): Replaced the `got_default' field with a
5208         `default_section' one.
5209         (Switch.CheckSwitch): Set `default_section' here.
5210         (Switch.Resolve): If we're a constant switch and the constant is
5211         not found, use the default section.
5212
5213 2005-05-03  Martin Baulig  <martin@ximian.com>
5214
5215         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5216
5217         * statement.cs (Foreach.ArrayForeach): New nested class.
5218         (Foreach.TemporaryVariable): New nested class.
5219         (Foreach.EmitArrayForeach): Removed; this is now in the new
5220         ArrayForeach class.
5221
5222 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5223
5224         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5225         more conservative.
5226         (VerifyPendingMethods): Revert change below.
5227
5228         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5229         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5230         that used to trigger warning -28.  Remove warning -28.
5231         * expression.cs (Invocation.OverloadResolve): Use
5232         TypeManager.IsOverride to distinguish override methods.
5233
5234         Fix #74773.
5235         * pending.cs (VerifyPendingMethods): If a base type implements the
5236         requested interface, don't bother checking individual methods of
5237         the base type.  As a side-effect, this prevents the creation of
5238         unnecessary proxies.
5239
5240 2005-05-02  Martin Baulig  <martin@ximian.com>
5241
5242         Fix #70182.
5243
5244         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5245         Also `And' the locals if the old vector is null.
5246         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5247         null; in this case we basically reset all the variables.        
5248
5249 2005-05-02  Martin Baulig  <martin@ximian.com>
5250
5251         Fix #74529.
5252
5253         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5254         Added `FlowBranching branching' argument; always `and' the
5255         variables instead of `or'ing them unless we're an infinite loop.
5256
5257         * statement.cs (While.Resolve): Create a new sibling unless we're
5258         infinite.       
5259
5260 2005-05-02  Martin Baulig  <martin@ximian.com>
5261
5262         Fix #70140.
5263
5264         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5265         arguments; use it instead of creating a new TopLevelBlock.
5266         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5267         our ConstructorInitializer.
5268
5269         * statement.cs
5270         (TopLevelBlock.TopLevelBranching): New public property.
5271         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5272         and create our `TopLevelBranching'.
5273
5274         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5275         anonymous method host, use `block.TopLevelBranching' rather than
5276         creating a new branching.
5277
5278 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5279
5280         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5281         a ScopeInfo, if any of the current children is a child of the new
5282         entry, move those children there.
5283
5284 2005-04-30  Martin Baulig  <martin@ximian.com>
5285
5286         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5287         at the beginning of a SwitchSection.  Fix #73335.
5288
5289 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5290
5291         Fix #74378
5292         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5293         
5294         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5295         (FieldExpr.DoResolve): Obsolete members are ignored for field
5296         initializers.
5297         
5298 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5299
5300         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5301         of arrays detection.
5302
5303         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5304         verification.
5305         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5306
5307         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5308         arrays report.
5309
5310 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5311
5312         * cs-parser.jay: Use the prefered version of -unsafe in error
5313         message.
5314
5315 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5316
5317         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5318         circumstances.
5319
5320 2005-04-20  John Luke  <john.luke@gmail.com>
5321
5322         * driver.cs: fix typo in error message, --outout to --output
5323
5324 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5325
5326         * codegen.cs (InRefOutArgumentResolving): New field.
5327         
5328         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5329         fields outside contructor.
5330         
5331         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5332         
5333 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5334
5335         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5336         parameter code was not completed ever, so it was not as up-to-date
5337         as local variables.  Must finish it.
5338
5339         The bug fix was to compare the Toplevel of the block, not the
5340         current block.  Thanks for Ben for pointing this out. 
5341
5342 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5343
5344         * decl.cs (AddMethods): Use the declaring type of the problem
5345         method to determine if we want to squash a warning.
5346
5347 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5348
5349         * attribute.cs: Removed debug output.
5350
5351         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5352         
5353         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5354         Report.Stderr.
5355         
5356 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5357
5358         Fix #74481.
5359         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5360         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5361         all null comparisons against reference types.
5362
5363 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5364
5365         Fix# 74565
5366         * class.cs (TypeContainer.CircularDepException) New nested
5367         exception class.
5368         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5369         (TypeContainer.DefineType): Removed error, reset InTransit before
5370         exit.
5371         (Class.DefineType): Throw exception when is in Transit.
5372         Catch exception and report error.
5373         (Struct.DefineType): Throw exception when is in Transit.
5374         Catch exception and report error.
5375         (Interface.DefineType): Throw exception when is in Transit.
5376         Catch exception and report error.
5377
5378         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5379         handle nested exception handlers.
5380
5381         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5382         a catch.
5383
5384         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5385         InFinally and InCatch storage.
5386
5387         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5388         (Catch.Resolve): Set and Restore ec.InCatch.
5389         (Try.Resolve): Set and Restore ec.InFinally.
5390         (Try.HasCatch): True when try has catch.
5391
5392 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5393
5394         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5395           for the same event member, so exclude such cases from warning 419.
5396           Fixed bug #74633.
5397
5398 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5399
5400         * expression.cs (Binary.ResolveOperator): Apply patch from John
5401         Luke to fix bug 59864: operators &, | and ^ on enumerations
5402         require that the same enum type on both sides.
5403
5404         * driver.cs: Add warnings to old flag usage, this is to assist
5405         people who produce Makefiles and hope that the Makefiles will be
5406         used on Windows.
5407
5408         * class.cs (TypeContainer.EmitType): Moved the definition of the
5409         special $PRIVATE$ field from the resolve phase to the Emit phase.
5410         During resolve we do not know if we are a struct with
5411         HasExplicitLayout, we know this only after the attributes for the
5412         type are emitted.
5413
5414         Set the FieldOffset to zero on the dummy field that we create for
5415         the class.   Fixes 74590.
5416
5417 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5418
5419         Fix #73834.
5420         * ecore.cs (PropertyExpr.resolved): New.
5421         (DoResolve): Use it to handle a case of double resolution here.
5422         Handle a case of identical-name-and-type-name.
5423         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5424         resolution by storing the results of expression resolution back
5425         into the "probes" array.
5426
5427 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5428
5429         Fix cs0208-7.cs and cs0208-8.cs.
5430         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5431         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5432         error reporting to point out the reason a struct is not unmanaged.
5433
5434 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5435
5436         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5437           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5438
5439 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5440
5441         Fix #74528.
5442         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5443         IdenticalNameAndTypeName here.
5444         (EventExpr.InstanceResolve): Likewise.
5445
5446 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5447
5448         C# 2.0 DefaultCharSetAttribute implementation
5449         
5450         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5451         which allows us to set GlobalNamespace for every resolve.
5452         (Attribute.ResolveArguments): Cut from Resolve.
5453         (Attribute.GetCharSetValue): Returns CharSet named argument.
5454         (Attribute.DefinePInvokeMethod): Gets default charset from
5455         module settings.
5456         (GlobalAttribute.ResolveAsTypeStep): Override.
5457         (GlobalAttribute.ResolveArguments): Override.
5458         
5459         * class.cs (TypeAttr): Is protected.
5460         
5461         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5462         (ModuleClass.DefaultCharSetType): New memeber.
5463         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5464         
5465         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5466         charset from module.
5467         
5468         * delegate.cs (TypeAttr): Override.
5469         (Delegate.DefineType): Use this TypeAttr.
5470         
5471         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5472         at very early stage (before types are defined) to resolve model
5473         module attributes. It will probably not work with corlib but it
5474         should be ok.
5475         
5476         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5477         charset from module.
5478         
5479         * typemanager.cs (default_charset_type): New type.
5480
5481 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5482
5483         * decl.cs (MemberCache.AddMethods): Don't warn if
5484         System.Object.Finalize has buggy MethodAttributes.
5485
5486         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5487         removed below.
5488
5489 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5490
5491         * doc.cs : detect ambiguous reference to overloaded members.
5492           Fixed bug #71603. MS 1.1 csc does not detect it.
5493
5494 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5495
5496         * doc.cs : delegates must not be referenced with parameters.
5497           Fixed bug #71605.
5498
5499 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5500
5501         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5502
5503 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5504
5505         * driver.cs (MainDriver): Stop processing if the CLS stage found
5506         errors. 
5507
5508         (CompilerCallableEntryPoint.InvokeCompiler): Always
5509         reset after execution;   Take a TextWriter argument for the
5510         output.
5511
5512         * report.cs: Use the error stream instead of hardcoding stderr. 
5513
5514 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5515
5516         * class.cs: Reduce code paths to test, too small of an
5517         optimization to make it worth the extra testing.  Always perform
5518         it. 
5519
5520 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5521
5522         Fix #74510.
5523         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5524         operators that had errors reported on them.
5525
5526 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5527
5528         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5529         argument types.
5530         (Attribute.Resolve): Add named argument type checking.
5531         
5532         * class.cs (FixedField.Define): Use IsPrimitiveType
5533         
5534         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5535         
5536         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5537         unsafe parameter types.
5538         
5539         * statement.cs (Using.ResolveExpression): Add better error description.
5540         
5541         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5542         
5543 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5544
5545         Fix #74484.
5546         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5547         AttributeUsageAttribute in the emitcontext of the attribute class,
5548         not in the emitcontext of the attributable entity it was attached to.
5549         * cs-parser.jay: Use 'current_class', not 'current_container',
5550         when creating a GlobalAttribute.
5551
5552 2005-04-08  Alp Toker  <alp@atoker.com>
5553
5554         * pending.cs: The fix to #58413 failed to compile methods implementing
5555         interfaces with/without params modifiers and vice versa, even though
5556         params modifiers aren't part of the signature. Make the modifier check
5557         less strict as in csc.
5558
5559 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5560             Anoob V E  <projectmonokochi@rediffmail.com>
5561             Harilal P R  <projectmonokochi@rediffmail.com>
5562
5563         Fix #58413.
5564         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5565         modifiers of pending methods.
5566         (PendingImplementation.PendingImplementation): Initialize it.
5567         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5568         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5569         with ParameterData.  Add check for modifiers.
5570         * class.cs (MethodData.Define): Update to changes.
5571
5572 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5573
5574         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5575
5576 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5577
5578         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5579         property.
5580         
5581         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5582         
5583         * rootcontext.cs,
5584         * typemanager.cs: Registered RequiredAttributeAttribute.
5585         
5586 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5587
5588         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5589         Warning CS0169 is back at level 3.
5590         (IMethodData.SetMemberIsUsed): New method.
5591         
5592         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5593         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5594         
5595         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5596
5597         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5598         contants.
5599         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5600         is used.
5601         
5602         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5603         is used.
5604         
5605         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5606         to avoid the problems with nested types.
5607
5608 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5609             Anoob V.E  <projectmonokochi@rediffmail.com>
5610             Harilal P.R  <projectmonokochi@rediffmail.com>
5611             Raja R Harinath  <rharinath@novell.com>
5612
5613         Fix #73820.
5614         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5615         attribute.
5616         * typemanager (GetConstructor): Make public.
5617
5618 2005-04-05  John Luke  <john.luke@gmail.com>
5619             Raja R Harinath  <rharinath@novell.com>
5620
5621         Fix #62232.
5622         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5623         struct too.  Return false quicker in a few cases.
5624         (VerifyUnManaged): Use it.
5625
5626 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5627
5628         Fix #74041.
5629         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5630         not 'unreachable_seen'.
5631
5632 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5633
5634         * attribute.cs (Attribute.GetValue): Removed unused.
5635         
5636         * codegen.cs (CodeGen.TrimExt): Removed unused.
5637         
5638         * cs-parser.jay (output): Removed unused.
5639         
5640         * cs-tokenizer.cs (hex_digits): Removed unused.
5641         
5642         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5643         
5644         * expression.cs (Indirection.LoadExprValue): Removed unused.
5645         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5646         
5647         * iterators.cs (Iterator.param_types): Removed unused.
5648         
5649         * statement.cs (Goto.block): Removed unused.
5650         (ToplevelBlock.did): Removed unused.
5651         (Switch.ResolveConstantSwitch): Removed unused.
5652
5653 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5654
5655         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5656         resetting thingy.
5657
5658 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5659
5660         Fix #74232 and cs0208-3.cs.
5661         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5662         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5663         unmanaged type.  Don't use FieldBuilders when 't' is a
5664         TypeBuilder.  Use ModFlags and MemberType fields.
5665         * class.cs (MemberBase.member_type): Rename from MemberType.
5666         (MemberBase.MemberType): New property.  Determines member_type on
5667         demand.
5668         (MemberBase.DoDefine): Don't initialize MemberType here.
5669         (FieldMember.Define): Likewise.
5670
5671 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5672
5673         Fix #74241
5674         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5675         Attributes are emitted there.
5676         
5677 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5678
5679         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5680         keyword in 'partial enum' too.
5681         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5682         is not allowed).
5683         Report from Kamil Skalski <nazgul@omega.pl>.
5684
5685         Fix #74309.
5686         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5687         have partial containers too.
5688
5689         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5690         in block' checks to Block.CheckInvariantMeaningInBlock.
5691         * statement.cs (Block.GetKnownVariableInfo): Make private.
5692         (Block.IsVariableUsedInChildBlock): Remove.
5693         (Block.IsVariableUsedInBlock): Likewise.
5694         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5695         conflicting declaration.
5696         (Block.AddVariable): Make error messages less long-winded and more
5697         specific.  Show location of conflicting declaration.
5698         * parameter.cs (Parameters.Location): New readonly property.
5699
5700 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5701
5702         Clean up semantics of invoking ResolveMemberAccess.
5703         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5704         can have an instance, ensure that we pass in a non-TypeExpression
5705         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5706         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5707         argument.  Update to changes and simplify.
5708         (FieldExpr.Emitinstance): Remove CS0120 check.
5709         (PropertyExpr.EmitInstance): Likewise.
5710         * expression.cs (Argument.Resolve): Likewise.
5711         (Invocation.DoResolve): Update to changes in semantics of
5712         InstanceExpression.
5713
5714 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5715
5716         Fix #74241
5717         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5718         customization.
5719         
5720         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5721
5722 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5723
5724         Fix difference in behaviour with commandline invocation.
5725         * driver.cs (Driver.Reset): New.
5726         (CompilerCallableEntryPoint): Call it.
5727
5728         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5729         variable" warnings if the boolean expression failed to resolve.
5730
5731 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5732
5733         * attribute.cs: Fix the union of several permissions when some of them
5734         are unrestricted (so the result isn't an unrestricted permission set).
5735         Fix #74036.
5736
5737 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5738
5739         * ecore.cs (MemberExpr): New class.  Convert from interface
5740         IMemberExpr.
5741         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5742         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5743         error checks.
5744         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5745         (MethodGroupExpr.IsExplicitImpl): Remove.
5746         (Expression.GetFieldFromEvent): Remove.
5747         (SimpleName.MemberStaticCheck): Remove.
5748         (SimpleName.DoSimpleNameResolve): Update to changes.
5749         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5750         (MemberAccess.IdenticalNameAndTypeName): Remove.
5751         (MemberAccess.error176): Move to MemberExpr.
5752         (MemberAccess.DoResolve): Update to changes.
5753         (BaseAccess.DoResolve): Likewise.
5754
5755 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5756
5757         C# 2.0 Conditional attribute class implementation
5758         
5759         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5760         Analyzes class whether it has attribute which has ConditionalAttribute
5761         and its condition is not defined.
5762         
5763         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5764         (Class.IsExcluded): New method. Search for at least one defined
5765         condition in ConditionalAttribute of attribute class.
5766
5767 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5768
5769         * ecore.cs (PropertyExpr): Derive from Expression, not
5770         ExpressionStatement.
5771         (PropertyExpr.EmitStatement): Remove.
5772
5773 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5774
5775         Fix #74060.
5776         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5777         internal field "value__" of an enum be private.  The examples for
5778         "value__" that I found on MSDN all used FieldAttributes.Private.
5779
5780         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5781         Don't mention IL method attribute names.
5782
5783         Fix #47991.  Remove a TODO.
5784         * statement.cs (Block.Toplevel): Make into a field.
5785         (Block.Parameters): Move into ToplevelBlock.
5786         (Block.known_variables): Rename from child_variable_names.
5787         (Block.Block): Remove variants that take Parameters.  Initialize
5788         'Toplevel' with the immediately surrounding toplevel block.
5789         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5790         LocalInfo parameter.
5791         (Block.GetKnownVariableInfo): New.
5792         (Block.IsVariableNameUsedInChildBlock): Update.
5793         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5794         the block, even though it may not be in scope.
5795         (Block.AddVariable): Remove Parameters parameter.  Use
5796         Toplevel.Parameters instead.
5797         (Block.AddConstant): Remove Parameters parameter.
5798         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5799         (Block.IsParamaterReference): Likewise.
5800         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5801         (ToplevelBlock.Parameters): New.  Moved from Block.
5802         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5803         initialize Parameters to a non-null value.
5804         * cs-parser.jay: Update to changes.
5805         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5806         simple names that mean different things in the same block.  Use
5807         Block.IsVariableNameUsedInBlock.
5808
5809 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5810
5811         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5812         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5813         GetTypeHandle.  It is possible for a reflected type to derive from
5814         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5815         System.Array during mscorlib compilation).
5816         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5817         contain a method_hash, don't create one either.  Don't create a
5818         deep copy of the base cache's method_hash.
5819         (MemberCache.SetupCache): Rename back from DeepCopy.
5820         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5821         already initialized.  If we see an override function, add its
5822         underlying base virtual function to the member_hash too.
5823
5824         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5825
5826 2005-03-26  Raja R Harinath  <harinath@acm.org>
5827
5828         Fix #73038.
5829         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5830         fails to resolve, ensure that the LHS is still resolved as an
5831         lvalue.
5832
5833 2005-03-25  Raja R Harinath  <harinath@acm.org>
5834
5835         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5836         ec.ContainerType.
5837         (Enum.current_ec): Remove.
5838         (Enum.LookupEnumValue): Remove EmitContext argument.
5839         Just uses the one created during DefineType.
5840         (Enum.FindMembers): Update.
5841         * expression.cs (MemberAccess.DoResolve): Update.
5842
5843 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5844
5845         * assign.cs (Assign.DoResolve): Check for CS1717 when
5846         source and target are same (uses Equals).
5847
5848         * expression.cs (LocalVariableReference, ParameterReference,
5849         This): Implemented Equals, GetHashCode.
5850
5851         * statement.cs (Block.GetParameterReference): Removed useless
5852         local variable.
5853
5854 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5855
5856         Fix cs0128.cs
5857         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5858         blocks before deciding whether the error is cs0136 or cs0128.
5859
5860         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5861         (using_alias_directive, using_namespace_directive): Pass
5862         MemberName, not an expression to Namespace.UsingAlias and
5863         Namespace.Using.
5864         (MakeName): Use the MemberName of the namespace.
5865         * namespace.cs (Namespace.MemberName): New.
5866         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5867         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5868         Likewise.
5869         * decl.cs (MemberName.Name): Make readonly.
5870         (MemberName.FromDotted): New "constructor".
5871         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5872         (MemberCore.Name): Compute from MemberName on demand.
5873         (MemberCore.SetMemberName): Provide a way to change the
5874         MemberName.
5875         (MemberCore.AddToContainer): Don't take a fullname parameter.
5876         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5877         fully qualified name of the container to the member name.
5878         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5879         only if the type is a member of the root container.
5880         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5881         MemberName.Left rather than searching for an embedded ".".
5882         (PartialContainer.CreatePart): Update to changes in RootContext.
5883         (MemberBase.ShortName): Turn into a property.  Use
5884         MemberCore.SetMemberName.
5885         (MemberBase.ExplicitInterfaceName): Remove.
5886         (MemberBase.UpdateMemberName): Remove.
5887         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5888         (PropertyBase.SetMemberName): New override.
5889         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5890         (Tree.GetDecl): New.
5891         (Tree.AllDecls): Rename from Decls.
5892         * attribute.cs, enum.cs, report.cs: Update to changes.
5893         * driver.cs (MainDriver): Use MemberName.FromDotted on
5894         RootContext.MainClass.
5895
5896 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5897
5898         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5899         checks.
5900
5901         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5902
5903 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5904
5905         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5906         property accessor modifiers.
5907
5908         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5909         fixed buffer attribute (CS1716).
5910         (PropertyMethod.HasCustomAccessModifier): When property accessor
5911         has custom modifier.
5912
5913         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5914         modifiers.
5915         (PropertyExpr.DoResolveLValue): Add CS0272.
5916
5917 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5918
5919         * convert.cs: When converting to a pointer, use the proper Conv.U
5920         or Conv.I depending on the source data type.
5921
5922         * cs-tokenizer.cs: Make the size for large decimal constants,
5923         fixes #72957.
5924
5925 2005-03-17  Martin Baulig  <martin@ximian.com>
5926
5927         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5928         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5929
5930 2005-03-17  Martin Baulig  <martin@ximian.com>
5931
5932         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5933         to bool so we can return an error condition.
5934         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5935         returned an error.
5936
5937 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5938
5939         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5940         attributes.
5941
5942 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5943
5944         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5945         Refactor to avoid traversing the list of assemblies, and to avoid
5946         string concatenation.
5947         * typemanager.cs (guid_attr_type): Remove.
5948         (negative_hits, pointers, references): Remove hashes.
5949         (type_hash): New.
5950         (GetConstructedType): New.  Uses type_hash to handle constructed
5951         types (arrays, references, pointers).
5952         (GetReferenceType, GetPointerType): Use it.
5953         (GetNestedType): New.  Uses type_hash to handle nested types of
5954         reflected types.
5955         (LookupType, LookupTypeDirect): Remove.
5956         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5957         'types' hash and LookupTypeReflection directly.
5958         (params_string, params_object): Use GetConstructedType.
5959         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5960         top-level types.
5961         (Namespace.Lookup): Use cached_types.
5962         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5963         provided by old TypeManager.LookupType.
5964         * rootcontext.cs (MakeFQN): Remove.
5965         * decl.cs (DeclSpace.MakeFQN): Likewise.
5966         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5967         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5968         TypeManager.GetConstructedType.
5969         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5970
5971 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5972
5973         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5974         indexers.
5975
5976         * cs-parser.jay: Reports CS1527 for any namespace element.
5977
5978         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5979         Added CS0407.
5980
5981         * expression.cs (ParameterReference.IsAssigned): Changed error to
5982         CS0269.
5983         (Error_WrongNumArguments): Moved CS0245 detection here.
5984
5985         * statement.cs (Return.Resolve): Add CS1622 report.
5986
5987 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5988
5989         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5990
5991 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5992
5993         * attribute.cs expression.cs: Get rid of some allocations.
5994
5995 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5996
5997         * doc.cs : just eliminate the latest change.
5998
5999 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6000
6001         * doc.cs : commented out the latest change. It breaks xml-030.cs
6002
6003 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6004
6005         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6006           fail. So invoke CreateType() in FindDocumentedType().
6007
6008 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6009
6010         * cs-tokenizer.cs : added IsKeyword().
6011         * doc.cs : Detect keyword incorrectly used as identifier.
6012           Allow identifiers prefixed by @.
6013
6014 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6015
6016         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6017         It caused exception in namespace resolving (again!).
6018         
6019         * class.cs (Class.ctor): Removed exit.
6020         (PropertyMethod.ctor): ditto.
6021         
6022         * codegen.cs (Codegen.Reset): Reset static data.
6023         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6024         
6025         * cs-tokenizer.cs (Cleanup): Removed.
6026         
6027         * driver.cs (GetSystemDir): Rewrote to one line command.
6028         It caused problem with unloaded dynamic modules.
6029         (UnixParseOption): Removed Exit.
6030         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6031         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6032         Now can be mcs used as library.
6033         
6034         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6035         empty location.
6036         
6037         * location.cs (Reset): Reset static data.
6038         
6039         * namespace.cs (Reset): Reset static data.
6040         
6041         * report.cs (Report.Reset): Reset static data.
6042         
6043         * rootcontext.cs (RootContext.Reset): Reset static data.
6044         
6045         * tree.cs (RootTypes.ctor): Use Location.Null
6046         
6047         * typemanager.cs (TypeManager.Reset): Reset static data.
6048         (CoreLookupType): Removed Exit.
6049         (TypeHandle.Reset): Reset static data.
6050         
6051 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6052
6053         Fix #73516.
6054         * typemanager.cs (ComputeNamespaces): Import namespaces from
6055         referenced modules too.
6056
6057 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6058
6059         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6060         than '.'.
6061
6062 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6063
6064         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6065         enclosing DeclSpace.  This ensures that a name-lookup populates
6066         more caches and there are fewer 'TypeExpression's.  Carve out
6067         nested type lookup into ...
6068         (LookupNestedTypeInHierarchy): ... this.
6069
6070 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6071
6072         Clean up a few partial-class semantics.  
6073         Fixes test-357.cs and cs1618-2.cs.
6074         * cs-parser.jay (struct_declaration): Use 'current_class' as
6075         parent of newly-created struct.  Remove call to Register ().
6076         Use 'pop_current_class' to complete handing the current struct.
6077         (interface_declaration): Likewise.
6078         (class_declaration): Likewise.
6079         (enum_declaration): Use 'current_class' as parent of newly created
6080         enum.
6081         (delegate_declaration): Likewise.
6082         (pop_current_class): New function.  This is used to handle closing
6083         up the 'current_class' and 'current_container', and pointing them
6084         to the enclosing class/container.
6085         (CSharpParser): Initialize 'current_class' too.
6086         * decl.cs (MemberCore): Add check for invariant: a partial
6087         container is not a parsed entity, and thus does not enclose any
6088         parsed members.
6089         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6090         (DeclSpace.BaseTypeExpr): Use it.
6091         (DeclSpace.LookupType): Add check for invariant.
6092         * class.cs (TypeContainer): Add check for invariant: a nested
6093         class should have the same NamespaceEntry as its enclosing class.
6094         (TypeContainer.EmitFieldInitializers): Make virtual.
6095         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6096         MemberCore.
6097         (TypeContainer.Register): Remove.
6098         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6099         null.  Use TypeResolveEmitContext for resolving base types and
6100         interfaces.  Move initialization of Parts.TypeBuilder here from
6101         ...
6102         (TypeContainer.DefineNestedTypes): ... here.
6103         (PartialContainer): Take a Namespace not a NamespaceEntry.
6104         (PartialContainer.Create): Don't use Register.  Call the
6105         appropriate Add... function directly.
6106         (ClassPart): Take both the PartialContainer and the enclosing
6107         class as constructor arguments.
6108         (ClassPart.EmitFieldInitializers): Override.
6109         (ClassPart.PartFindNestedTypes): Remove.
6110         (FieldBase.GetInitializerExpression): Resolve the initializer
6111         expression in the emit context of the enclosing class.
6112         * tree.cs (RootTypes): Remove Register ().
6113         
6114 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6115
6116         * cs-parser.jay: Removed CS0134.
6117         
6118         * driver.cs: Removed CS1901.
6119         
6120         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6121         for predefined types.
6122
6123 2005-03-07  Duncan Mak  <duncan@novell.com>
6124
6125         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6126         well. Fixes bug #73454.
6127
6128 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * cs-tokenizer.cs (xtoken): Add CS1035.
6131         
6132         * class.cs (MethodData.Define): Add CS0683.
6133         (FieldMember.ctor): Add CS0681.
6134
6135 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6136
6137         * ecore.cs (SimpleName.DoResolve): Rename from
6138         SimpleName.DoResolveAllowStatic.
6139         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6140         Pass 'intermediate' flag to MemberStaticCheck.
6141         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6142         of "intermediate" lookups via MemberAccess.
6143         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6144         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6145
6146 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6147
6148         Fix #73394.
6149         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6150         slipped in because of variable names that are identical to a
6151         builtin type's BCL equivalent ('string String;', 'int Int32;').
6152         (PropertyExpr.EmitInstance): Likewise.
6153
6154 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6155
6156         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6157         
6158         * report.cs (warning_ignore_table): Made public.
6159
6160 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6161
6162         Fix #73282.
6163         * class.cs (MethodData.Emit): Pass 'container' to
6164         container.GetObsoleteAttribute instead of 'container.Parent'.
6165
6166 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6167
6168         * cs-parser.jay: Add 1534 error test.
6169
6170         * iterators.cs (Yield.CheckContext): Add error 1629.
6171         (Iterator.ctor): Save unsafe modifier.
6172         (MoveNextMethod.DoEmit): Restore unsafe context.
6173
6174         * namespace.cs (UsingAlias): Better error message.
6175
6176 2005-03-03  Dan Winship  <danw@novell.com>
6177
6178         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6179         the warning message [#73219]
6180
6181 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6182
6183         Fix compile with MCS 1.0.0.0.
6184         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6185         w_restore to not depend on string constant folding.
6186
6187 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6188
6189         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6190         CS0246 check to users who passed 'silent = false'.
6191         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6192         check.
6193         (SimpleName.SimpleNameResolve): Update.
6194         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6195         (MemberAccess.IdenticalNameAndTypeName): Update.
6196         * doc.cs (FindDocumentedTypeNonArray): Update.
6197
6198 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6199
6200         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6201         * parameters.cs (ComputeAndDefineParameters): Remove.
6202         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6203         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6204         Use GetParameterInfo.
6205
6206 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6207
6208         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6209
6210 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6211
6212         Unify DeclSpace.LookupType and DeclSpace.FindType.
6213         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6214         is in charge of defining nested types on demand.
6215         (DeclSpace.LookupType): Use it when the current_type is a
6216         TypeBuilder.  Use LookupTypeDirect for reflected types.
6217         (DeclSpace.FindType): Remove.
6218         (DeclSpace.LookupInterfaceOrClass): Likewise.
6219         (DeclSpace.DefineTypeAndParents): Likewise.
6220         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6221         DeclSpace.LookupType.
6222         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6223         * typemanager.cs (LookupType): Simplify.
6224         (AddUserType): Remove type from negative_hits.
6225         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6226         * class.cs (TypeContainer.FindMembers): Move handling of nested
6227         types ...
6228         (TypeContainer.FindMembers_NestedTypes): ... here.
6229         (TypeContainer.FindNestedType): Implement override.
6230         (ClassPart.FindNestedType): Delegate to PartialContainer.
6231         (ClassPart.PartFindNestedType): Looks up the nested types of the
6232         part alone.
6233
6234 2005-03-02  Martin Baulig  <martin@ximian.com>
6235
6236         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6237         static constructor in static classes.
6238
6239 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6240
6241         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6242         sizeParamIndex is not specified.
6243
6244 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6245
6246         Fix #73117
6247         * report.cs (WarningMessage.IsEnabled): Missing null check.
6248
6249 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6250
6251         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6252         in the fields and not in the properties.
6253
6254 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6255
6256         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6257         fields as well.
6258
6259 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6260
6261         * attribute.cs: Small refactoring (improved robustness).
6262         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6263         (ValidateGuid): Removed.
6264         (Resolve): Removed referenced to above mentioned.
6265         (GetAttributeUsage): Made private and changed to work without
6266         class assistance.
6267         (GetIndexerAttributeValue): Don't crash.
6268         (GetConditionalAttributeValue): Ditto.
6269         (GetClsCompliantAttributeValue): Ditto.
6270         (ExtractSecurityPermissionSet): All attributes exceptions are
6271         error 648.
6272         (GetPropertyValue): New helper.
6273         (GetMethodImplOptions): New method.
6274         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6275         some missing properties.
6276         
6277         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6278         (Method.ApplyAttributeBuilder): Updated.
6279         
6280         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6281         exception.
6282
6283 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6284
6285         Fix #73052.
6286         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6287         non-simple types (array, pointer, reference).
6288
6289 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6290
6291         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6292
6293         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6294         for operators.
6295         (Method.CheckBase): Catch wrong destructor here.
6296         (MethodData.Define): Add errors 550, 668.
6297
6298         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6299
6300         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6301
6302         * pending.cs (VerifyPendingMethods): Add error 551.
6303
6304         * typemanager.cs (CSharpName): Next error report helper.
6305
6306 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6307
6308         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6309         attributes. Removed useless attribute double check.
6310         It saves almost 2MBs for corlib.
6311
6312 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6313
6314         Fix #72924.
6315         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6316         called twice in case of error.
6317
6318 2005-02-23  Chris Toshok  <toshok@ximian.com>
6319
6320         Fix compiler portions of #72827.
6321         * statement.cs (Block.Emit): call Begin/EndScope on the
6322         EmitContext instead of the ILGenerator.
6323
6324         * codegen.cs (EmitContext.BeginScope): new method, call
6325         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6326         we have one.)
6327         (EmitContext.BeginScope): same, but EndScope and CloseScope
6328
6329         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6330         offset and call the superclass's OpenScope(int) with it.
6331         (SymbolWriter.CloseScope): get the current il
6332         offset and call superclass's CloseScope(int) with it.
6333
6334 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6335
6336         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6337         CS1677 for out and ref as well.
6338
6339         * class.cs (Method.Define): Add error CS1599 detection.
6340         
6341         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6342         
6343         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6344         
6345         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6346         
6347         * support.cs.cs (ModifierDesc): New helper method.
6348
6349 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6350             Abin Thomas  <projectmonokochi@rediffmail.com>
6351             Anoob V E  <projectmonokochi@rediffmail.com>
6352             Harilal P R  <projectmonokochi@rediffmail.com>
6353
6354         Fix #57851, #72718.
6355         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6356         MemberLookup (used for error reporting) actually returns a result.
6357         Fix error report number (122, not 112).
6358
6359 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6360             Anoob V E  <projectmonokochi@rediffmail.com>
6361             Harilal P R  <projectmonokochi@rediffmail.com>
6362
6363         Fix #71134.
6364         * pending.cs (PendingImplementation.GetAbstractMethods):
6365         Find NonPublic members too.
6366
6367 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6368
6369         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6370         Fixed error 217.
6371         
6372         * class.cs (MethodCore.CheckMethodAgainstBase):
6373         Add error 239 report.
6374
6375 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6376
6377         Fix #68955.
6378         * expression.cs (Invocation.IsApplicable): Make public.
6379         (Invocation.IsParamsMethodApplicable): Likewise.
6380         * delegate.cs (Delegate.VerifyApplicability): Don't use
6381         Invocation.VerifyArgumentCompat for parameter applicability
6382         testing.  Use Invocation.IsApplicable and
6383         Invocation.IsParamsMethodApplicable.
6384
6385 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6386
6387         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6388         
6389         * class.cs (Operator.Define): Add error 217 report.
6390         
6391 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6392
6393         * namespace.cs (UsingEntry.Resolve): Undo change below.
6394
6395 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6396
6397         Fix #72756.
6398         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6399         disable the error message when the extended MemberLookup also
6400         fails.
6401         (Expression.MemberLookupFinal): Update.
6402         (SimpleName.DoSimpleNameResolve): Update.
6403         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6404         Don't use MemberLookupFinal.
6405         (New.DoResolve): Update.
6406         (BaseAccess.CommonResolve): Update.
6407
6408 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6409
6410         Fix #72732.
6411         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6412         occured previously, don't resolve again.
6413
6414 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6415
6416         Fix #69949
6417         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6418         argument. Call ResolveAttributeUsage for unresolved.
6419         when types doesn't match ctor arguments.
6420         
6421         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6422         for nested attribute classes.
6423         (Class.attribute_usage): Removed.
6424         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6425         for attribute class.
6426         
6427         * ecore.cs (IsAttribute): Removed.
6428         
6429         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6430         
6431         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6432         now normal types.
6433         (attribute_types): Removed.
6434         (EmitCode): Global attributes are emited as the latest.
6435
6436 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6437
6438         * class.cs (EmitFieldInitializers): Don't emit field initializer
6439         for default values when optimilization is on.
6440         
6441         * constant.cs (Constant.IsDefaultValue): New property.
6442         
6443         * driver.cs: Add /optimize handling.
6444         
6445         * constant.cs,
6446         * ecore.cs,
6447         * literal.cs: Implement new IsDefaultValue property.
6448         
6449         * rootcontext.cs (Optimize): New field, holds /optimize option.
6450
6451 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6452
6453         Fix crasher in re-opened #72347.
6454         * namespace.cs (Namespace.Lookup): Return null if
6455         DeclSpace.DefineType returns null.
6456
6457         Fix #72678.
6458         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6459
6460 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6461
6462         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6463         now returns null if it cannot resolve to an lvalue.
6464         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6465         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6466         returned null.  Remove check for SimpleName.
6467         (EventExpr.DoResolveLValue): New.
6468         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6469         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6470         error from ...
6471         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6472         avoid CS0131 error.
6473         (Unary.ResolveOperator): Move CS0211 check ...
6474         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6475         CS0131 error.
6476         (Unary.DoResolveLValue): Simplify.
6477         (AddressOf.DoResolveLValue): New.
6478         (ArrayAccess.DoResolveLValue): New.
6479
6480 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6481
6482         * attribute.cs (Attribute.Resolve): Add arguments casting for
6483         when types doesn't match ctor arguments.
6484
6485 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6486
6487         Fix parts of #63202.
6488         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6489         lookup of operator in base type.  Ensure that all checks happen
6490         when the operator resolves to an "op_..." method.
6491
6492 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6493
6494         Fix #71992.
6495         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6496         'ignore_cs0104' parameter.  Pass it to ...
6497         (NamespaceEntry.Lookup): ... this.
6498         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6499         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6500         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6501         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6502         Update.  Request that cs0104 errors be ignored.
6503         (ComposedCast.ResolveAsTypeStep): Update.
6504
6505 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6506
6507         Fix #59209.
6508         * expression.cs (Invocation.BetterFunction): Remove support for
6509         comparing virtual functions and their overrides.
6510         (Invocation.IsOverride): New.
6511         (Invocation.OverloadResolve): Don't consider 'override' functions
6512         during candidate selection.  Store them in a lookaside list.
6513         If the selected method is a 'virtual' function, use the list to
6514         find any overrides that are closer to the LHS type.
6515
6516 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6517
6518         * expression.cs (New.DoResolve): Add complex core type reduction.
6519         (New.Constantify): Converts complex core type syntax like 'new int ()'
6520         to simple constant.
6521         
6522 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6523
6524         * decl.cs (EntryType.EntryType): New constructor to create an
6525         updated copy of a cache entry.
6526         (MemberCache.AddMethods): Use it.
6527         (MemberCache.ClearDeclaredOnly): Remove.
6528         (MemberCache.MemberCache): Update.
6529
6530 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6531
6532         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6533         variable.  This one is represents the actual low-level declaration
6534         of the method, as opposed to the semantic level `IsStatic'.   
6535
6536         An anonymous method which is hosted into a static method might be
6537         actually an instance method.  IsStatic would reflect the
6538         container, while MethodIsStatic represents the actual code
6539         generated.
6540
6541         * expression.cs (ParameterReference): Use the new MethodIsStatic
6542         instead of IsStatic.
6543
6544         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6545         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6546         set on the current EmitContext. 
6547
6548         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6549         resolve our casted expression as an LValue.  This triggers the
6550         proper LValue processing that is later required by Assign.
6551
6552         This fixes 72347.
6553
6554         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6555
6556 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6557
6558         C# 2.0 Fixed buffer implementation
6559
6560         * anonymous.cs: Update after RegisterHelperClass renaming.
6561
6562         * attribute.cs (AttributeTester.fixed_buffer_cache):
6563         Cache of external fixed buffers.
6564         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6565         implementation if field is fixed buffer else null.
6566
6567         * class.cs
6568         (TypeContainer.AddField): Accept FieldMember instead of Field.
6569         (FieldBase.IsFieldClsCompliant): Extracted code from
6570         VerifyClsCompliance descendant customization.
6571         (FixedField): New class handles fixed buffer fields.
6572         (FixedFieldExternal): Keeps information about imported fixed
6573         buffer.
6574         (IFixedField): Make access to internal or external fixed buffer
6575         same.
6576
6577         * cs-parser.jay: Add fixed buffer parsing.
6578
6579         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6580         buffer.
6581
6582         * expression.cs (Indirection): Extended implementation to accept
6583         fixed buffer field.
6584         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6585         (ElementAccess.MakePointerAccess): Get type as parameter.
6586         (DoResolve): Add fixed buffer field expression conversion.
6587         (DoResolveLValue): Ditto.
6588         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6589         (ArrayPtr): Derives from FixedBufferPtr.
6590         (ArrayPtr.Emit): Add extra emit for array elements.
6591
6592         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6593
6594         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6595         for compiler generated types.
6596         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6597
6598         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6599         and consume less memory.
6600         (Fixed.Resolve): Add fixed buffer case.
6601
6602         * typemanager.cs (compiler_generated_attr_ctor,
6603         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6604         (HasElementType): Add our own implementation to work on every
6605         runtime.
6606
6607 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6608
6609         * anonymous.cs (CaptureContext): Track whether `this' has been
6610         referenced.   
6611
6612         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6613         only captured `this' if it was implicitly done (instance
6614         methods/variables were used). 
6615
6616         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6617         `this' must be captured.
6618
6619 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6620  
6621         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6622         is null it means that there has been no need to capture anything,
6623         so we just create a sibling.
6624
6625         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6626
6627         Just a partial fix.  The other half is fairly elusive.
6628         
6629 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6630
6631         Fix #52586, cs0121-4.cs.
6632         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6633         and return a hashtable.
6634         (MemberCache.ClearDeclaredOnly): New.
6635         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6636         the method_hash of a base type too.
6637         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6638         type methods.  Overwrite entries with the same MethodHandle so
6639         that the ReflectedType is correct.  The process leaves in base
6640         virtual functions and their overrides as distinct entries.
6641         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6642         matters since it was boxed in a ArrayList before.
6643         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6644         modifier.
6645         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6646         case of a virtual function and its override (choose the overload
6647         as better).
6648         (Invocation.OverloadResolve): Avoid 'override' members during
6649         'applicable_type' calculation.
6650
6651 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6652
6653         Combine two near-redundant caches.
6654         * typemanager.cs (method_params): Rename from method_internal_params.
6655         (TypeManager.GetParameterData): New.  Replace
6656         Invocation.GetParameterData.
6657         (TypeManager.LookupParametersByBuilder): Remove.
6658         * expression.cs (Invocation.method_parameter_cache): Remove.
6659         (Invocation.GetParameterData): Remove.
6660         Update to changes.
6661         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6662         Update to changes.
6663
6664 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6665
6666         Fix #72015.
6667         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6668         TypeManager.multicast_delegate_type is null, resolve it by looking
6669         up "System.MulticastDelegate".
6670         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6671
6672 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6673             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6674             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6675
6676         Fix cs0164.cs.
6677         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6678         (LabeledStatement.AddReference): New.  Set 'referenced'.
6679         (Goto.Resolve): Use it.
6680
6681 2005-02-05  John Luke  <john.luke@gmail.com>
6682
6683         * driver.cs: remove duplicate -doc line in Usage ()
6684
6685 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6686
6687         * location.cs (Location.AddFile): Fix CS2002 error report.
6688
6689 2005-02-02  Martin Baulig  <martin@ximian.com>
6690
6691         * delegate.cs (Delegate.DefineType): Report an internal error if
6692         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6693         details.        
6694
6695 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6696
6697         Fix a crasher in a variant of #31984.
6698         * const.cs (Constant.CheckBase): New override that defers the
6699         new-or-override check in case the base type hasn't been populated
6700         yet.
6701         (Constant.Define): Ensure the new-or-override check is performed.
6702
6703 2005-02-01  Duncan Mak  <duncan@ximian.com>
6704
6705         * const.cs (LookupConstantValue): Check that `ce' is not null
6706         before calling GetValue ().
6707
6708 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6709
6710         Fix test-334.cs (#69519).
6711         * cs-parser.jay (using_alias_directive): Pass in an expression to
6712         NamespaceEntry.UsingAlias.
6713         (using_namespace_directive): Pass in an expression to
6714         NamespaceEntry.Using.
6715         (namespace_name): Don't flatten to a string.
6716         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6717         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6718         ResolveAsTypeStep.
6719         (NamespaceEntry.UsingEntry): Likewise.
6720         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6721         changes.
6722         (NamespaceEntry.LookupForUsing): Remove.
6723         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6724         names.
6725         (NamespaceEntry.Lookup): Remove support for dotted names.
6726
6727 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6728
6729         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6730         split into two.
6731         (NamespaceEntry.ImplicitParent): Compute on demand.
6732         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6733         parallels the current.
6734         (NamespaceEntry.LookupForUsing): Use it.
6735         (NamespaceEntry.Lookup): If the current namespace-entry is
6736         implicit, don't search aliases and using tables.
6737
6738 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6739
6740         Fix #31984.
6741         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6742         BaseCache here.
6743         (TypeContainer.BaseCache): Compute on demand.
6744         (TypeContainer.FindMembers): Define constants and types if they're
6745         not already created.
6746         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6747         check.
6748         * const.cs (Constant.Define): Make idempotent.
6749
6750 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6751
6752         * pending.cs: Produce better code (no nops produced by using Ldarg
6753         + value).
6754         
6755         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6756         i - 1' it should be arg + 1.
6757
6758         Fixes bug #71819.
6759
6760 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6761
6762         * attribute.cs (Attribute.CheckAttributeType): Make private
6763         non-virtual.
6764         (Attribute.ResolveType): Make virtual.
6765         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6766         handling of RootContext.Tree.Types.
6767
6768 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6769
6770         Update attribute-handling to use the SimpleName/MemberAccess
6771         mechanisms.
6772         * cs-parser.jay (attribute): Pass in an expression to the
6773         constructors of Attribute and GlobalAttribute.
6774         * attribute.cs (Attribute): Take an expression for the name.
6775         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6776         passed in attribute name expression.
6777         (Attribute.CheckAttributeType): Use it.
6778         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6779         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6780         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6781         argument to prevent error messages if the lookup fails.
6782
6783 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6784
6785         * expression.cs (Indirection): Implemented IVariable interface
6786         to support indirection in AddressOf operator.
6787         (PointerArithmetic.Emit): Add optimalization for case where
6788         result can be precomputed.
6789
6790 2005-01-26  Martin Baulig  <martin@ximian.com>
6791
6792         * class.cs (TypeContainer.AttributeTargets): Return the correct
6793         AttributeTargets depending on our `Kind' instead of throwing an
6794         exception; fixes #71632.
6795
6796 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6797
6798         Fix #71257
6799         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6800         constant members.
6801
6802 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6803
6804         Fix #71602.
6805         * expression.cs (MemberAccess.DoResolve): Don't complain with
6806         cs0572 when the LHS of a member access has identical name and type
6807         name.
6808
6809 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6810
6811         Fix #71651, #71675
6812         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6813         CreatePermission.
6814         Create custom PermissionSet only for PermissionSetAttribute.
6815
6816 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6817
6818         Fix #71649
6819         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6820         delegates in static class.
6821
6822 2005-01-24  Martin Baulig  <martin@ximian.com>
6823
6824         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6825         merging an implicit block, just use its reachability.
6826
6827         * statement.cs (Block.Resolve): Make the unreachable code check
6828         work wrt. implicit blocks; see test-337 from #63842.
6829
6830 2005-01-21  Alp Toker  <alp@atoker.com>
6831  
6832         * cs-parser.jay: destructor_declaration's container is PartialContainer
6833         not Class when partial types are used, so use Kind prop instead of
6834         'is'.
6835         
6836 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6837
6838         * cs-parser.jay: Improve error reporting when an interface
6839         declares new types.
6840
6841 2005-01-20  Dick Porter  <dick@ximian.com>
6842
6843         * support.cs: SeekableStreamReader fix from Sandor Dobos
6844         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6845         chars are read.  Fixes bug 70369.
6846
6847 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6848
6849         * cs-parser.jay (catch_clause): Simplify current_block handling
6850         somewhat.
6851
6852 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6853
6854         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6855         code with ImplicitStandardConversion to handle the implicit
6856         conversion of method groups into valid delegate invocations. 
6857
6858         The problem is that in parameter handling we were using this code
6859         path.  Fixes bug #64698
6860
6861 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6862
6863         * cs-parser.jay: Fix several infelicities.
6864         - Avoid assigning to the parser value stack.  Code like 
6865           '$3 = null' is unclean.  Synthesize a value for the code block
6866           instead. 
6867         - Avoid using oob_stack for storing location information.  Use ...
6868         (_mark_): ... this.  New (empty) rule.  Saves the current location
6869         in $$.
6870         (foreach_statement): Avoid using oob_stack for current_block
6871         handling.  Use technique used in for_statement and
6872         using_statement.  Synthesize a value for the code block to store
6873         additional intermediate information.
6874
6875 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6876
6877         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6878         of a different type is only allowed to private fields of a
6879         containing type, not on fields of a base class.
6880
6881         See test-174.cs and error cs0122-9.cs
6882
6883 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6884
6885         Fix test-335.cs (bug #58126).
6886         * cs-parser.jay (argument): Split out non-expression parts of the
6887         rule into 'non_simple_argument'.
6888         (invocation_expression): Support parenthesized invocations with
6889         multiple arguments, and with single non-simple arguments.
6890
6891 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6892
6893         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6894         places.
6895
6896 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6897
6898         Fix cs0038-1.cs, cs1640-6.cs.
6899         * ecore.cs (Expression.Resolve): Remove special-case for
6900         SimpleName in error-handling.
6901         (Expression.almostMatchedMembers): Relax access permission to
6902         protected.
6903         (Expression.MemberLookupFailed): Handle duplicates in
6904         almostMatchedMembers list.
6905         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6906         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6907         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6908         overload if the passed in MemberInfo is a MethodBase.
6909
6910 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6911
6912         Fix #70749
6913         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6914         for non-CAS & merge permission sets properly.
6915
6916 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6917
6918         Improve standard-compliance of simple name and member access 
6919         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6920         * ecore.cs (FullNamedExpression): New abstract base class 
6921         for Namespaces and TypeExpressions.
6922         (ResolveFlags.SimpleName): Remove.
6923         (SimpleName): Remove support for dotted names.
6924         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6925         DeclSpace.FindType and DeclSpace.LookupType.
6926         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6927         (Expression.ExprClassName): Make member function.
6928         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6929         a namespace.  Remove creation of dotted "SimpleName"s.
6930         (MemberAccess.DoResolve): Likewise.
6931         * decl.cs (DeclSpace.Cache): Make private.
6932         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6933         (DeclSpace.FindType): Update.
6934         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6935         FullNamedExpression.
6936         * namespace.cs (Namespace): Derive from FullNamedExpression
6937         so that it can be part of expression resolution.
6938         (Namespace.Lookup): Return an FullNamedExpression.
6939         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6940         namespace.
6941         * rootcontext.cs (NamespaceLookup): Remove.
6942         (LookupType): Move to DeclSpace.
6943         * attribute.cs (CheckAttributeType): Update.
6944         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6945         (FindDocumentedTypeNonArray): Likewise.
6946
6947 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6948
6949         Fix cs0509.cs, cs1632.cs.
6950         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6951         is the same as IsInterface.
6952         (TypeContainer.GetClassBases): Likewise.
6953         * statement.cs (LabeledStatement.ig): New field.
6954         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6955         label.
6956         (LabeledStatement.DoEmit): Check that the label was created with
6957         the same ILGenerator.
6958
6959 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6960
6961         Fix #71058
6962         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6963         accessors to its properties.
6964
6965         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6966         from accessors to property.
6967         
6968 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6969
6970         Fix #70722
6971         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6972         only for overrides.
6973         
6974 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6975
6976         * attribute.cs: Check for null and empty strings.  
6977
6978         I have lost another battle to Paolo.
6979
6980 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6981
6982         Fix #70942
6983         * class.cs (PropertyMethod): Set Parent field in ctors.
6984         (SetMethod.InternalParameters): Add unsafe switch hack.
6985         Override MarkForDuplicationCheck where it is appropriate.
6986
6987         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6988         It says whether container allows members with the same name.
6989         Base default is no.
6990         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6991         Removed is_method parameter.
6992
6993 2005-01-06  Duncan Mak  <duncan@ximian.com>
6994
6995         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6996         because the previous change led to incorrect reporting of CS1032
6997         ("Cannot define/undefine preprocessor symbols after first token in
6998         file"). Instead of using `tokens_seen' as the only flag that
6999         triggers CS1040, introduce `comments_seen'. This new flag is used
7000         to signify having seen comments on the current line, so it is
7001         unset after a newline.
7002
7003 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7004
7005         * doc.cs : When searching for a type, find nested type too.
7006           This fixes bug #71040.
7007
7008 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7009
7010         * doc.cs :
7011           - Warn missing member comment on those classes which also does not
7012             have doc comments. Fixed bug #71041.
7013           - Don't warn missing doc comment on default constructor.
7014             Fixed bug #71042.
7015
7016 2005-01-06  Duncan Mak  <duncan@ximian.com>
7017
7018         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7019         comments, set `tokens_seen' to true. This allows us to detect
7020         misplaced preprocessor directives (i.e. not at the beginning of
7021         the a line, nor after whitespaces). In that case, report error
7022         CS1040. This fixes bug #56460.
7023
7024         * cs-parser.jay (interface_member_declaration): Add checks for
7025         IsExplicitImpl, and report CS0541 error if an interface member is
7026         defined as an explicit interface declaration.
7027
7028 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7029
7030         Fix #70817
7031         * class.cs (PropertyMethod): Set Parent field in ctors.
7032         (SetMethod.InternalParameters): Add unsafe switch hack.
7033         
7034         * decl.cs (MemberCore.Parent): Cannot be readonly.
7035
7036 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7037
7038         * decl.cs (DeclSpace.ResolveType): Remove.
7039         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7040         Merge in code from ...
7041         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7042         * class.cs, enum.cs: Update to changes.
7043
7044 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7045
7046         * anonymous.cs: Ensure that we init the scope of our parent if it
7047         has not been initialized yet.
7048
7049 2004-12-30  Duncan Mak  <duncan@ximian.com>
7050
7051         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7052         if field.FieldBuilder is null. Fixes #70758.
7053
7054         * convert.cs: Fixed some typos and updated some of the comments.
7055         (ImplicitStandardConversionExists):
7056         (TryImplicitIntConversion): If `target_type' is an interface and
7057         the type of `ic' implements this interface, return true or a new
7058         BoxedCast instead of null. This fixes #70468.
7059
7060 2004-12-29  Duncan Mak  <duncan@ximian.com>
7061
7062         * expression.cs (Argument.Emit): Check that Expr is
7063         IMemoryLocation before casting to it, and report CS1510 otherwise.
7064
7065         This fixes #70402.
7066
7067 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7068
7069         * statement.cs (Block.ThisVariable): remove the recursion here, to
7070         make the --profile more sane.
7071
7072 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7073
7074         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7075         assembly, by JB Evain.
7076
7077 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7078
7079         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7080           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7081         "parent" refers to enclosing type/class.  "base" refers to superclass.
7082
7083 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7084
7085         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7086         Ensure that we only have GlobalAttributes.
7087         * attribute.cs (Attribute.Emit): Make non-virtual.
7088         (GlobalAttribute.Emit): Remove.
7089         (Attribute.Resolve): Make virtual.
7090         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7091         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7092         the argument. Don't create one.
7093         (Attribute.GetObsoleteAttribute): Likewise.
7094         (Attribute.GetClsCompliantAttributeValue): Likewise.
7095         * class.cs, decl.cs: Update to changes.
7096
7097 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7098
7099         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7100         
7101         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7102         
7103         * statement.cs (Foreach.Resolve): Add error 186 report.
7104
7105 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7106
7107         * expression.cs (Conditional.DoResolve): Add warning 429.
7108         
7109         * statement.cs (If.Resolve): Add warning 665.
7110
7111 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7112
7113         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7114         except when in the parser, and in GlobalAttribute.
7115         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7116         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7117         RootContext.Tree.Types.NamespaceEntry once work is done.
7118         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7119         and resets RootContext.Tree.Types.NamespaceEntry.
7120
7121 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7122
7123         * cs-parser.jay: Don't create a block for every variable.
7124
7125 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7126
7127         * location.cs: Provide extra information.
7128
7129         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7130         variables from the captured environment, it is the ldarg_0.
7131
7132 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7133
7134         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7135         find a conclusion.
7136         
7137         * class.cs: Changed warning level for 169 to avoid developer
7138         displeasure from warning flooding. It will be changed back when they
7139         fix most of current BCL warnings.
7140         
7141         * RootContext.cs: Pushed default WarningLevel to 3.
7142         
7143         * statement.cs: Removed unused variable.
7144
7145 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7146
7147         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7148         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7149         Add error 502 report.
7150         (StaticClass.DefineType): Add error 441 report.
7151         (Class.AllowedModifiersProp): New virtual property as temporary
7152         extension to AllowedModifiers.
7153         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7154         to share implementation with StaticClass and don't call virtual
7155         methods from ctor.
7156         
7157         * driver.cs (MainDriver): Add error 1558 test.
7158
7159         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7160         report. Moved error 36 test here.
7161
7162         * statement.cs (Throw.Resolve): Add error 724 report.
7163
7164         * typemanager.cs: Add out_attribute_type core type.
7165         
7166 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7167
7168         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7169         3018 report.
7170         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7171
7172         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7173         3017 report.
7174         
7175         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7176
7177         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7178         Add error 3023 report.
7179         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7180
7181         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7182         implementation.
7183
7184 2004-12-12  John Luke  <john.luke@gmail.com>
7185
7186         * driver.cs (AddArgs): take -- into account when
7187         adding arguments, fixes bug 65710 
7188
7189 2004-12-12  Martin Baulig  <martin@ximian.com>
7190
7191         * expression.cs (Unary.TryReduceNegative): Added support for
7192         SByteConstant and ByteConstant.
7193         (Unary.Reduce): Check error values from TryReduceNegative().
7194
7195 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7196
7197         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7198         and report exception as error 182.
7199
7200 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7201
7202         * driver.cs (Main): Fix message when there are warnings.
7203
7204 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7205
7206         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7207
7208 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7209
7210         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7211         Reduced number of warnings.
7212         
7213         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7214
7215 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * driver.cs: Removed message.
7218
7219         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7220
7221 2004-12-08    <vargaz@freemail.hu>
7222
7223         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7224
7225 2004-12-08  Martin Baulig  <martin@ximian.com>
7226
7227         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7228         instead of a CS3002 for properties and indexer.
7229
7230 2004-12-08  Martin Baulig  <martin@ximian.com>
7231
7232         * decl.cs (MemberName.ToString): Make this work again.
7233
7234 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7235
7236         * attribute.cs (Resolve): Add error 591 detection.
7237
7238         * class.cs (FieldMember.Define): Add error 1547 detection.
7239         (Indexer.Define): Add error 620 detection.
7240         (Operator.Define): Add error 590 detection.
7241
7242         * ecore.cs: Missing argument for error 79.
7243
7244         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7245         detection.
7246
7247 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7248
7249         Fix #70106
7250         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7251         only.
7252
7253 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7254
7255         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7256           Some operator comments were suppressed.
7257         * doc.cs : Implicit/explicit operator name in doc comments are like
7258           "op_Explicit(type)~returnType", so added suffix handling.
7259
7260 2004-12-07  Martin Baulig  <martin@ximian.com>
7261
7262         * decl.cs
7263         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7264         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7265         (DeclSpace.ec): New protected field; store the EmitContext here.
7266         (DeclSpace.EmitContext): New public property; moved here from
7267         `TypeContainer'.
7268         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7269         EmitContext.
7270
7271         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7272         (Enum.Emit): Don't create a new EmitContext.
7273
7274         * delegate.cs (Delegate.DefineType): Always create the
7275         EmitContext.
7276
7277         * iterators.cs (Iterators.DefineIterator): Create a new
7278         EmitContext and store it in `ec'.
7279
7280 2004-08-24  Martin Baulig  <martin@ximian.com>
7281
7282         * typemanager.cs
7283         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7284         this for accessibility checks.
7285         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7286         IsNestedFamilyAccessible.
7287         (TypeManager.IsSubclassOf): New method, do what the name actually
7288         says.   
7289
7290 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7291
7292         Fix crash on cs0657-17.cs.
7293         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7294         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7295         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7296         the case where the NamespaceEntry gets overwritten.
7297
7298 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7299
7300         Fixed #69195, #56821
7301         * ecore.cs (ResolveBoolean): Tiny refactoring.
7302
7303         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7304         of right expression resolving when left is false constant and
7305         operator is LogicalAnd OR true constant and operator is LogicalOr.
7306
7307         * statement.cs (ResolveUnreachable): Always reports warning.
7308
7309 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7310
7311         * class.cs: Distinguish between 1721 and 1722 (just a little help
7312         for the programmer).
7313
7314 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7315
7316         * delegate.cs: Only allow this on new versions of the language. 
7317
7318 2004-12-02  Duncan Mak  <duncan@ximian.com>
7319
7320         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7321         Expression class.
7322         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7323         here as a static method. Take an additional bool out parameter
7324         `must_do_cs1540_check' for signaling to InstanceResolve.
7325         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7326         member field from PropertyExpr class and made it an argument of
7327         the method instead.
7328         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7329         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7330         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7331         and `remove_accessor' as well as InstanceResolve: report CS0122
7332         where applicable.
7333
7334         Fixes #70129.
7335
7336 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7337
7338         Fix test-327.cs, test-328.cs, and put in early infrastructure
7339         for eventually fixing #52697.
7340         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7341         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7342         from other methods.
7343         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7344         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7345         (VerifyUsing, error246): Update.
7346         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7347         'NamespaceEntry.LookupNamespaceOrType'.
7348
7349 2004-12-03  Martin Baulig  <martin@ximian.com>
7350
7351         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7352         method as our child, call AnonymousMethod.Compatible() on it.
7353
7354 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7355
7356         Disable XML documentation support in 'basic' profile.
7357         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7358         Redirect XmlElement to System.Object.
7359         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7360         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7361         * mcs.exe.sources: Add doc-bootstrap.cs.
7362         * doc-bootstrap.cs: New file.  Contains empty stub implementation
7363         of doc.cs.
7364
7365 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7366
7367         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7368           comments are allowed.
7369
7370 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7371
7372         * delegate.cs: Add checks for subtypes in paramaters and return values
7373         in VerifyMethod () to add support for Covariance/Contravariance
7374         in delegates.
7375         
7376 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7377
7378         * report.cs: Remove extra closing parenthesis.
7379
7380         * convert.cs (Error_CannotImplicitConversion): If the name of the
7381         types are the same, provide some extra information.
7382
7383         * class.cs (FieldBase): Use an unused bit field from the field to
7384         encode the `has_offset' property from the FieldMember.  This saves
7385         a couple of Ks on bootstrap compilation.
7386
7387         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7388         method as our child, return the AnonymousMethod resolved
7389         expression.
7390
7391         * expression.cs (New.DoResolve): Allow return values from
7392         NewDelegate to also include AnonymousMethods.
7393
7394         Fixes #70150.
7395
7396 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7397
7398         Fix bug #70102
7399         * attribute.cs (Resolve): Improved implementation of params
7400         attribute arguments.
7401
7402         * support.cs (ParameterData): Add HasParams to be faster.
7403
7404 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7405
7406         all things are for /doc support:
7407
7408         * doc.cs: new file that supports XML documentation generation.
7409         * mcs.exe.sources: added doc.cs.
7410         * driver.cs:
7411           Handle /doc command line option.
7412           Report error 2006 instead of 5 for missing file name for /doc.
7413           Generate XML documentation when required, after type resolution.
7414         * cs-tokenizer.cs:
7415           Added support for picking up documentation (/// and /** ... */),
7416           including a new XmlCommentState enumeration.
7417         * cs-parser.jay:
7418           Added lines to fill Documentation element for field, constant,
7419           property, indexer, method, constructor, destructor, operator, event
7420           and class, struct, interface, delegate, enum.
7421           Added lines to warn incorrect comment.
7422         * rootcontext.cs :
7423           Added Documentation field (passed only when /doc was specified).
7424         * decl.cs:
7425           Added DocComment, DocCommentHeader, GenerateDocComment() and
7426           OnGenerateDocComment() and some supporting private members for
7427           /doc feature to MemberCore.
7428         * class.cs:
7429           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7430         * delegate.cs:
7431           Added overriden DocCommentHeader.
7432         * enum.cs:
7433           Added overriden DocCommentHeader and GenerateDocComment().
7434
7435 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7436
7437         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7438         unwrapping the enumeration values, chain to
7439         DoConstantNumericPromotions again, so we can promote things to the
7440         fundamental types (takes care of enums that are bytes, sbytes).
7441
7442         Fixes bug #62054.
7443
7444 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7445
7446         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7447         Fix long-standing bug in type-lookup.  Use FindType instead of
7448         LookupType when ec.ResolvingTypeTree.
7449         (Attribute.ResolveType, Attribute.Resolve)
7450         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7451         Update to changes.
7452         (Attributes.Search): Remove internal version.  Update.
7453         (Attributes.SearchMulti): Update.
7454         (Attributes.GetClsCompliantAttribute): Remove.
7455         (Attributes.GetIndexerNameAttribute): Remove.
7456         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7457         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7458         * class.cs (Indexer.Define): Likewise.
7459
7460 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7461
7462         Fix bug #68790
7463         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7464         MarshallByReference members access.
7465
7466         * expression.cs: Use CheckMarshallByRefAccess;
7467         Better error CS0197 message.
7468
7469         * report.cs: Print whole related error message.
7470
7471 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7472
7473         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7474         the current directory to help debugging.
7475
7476 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7477
7478         * class (GetClassBases): Better error 60 report.
7479         (EventProperty): Disabled warning 67 detection.
7480
7481 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7482
7483         Fix bug #60324
7484         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7485
7486         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7487         precise values.
7488
7489 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7490
7491         Fix bug #49488
7492         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7493
7494         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7495
7496 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7497
7498         * attribute.cs (Attribute.Resolve): Refine error reporting and
7499         report a cs0117 if the identifier does not exist, to distinguish
7500         from 0617 which is a miss-use of the actual identifier.
7501
7502         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7503         between cs0070 and cs0079.
7504
7505         * class.cs (MemberBase.DoDefine): When reporting a wrong
7506         accessibility level, we use MethodCore to compare instead of
7507         Method (this was a regression in some refactoring effort).
7508
7509         So now we correctly report cs0056 again.
7510
7511         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7512         testing the target_type (which was known to be object_type) and
7513         not the source type (which is anonymous_method).
7514
7515         Fixed reporting of error cs1660.
7516
7517         * expression.cs (UserCast.Source): Expose the underlying cast.
7518
7519         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7520         allowed types to find a match to int32 first (most common).
7521
7522         In addition, it ignores any ImplicitUserConversions that did an
7523         internal implicit conversion (as the switch statement allows only
7524         one integral conversion to exist).
7525
7526         * class.cs (PartialContainer.Create): rename `name' to
7527         `member_name' for clarity.  Then replace the string calls with a
7528         call to MemberName.GetPartialName, as now using
7529         MemberName.ToString is an error (this is due to the side effects
7530         it had, that were fixed in the past).
7531
7532         This will restore the error reporting on a number of partial class
7533         errors that were missusing this (and getting an exception as a
7534         results, which is now just a plain textual warning, because
7535         yyparse debug output would crash otherwise).
7536
7537 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7538
7539         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7540
7541 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7542
7543         * rootcontext.cs (LookupType): Make sure to cache lookups that
7544         don't give us a negative result. This saves about 5% of corlib
7545         compilation time.
7546
7547 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7548
7549         * report.cs (AbstractMessage.Print): messages are sent to stderr
7550
7551         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7552         non-interface in the list of interfaces (at this point, either
7553         parent was properly set, or a base class is being listed in the
7554         interfaces section).
7555
7556         This flags error 1722, and resolves the crash from bug 69259.
7557
7558 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7559
7560         * statement.cs (Using.EmitExpressionFinally): make this work right
7561         for valuetypes. Fixes 69926.
7562
7563 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7564
7565         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7566         converted to an enum" here, before we try to change the underlying
7567         type.  This code exists, but it is a different code path than the
7568         one used while encoding constants.
7569
7570         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7571         old bug: when converting from the null literal to a pointer,
7572         return an EmptyCast, not the NullLiteral.
7573
7574         This fixes #69921, the recent null_type changes probably made this
7575         bug more prominent.
7576
7577         (ImplicitReferenceConversionExists): In addition, resynchronized
7578         the code here, so it matches the same code in
7579         ImplicitReferenceConversionExists for the `from any class-type S
7580         to any interface-type T'.
7581         
7582
7583 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7584
7585         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7586
7587 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7588
7589         * cs-parser.jay: Use verbosity accordingly. 
7590
7591 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * expression.cs (Unary.ResolveOperator): Do not report warning;
7594         AddressOf reads from variable.
7595         
7596         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7597
7598 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7599
7600         Fix bug #69462
7601
7602         * attribute.cs (Attributable): Removed CheckTargets.
7603         (Attributes.Emit): Explicit attribute targets are tested here.
7604
7605         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7606         not enabled for interfaces.
7607
7608         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7609         (GetAssemblyName): Ouch next bug there.
7610
7611 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7612
7613         * expression.cs: Error 275 added.
7614         
7615 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7616
7617         Fix bug #69177 (Implemented decimal constant support)
7618
7619         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7620         (BinaryFold): Add DecimalConstant.
7621
7622         * const.cs (Define): Decimal constant 
7623         (is not constant.
7624         (ChangeType): Add decimal type handling.
7625         (LookupConstantValue): Don't set value for decimal type but
7626         emit DecimalConstantAttribute. Needed for constant optimization.
7627
7628         * constant.cs (ToDecimal): New method.
7629         (ConvertToDecimal): New method.
7630         (IntConstant): Implemented ConvertToDecimal.
7631         (DecimalConstant.Emit): Emit optimized version for decimals in
7632         int range.
7633
7634         * expression.cs (ResolveOperator): Changed order of constant
7635         reduction to work correctly with native types which have
7636         overloaded operators.
7637         (ResolveMemberAccess): Extract constant value from attribute
7638         for decimal type.
7639
7640         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7641
7642         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7643         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7644         (ChangeType): Decimal is special.
7645         (TypeToCoreType): Add decimal type.
7646
7647 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7648
7649         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7650         decimal types.
7651
7652 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7653
7654         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7655         test cs1667-5.cs.
7656
7657 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7658
7659         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7660
7661         * pending.cs (PendingImplementation): Grab only interfaces.
7662
7663 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7664
7665         * statement.cs (ForeachHelperMethods): Add location member and
7666         error 202 detection.
7667
7668 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7669
7670         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7671         automatically handled by executable.make.
7672         (PROGRAM): Make profile-specific.
7673
7674 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7675
7676         * expression.cs (DoResolveBase): Fixed wrong warning for out
7677         variables.
7678
7679 2004-11-18  Martin Baulig  <martin@ximian.com>
7680
7681         Merged latest changes into gmcs.  Please keep this comment in
7682         here, it makes it easier for me to see what changed in MCS since
7683         the last time I merged.
7684
7685 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7686
7687         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7688         (TypeHandle.GetMemberCache): New.
7689         (TypeHandle.TypeHandle): Update.
7690         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7691         (TypeManager.LookupParentInterfacesCache):
7692         Rename from LookupInterfaceCache.  Optimize slightly.
7693         (TypeManager.MemberLookup_FindMembers): Update.
7694         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7695         multi-type variant.
7696         (AddCacheContents): Rename from AddHashtable.
7697         * class.cs (TypeContainer.parent_container): Remove.
7698         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7699         (TypeContainer.DoDefineMembers): Don't initialize it.
7700         Update to name changes.
7701         
7702 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7703
7704         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7705         that factors the code to check access modifiers on override.  
7706
7707         (PropertyBase): Use the code here.
7708
7709         Patch from Lluis S'anchez, fixes bug #69361.
7710
7711 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7712
7713         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7714         routine that is used to report the use of a captured variable
7715         whose address has been taken.
7716
7717         There are two checks: one when variables are being captured and
7718         the other check is when the address of a variable is taken. 
7719         
7720         (because an anonymous methods might be resolved before *or* after
7721         the address has been taken) and 
7722
7723         * expression.cs (Conditional.DoResolve): Remove the special
7724         casing that Martin added to trueExpr and falseExpr being both
7725         NullLiteral.  We get the right behavior now just by introducing
7726         the null_type into the compiler. 
7727
7728         * convert.cs (ExplicitConversion): Change the code to use
7729         null_type instead of testing `expr is NullLiteral'.
7730         (ImplicitConversionStandard): use null_type too.
7731         (ImplicitReferenceConversionExists): use null_type too.
7732         (ImplicitReferenceConversion): use null_type too.
7733
7734         * literal.cs: The type of `NullLiteral' is now null_type instead
7735         of object_type. 
7736         (Resolve): Set the type here.
7737
7738         * typemanager.cs: Introduce null_type.
7739
7740 2004-11-17  Martin Baulig  <martin@ximian.com>
7741
7742         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7743         direction, like FindMembers() does.  Fixes #69546, testcase is in
7744         test-315.cs.    
7745
7746 2004-11-16  Martin Baulig  <martin@ximian.com>
7747
7748         This is based on a patch from Marek Safar, see bug #69082.
7749         Fixes bugs #63705 and #67130.
7750
7751         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7752         method; create a MemberCache for an interface type and cache the
7753         result.
7754
7755         * decl.cs (IMemberContainer.ParentContainer): Removed.
7756         (IMemberContainer.ParentCache): New property.
7757         (MemberCache.SetupCacheForInterface): Removed.
7758         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7759         to create a cache for an interface's "parent".
7760
7761         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7762         interfaces too.
7763
7764 2004-11-16  Martin Baulig  <martin@ximian.com>
7765
7766         Merged back from gmcs; these changes already went into gmcs a
7767         couple of weeks ago.
7768
7769         * typemanager.cs
7770         (TypeManager.AddUserType): Removed the `ifaces' argument.
7771         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7772         `TypeExpr []'.
7773         (TypeManager.AddUserInterface): Removed.
7774         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7775         `TypeExpr []'.
7776         (TypeManager.GetInterfaces): Likewise.
7777         (TypeManager.GetExplicitInterfaces): Likewise.
7778
7779         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7780
7781         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7782         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7783
7784 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7785
7786         * statement.cs: Avoid adding bools to a hashtable.
7787
7788 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7789
7790         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7791         calling an unsafe method from a safe location.
7792
7793 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7794
7795         Fix #69167
7796         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7797
7798 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7799
7800         * namespace.cs (VerifyUsing): use GetPartialName instead of
7801         ToString. 
7802
7803 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7804
7805         * statement.cs (Return.Resolve): Fix regression in typo: if
7806         `in_exc', we have to request a NeedReturnLabel, this was a typo
7807         introduced in the anonymous method check-in.  Fixes #69131.
7808
7809         * Indexers were using the ShortName when defining themselves,
7810         causing a regression in the compiler bootstrap when applying the
7811         patch from 2004-11-02 (first part), now they use their full name
7812         and the bug is gone.
7813
7814 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7815
7816         * driver.cs: Strip the path from the names of embedded resources. Fixes
7817         #68519.
7818
7819 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7820
7821         Fix error message regression: cs0104-2.cs.
7822         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7823         (AliasEntry.Resolve): Update.
7824         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7825         'silent' flag.
7826         (RootContext.LookupType): Update.
7827
7828 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7829
7830         * cs-parser.jay: Add support for handling accessor modifiers
7831         * class: Add support port accessor modifiers and error checking,
7832         define PropertyMethod.Define as virtual (not abstract anymore)
7833         * ecore.cs: Add checking for proeprties access with access modifiers
7834         * iterators.cs: Modify Accessor constructor call based in the modified
7835         constructor
7836 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7837
7838         * expression.cs (StringConcat): Handle being called twice,
7839         as when we have a concat in a field init with more than two
7840         ctors in the class
7841
7842 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7843
7844         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7845         special case explicit implementations, we should always produce
7846         the .property or .event declaration.
7847         
7848         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7849         since it will not return correct data if people use this
7850         unresolved in the presence of using statements (see test-313).
7851
7852         * class.cs (MethodData.Define): If we are an explicit interface
7853         implementation, set the method name to the full name of the
7854         interface plus the name of the method.  
7855
7856         Notice that using the method.MethodName.GetFullName() does not
7857         work, as it will only contain the name as declared on the source
7858         file (it can be a shorthand in the presence of using statements)
7859         and not the fully qualifed type name, for example:
7860
7861         using System;
7862
7863         class D : ICloneable {
7864                 object ICloneable.Clone ()  {
7865                 }
7866         }
7867
7868         Would produce a method called `ICloneable.Clone' instead of
7869         `System.ICloneable.Clone'.
7870
7871         * namespace.cs (Alias.Resolve): Use GetPartialName.
7872         
7873 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7874
7875         * cs-parser.jay: Add error 1055 report.
7876
7877 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7878
7879         * assign.cs (Assign.DoResolve): Only do the transform of
7880         assignment into a New if the types are compatible, if not, fall
7881         through and let the implicit code deal with the errors and with
7882         the necessary conversions. 
7883
7884 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7885
7886         * cs-parser.jay: Add error 1031 report.
7887
7888         * cs-tokenizer.cs: Add location for error 1038.
7889
7890 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7891
7892         * cs-parser.jay: Add error 1016 report.
7893
7894 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7895
7896         * cs-parser.jay: Add errors 1575,1611 report.
7897
7898 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7899
7900         * cs-parser.jay: Add error 1001 report.
7901
7902 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7903
7904         Fix #68850
7905         * attribute.cs (GetMarshal): Add method argument for
7906         caller identification.
7907
7908         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7909         agument for GetMarshal and RuntimeMissingSupport.
7910
7911 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7912
7913         * attribute.cs (ExtractSecurityPermissionSet): Removed
7914         TypeManager.code_access_permission_type.
7915
7916         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7917
7918 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7919
7920         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7921         for obsolete use of a variable here.   Fixes regression on errors
7922         cs0619-25 and cs0619-26.
7923
7924 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7925
7926         Fix #62358, implemented security attribute encoding.
7927
7928         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7929         Tests permitted SecurityAction for assembly or other types.
7930         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7931         data from SecurityPermissionAttribute to PermisionSet class.
7932
7933         * class.cs (ApplyAttributeBuilder): Added special handling
7934         for System.Security.Permissions.SecurityAttribute based types.
7935
7936         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7937         special handling for System.Security.Permissions.SecurityAttribute
7938         based types.
7939
7940         * enum.cs (ApplyAttributeBuilder): Added special handling
7941         for System.Security.Permissions.SecurityAttribute based types.
7942
7943         * parameter.cs (ApplyAttributeBuilder): Added special handling
7944         for System.Security.Permissions.SecurityAttribute based types.
7945
7946         * rootcontext.cs: Next 2 core types.
7947
7948         * typemanager.cs (TypeManager.security_permission_attr_type):
7949         Built in type for the SecurityPermission Attribute.
7950         (code_access_permission_type): Build in type.
7951
7952 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7953
7954         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7955         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7956         all of this information into
7957         EmitContext.EmitCapturedVariableInstance.
7958         
7959         * codegen.cs (EmitCapturedVariableInstance): move here the
7960         funcionality of emitting an ldarg.0 in the presence of a
7961         remapping.   This centralizes the instance emit code.
7962
7963         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7964         then emit a load of this: it means that we have reached the
7965         topmost ScopeInfo: the one that contains the pointer to the
7966         instance of the class hosting the anonymous method.
7967
7968         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7969         captures to the topmost CaptureContext.
7970
7971 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7972
7973         * expression.cs (LocalVariableReference): Move the knowledge about
7974         the iterators into codegen's EmitCapturedVariableInstance.
7975
7976 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7977
7978         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7979         all code paths return a value from an anonymous method (it is the
7980         same as the 161 error, but for anonymous methods).
7981
7982 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7983
7984         The introduction of anonymous methods in the compiler changed
7985         various ways of doing things in the compiler.  The most
7986         significant one is the hard split between the resolution phase
7987         and the emission phases of the compiler.
7988
7989         For instance, routines that referenced local variables no
7990         longer can safely create temporary variables during the
7991         resolution phase: they must do so from the emission phase,
7992         since the variable might have been "captured", hence access to
7993         it can not be done with the local-variable operations from the runtime.
7994         
7995         * statement.cs 
7996
7997         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7998         is a toplevel block.
7999
8000         (ToplevelBlock): A new kind of Block, these are the blocks that
8001         are created by the parser for all toplevel method bodies.  These
8002         include methods, accessors and anonymous methods.
8003
8004         These contain some extra information not found in regular blocks:
8005         A pointer to an optional CaptureContext (for tracking captured
8006         local variables and parameters).  A pointer to the parent
8007         ToplevelBlock.
8008         
8009         (Return.Resolve): Catch missmatches when returning a value from an
8010         anonymous method (error 1662).
8011         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8012         phase.
8013
8014         (Break.Resolve): ditto.
8015
8016         (SwitchLabel): instead of defining the labels during the
8017         resolution phase, we now turned the public ILLabel and ILLabelCode
8018         labels into methods called GetILLabelCode() and GetILLabel() that
8019         only define the label during the Emit phase.
8020
8021         (GotoCase): Track the SwitchLabel instead of the computed label
8022         (its contained therein).  Emit the code by using
8023         SwitchLabel.GetILLabelCode ().
8024
8025         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8026         whether the Local has been captured or not.
8027
8028         (LocalInfo.IsCaptured): New property, used to tell whether the
8029         local has been captured.
8030         
8031         * anonymous.cs: Vastly updated to contain the anonymous method
8032         support.
8033
8034         The main classes here are: CaptureContext which tracks any
8035         captured information for a toplevel block and ScopeInfo used to
8036         track the activation frames for various local variables.   
8037
8038         Each toplevel block has an optional capture context associated
8039         with it.  When a method contains an anonymous method both the
8040         toplevel method and the anonymous method will create a capture
8041         context.   When variables or parameters are captured, they are
8042         recorded on the CaptureContext that owns them, for example:
8043
8044         void Demo () {
8045              int a;
8046              MyDelegate d = delegate {
8047                  a = 1;
8048              }
8049         }
8050
8051         Here `a' will be recorded as captured on the toplevel
8052         CapturedContext, the inner captured context will not have anything
8053         (it will only have data if local variables or parameters from it
8054         are captured in a nested anonymous method.
8055
8056         The ScopeInfo is used to track the activation frames for local
8057         variables, for example:
8058
8059         for (int i = 0; i < 10; i++)
8060                 for (int j = 0; j < 10; j++){
8061                    MyDelegate d = delegate {
8062                         call (i, j);
8063                    }
8064                 }
8065
8066         At runtime this captures a single captured variable `i', but it
8067         captures 10 different versions of the variable `j'.  The variable
8068         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8069         recorded on a child.  
8070
8071         The toplevel ScopeInfo will also track information like the `this'
8072         pointer if instance variables were referenced (this is necessary
8073         as the anonymous method lives inside a nested class in the host
8074         type of the method). 
8075
8076         (AnonymousMethod): Expanded to track the Toplevel, implement
8077         `AnonymousMethod.Compatible' to tell whether an anonymous method
8078         can be converted to a target delegate type. 
8079
8080         The routine now also produces the anonymous method content
8081
8082         (AnonymousDelegate): A helper class that derives from
8083         DelegateCreation, this is used to generate the code necessary to
8084         produce the delegate for the anonymous method that was created. 
8085
8086         * assign.cs: API adjustments for new changes in
8087         Convert.ImplicitStandardConversionExists.
8088
8089         * class.cs: Adjustments to cope with the fact that now toplevel
8090         blocks are of type `ToplevelBlock'. 
8091
8092         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8093         insteda of standard blocks.
8094
8095         Flag errors if params arguments are passed to anonymous methods.
8096
8097         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8098         `CurrentAnonymousMethod' which points to the current Anonymous
8099         Method.  The variable points to the AnonymousMethod class that
8100         holds the code being compiled.  It is set in the new EmitContext
8101         created for the anonymous method.
8102
8103         (EmitContext.Phase): Introduce a variable and an enumeration to
8104         assist in enforcing some rules about when and where we are allowed
8105         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8106         only one that enfonces this right now).
8107
8108         (EmitContext.HaveCaptureInfo): new helper method that returns
8109         whether we have a CapturedContext initialized.
8110
8111         (EmitContext.CaptureVariable): New method used to register that a
8112         LocalInfo must be flagged for capturing. 
8113
8114         (EmitContext.CapturedParameter): New method used to register that a
8115         parameters must be flagged for capturing. 
8116         
8117         (EmitContext.CapturedField): New method used to register that a
8118         field must be flagged for capturing. 
8119
8120         (EmitContext.HaveCapturedVariables,
8121         EmitContext.HaveCapturedFields): Return whether there are captured
8122         variables or fields. 
8123
8124         (EmitContext.EmitMethodHostInstance): This is used to emit the
8125         instance for the anonymous method.  The instance might be null
8126         (static methods), this (for anonymous methods that capture nothing
8127         and happen to live side-by-side with the current method body) or a
8128         more complicated expression if the method has a CaptureContext.
8129
8130         (EmitContext.EmitTopBlock): Routine that drives the emission of
8131         code: it will first resolve the top block, then emit any metadata
8132         and then emit the code.  The split is done so that we can extract
8133         any anonymous methods and flag any captured variables/parameters.
8134         
8135         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8136         during this phase, the ILGenerator should not be used as labels
8137         and local variables declared here might not be accessible to any
8138         code that is part of an anonymous method.  
8139
8140         Exceptions to this include the temporary variables that are
8141         created by some statements internally for holding temporary
8142         variables. 
8143         
8144         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8145         metadata for a cb
8146
8147         (EmitContext.TemporaryReturn): This method is typically called
8148         from the Emit phase, and its the only place where we allow the
8149         ReturnLabel to be defined other than the EmitMeta.  The reason is
8150         that otherwise we would have to duplicate a lot of logic in the
8151         Resolve phases of various methods that today is on the Emit
8152         phase. 
8153
8154         (EmitContext.NeedReturnLabel): This no longer creates the label,
8155         as the ILGenerator is not valid during the resolve phase.
8156
8157         (EmitContext.EmitThis): Extended the knowledge in this class to
8158         work in anonymous methods in addition to iterators. 
8159
8160         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8161         code is necessary on the stack to access the instance to a local
8162         variable (the variable will be accessed as a field).
8163
8164         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8165         EmitContext.EmitAddressOfParameter): Routines to support
8166         parameters (not completed at this point). 
8167         
8168         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8169         will also remove the parameters.
8170
8171         * convert.cs (Convert): Define a `ConstantEC' which points to a
8172         null.  This is just to prefity some code that uses
8173         ImplicitStandardConversion code and do not have an EmitContext
8174         handy.
8175
8176         The idea is to flag explicitly that at that point in time, it is
8177         known that the conversion will not trigger the delegate checking
8178         code in implicit conversions (which requires a valid
8179         EmitContext). 
8180
8181         Everywhere: pass new EmitContext parameter since
8182         ImplicitStandardConversionExists now requires it to check for
8183         anonymous method conversions. 
8184
8185         (Convert.ImplicitStandardConversionExists): If the type of an
8186         expression is the anonymous_method_type, and the type is a
8187         delegate, we invoke the AnonymousMethod.Compatible method to check
8188         whether an implicit conversion is possible. 
8189
8190         (Convert.ImplicitConversionStandard): Only do implicit method
8191         group conversions if the language level is not ISO_1.
8192
8193         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8194         MethodInfo for the Invoke method.  used by Delegate and
8195         AnonymousDelegate.
8196
8197         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8198         method conversions if the target type is a delegate.
8199
8200         Removed extra debugging nops.
8201
8202         (LocalVariableReference): Turn the `local_info' into a public
8203         field. 
8204
8205         Add `prepared' field, the same hack used for FieldExprs to cope
8206         with composed assignments, as Local variables do not necessarily
8207         operate purely on the stack as they used to: they can be captured
8208         fields. 
8209
8210         Add `temp' for a temporary result, like fields.
8211
8212         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8213
8214         It now copes with Local variables that are captured and emits the
8215         proper instance variable to load it from a field in the captured
8216         case. 
8217
8218         (ParameterReference.DoResolveBase): During the resolve phase,
8219         capture parameters if we are in an anonymous method.
8220
8221         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8222         anonymous method, use the EmitContext helper routines to emit the
8223         parameter reference.
8224
8225         * iterators.cs: Set RemapToProxy to true/false during the
8226         EmitDispose class.
8227
8228         * parameters.cs (GetParameterByName): New helper method. 
8229
8230         * typemanager.cs (anonymous_method_type) a new type that
8231         represents an anonyous method.  This is always an internal type,
8232         used as a fencepost to test against the anonymous-methodness of an
8233         expression. 
8234         
8235 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8236
8237         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8238         561 report.
8239         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8240
8241 2004-10-18  Martin Baulig  <martin@ximian.com>
8242
8243         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8244         `Type' directly, but call ResolveType() on it.
8245         (Catch.Resolve): Likewise.
8246         (Foreach.Resolve): Likewise.
8247
8248 2004-10-18  Martin Baulig  <martin@ximian.com>
8249
8250         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8251         `Type' directly, but call ResolveType() on it.
8252         (Probe.DoResolve): Likewise.
8253         (ArrayCreation.LookupType): Likewise.
8254         (TypeOf.DoResolve): Likewise.
8255         (SizeOf.DoResolve): Likewise.
8256
8257 2004-10-18  Martin Baulig  <martin@ximian.com>
8258
8259         * expression.cs (Invocation.BetterFunction): Put back
8260         TypeManager.TypeToCoreType().
8261
8262 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8263
8264         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8265         the ResolveType.
8266
8267 2004-10-18  Martin Baulig  <martin@ximian.com>
8268
8269         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
8270         `Type' directly, but call ResolveType() on it.
8271
8272 2004-10-18  Martin Baulig  <martin@ximian.com>
8273
8274         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8275         `Type' directly, but call ResolveType() on it.
8276         (MemberBase.DoDefine): Likewise.
8277
8278         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8279         `Type' directly, but call ResolveType() on it.
8280         (ComposedCast.DoResolveAsTypeStep): Likewise.
8281
8282         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8283         `Type' directly, but call ResolveType() on it.
8284
8285 2004-10-17  John Luke  <john.luke@gmail.com>
8286
8287         * class.cs (Operator.GetSignatureForError): use CSharpName
8288
8289         * parameter.cs (Parameter.GetSignatureForError): Returns
8290         correct name even if was not defined.
8291
8292 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8293
8294         Fix #65816.
8295         * class.cs (TypeContainer.EmitContext): New property.
8296         (DefineNestedTypes): Create an emitcontext for each part.
8297         (MethodCore.DoDefineParameters): Use container's emitcontext.
8298         Pass type array to InternalParameters.
8299         (MemberBase.DoDefine): Use container's emitcontext.
8300         (FieldMember.Define): Likewise.
8301         (Event.Define): Likewise.
8302         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8303         Pass type array to InternalParameters.
8304         (SetIndexerMethod.GetParameterInfo): Likewise.
8305         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8306         * delegate.cs (Define): Pass emitcontext to
8307         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8308         array to InternalParameters.
8309         * expression.cs (ParameterReference.DoResolveBase): Pass
8310         emitcontext to GetParameterInfo.
8311         (ComposedCast.DoResolveAsTypeStep): Remove check on
8312         ec.ResolvingTypeTree.
8313         * parameter.cs (Parameter.Resolve): Change argument to
8314         EmitContext.  Use ResolveAsTypeTerminal.
8315         (Parameter.GetSignature): Change argument to EmitContext.
8316         (Parameters.ComputeSignature): Likewise.
8317         (Parameters.ComputeParameterTypes): Likewise.
8318         (Parameters.GetParameterInfo): Likewise.
8319         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8320         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8321         * support.cs (InternalParameters..ctor): Remove variant that takes
8322         a DeclSpace.
8323         * typemanager.cs (system_intptr_expr): New.
8324         (InitExpressionTypes): Initialize it.
8325
8326 2004-10-12  Chris Toshok  <toshok@ximian.com>
8327
8328         * cs-parser.jay: fix location for try_statement and catch_clause.
8329
8330 2004-10-11  Martin Baulig  <martin@ximian.com>
8331
8332         * report.cs: Don't make --fatal abort on warnings, we have
8333         -warnaserror for that.
8334
8335 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8336
8337         More DeclSpace.ResolveType avoidance.
8338         * decl.cs (MemberCore.InUnsafe): New property.
8339         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8340         with newly created EmitContext.
8341         (FieldMember.Define): Likewise.
8342         * delegate.cs (Delegate.Define): Likewise.
8343         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8344         only if normal name-lookup fails.
8345         (TypeExpr.DoResolve): Enable error-checking.
8346         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8347         (SizeOf.DoResolve): Likewise.
8348         (ComposedCast.DoResolveAsTypeStep): Likewise.
8349         (StackAlloc.DoResolve): Likewise.
8350         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8351         (Block.Unsafe): New property.
8352         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8353         (Unsafe): Set 'unsafe' flag of contained block.
8354         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8355         (Fixed.Resolve): Likewise.
8356         (Catch.Resolve): Likewise.
8357         (Using.ResolveLocalVariableDecls): Likewise.
8358         (Foreach.Resolve): Likewise.
8359
8360 2004-10-05  John Luke <john.luke@gmail.com>
8361
8362         * cs-parser.jay: add location to error CS0175
8363
8364 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8365
8366         * ecore.cs (Expression.Constantity): Add support for turning null
8367         into a constant.
8368
8369         * const.cs (Const.Define): Allow constants to be reference types
8370         as long as the value is Null.
8371
8372 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8373
8374         * namespace.cs (NamespaceEntry.Using): No matter which warning
8375         level is set, check if this namespace name has already been added.
8376
8377 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8378
8379         * expression.cs: reftype [!=]= null should always use br[true,false].
8380         # 67410
8381
8382 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8383
8384         Fix #67108
8385         * attribute.cs: Enum conversion moved to 
8386         GetAttributeArgumentExpression to be applied to the all
8387         expressions.
8388
8389 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8390
8391         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8392         * class.c (TypeContainer.DefineType): Flag error if
8393         base types aren't accessible due to access permissions.
8394         * decl.cs (DeclSpace.ResolveType): Move logic to
8395         Expression.ResolveAsTypeTerminal.
8396         (DeclSpace.ResolveTypeExpr): Thin layer over
8397         Expression.ResolveAsTypeTerminal.
8398         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8399         Refactor code into NestedAccess.  Use it.
8400         (DeclSpace.NestedAccess): New.
8401         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8402         argument to silence errors.  Check access permissions.
8403         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8404         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8405         (Cast.DoResolve): Likewise.
8406         (New.DoResolve): Likewise.
8407         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8408         (TypeOf.DoResolve): Likewise.
8409
8410         * expression.cs (Invocation.BetterConversion): Return the Type of
8411         the better conversion.  Implement section 14.4.2.3 more faithfully.
8412         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8413         section 14.4.2.2 explicit.
8414         (Invocation.OverloadResolve): Update.
8415         (Invocation): Remove is_base field.
8416         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8417         (Invocation.Emit): Likewise.
8418
8419 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8420
8421         * README: Update to changes.
8422
8423 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8424
8425         * cs-parser.jay: Reverted 642 warning fix.
8426
8427 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8428
8429         Fix bug #66615
8430         * decl.cs (FindMemberWithSameName): Indexer can have more than
8431         1 argument.
8432
8433 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8434
8435         * expression.cs (LocalVariableReference.DoResolveLValue):
8436         Do not report warning 219 for out values.
8437         (EmptyExpression.Null): New member to avoid extra allocations.
8438
8439 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8440
8441         * cs-parser.jay: Fix wrong warning 642 report.
8442
8443         * cs-tokenizer.cs (CheckNextToken): New helper;
8444         Inspect next character if is same as expected.
8445
8446 2004-09-23  Martin Baulig  <martin@ximian.com>
8447
8448         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8449         (Convert.ImplicitReferenceConversionExists): Likewise.
8450
8451 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8452
8453         * class.cs (Operator.Define): Add error 448 and 559 report.
8454
8455 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8456
8457         * class.cs (MemberBase.IsTypePermitted): New protected
8458         method for checking error CS0610.
8459
8460 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8461
8462         * class.cs (TypeContainer.HasExplicitLayout): New property
8463         Returns whether container has StructLayout attribute set Explicit.
8464         (FieldMember): New abstract class for consts and fields.
8465         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8466         (Field): Reuse FieldMember.
8467
8468         * const.cs (Const): Reuse FieldMember.
8469
8470         * rootcontext.cs: EmitConstants call moved to class.
8471
8472 2004-09-22  Martin Baulig  <martin@ximian.com>
8473
8474         Thanks to Peter Sestoft for this bug report.
8475
8476         * expression.cs (Conditional): If both the `trueExpr' and the
8477         `falseExpr' is a NullLiteral, return a NullLiteral.
8478
8479 2004-09-22  Martin Baulig  <martin@ximian.com>
8480
8481         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8482         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8483         for the "get_Current" call.
8484
8485 2004-09-22  Martin Baulig  <martin@ximian.com>
8486
8487         Marek and me just fixed one of our oldest bugs: #28562 :-)
8488
8489         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8490
8491         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8492         we're an EnumConstant, just return that.
8493         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8494         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8495         to get the value which'll actually be written into the attribute.
8496         However, we have to use GetValue() to access the attribute's value
8497         in the compiler.        
8498
8499 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8500
8501         * constant.cs (Constant.IsNegative): New abstract property
8502         IsNegative.
8503
8504         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8505         (StackAlloc.DoResolve): Reused IsNegative.
8506
8507 2004-09-21  Martin Baulig  <martin@ximian.com>
8508
8509         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8510         if we're used in an iterator, we may be called from different
8511         methods.
8512
8513         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8514         we actually have an exception block.
8515
8516 2004-09-20  John Luke <jluke@cfl.rr.com>
8517
8518         * class.cs, cs-parser.jay: Improve the error report for 1520:
8519         report the actual line where the error happens, not where the
8520         class was declared.
8521
8522         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8523         Pass location information that was available elsewhere.
8524
8525 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8526
8527         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8528         runtime to delay sign assemblies.
8529
8530 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8531
8532         * cs-parser.jay: Do not report the stack trace, this is barely
8533         used nowadays.
8534
8535 2004-08-22  John Luke  <john.luke@gmail.com>
8536  
8537         * driver.cs : check that a resource id is not already used
8538         before adding it, report CS1508 if it is, bug #63637
8539
8540 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8541
8542         * ecore.cs: Removed dead code.
8543
8544 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8545
8546         * class.cs: Do not report warning CS0067 on the interfaces.
8547
8548 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8549
8550         * cs-parser.jay: Add error 504 report.
8551
8552 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8553
8554         * rootcontext.cs: WarningLevel is 4 by default now.
8555
8556         * statement.cs (Fixed.Resolve): Do not null
8557         VariableInfo.
8558
8559 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8560
8561         Fixed bug #55780
8562         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8563         deep search when property is not virtual.
8564         (PropertyExpr.ResolveAccessors): Make one call for both
8565         accessors.
8566
8567 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8568
8569         Fixed bug #65766
8570         * statement.cs: Error 152 report constains also location.
8571
8572 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8573
8574         Fixed bug #65766
8575         * const.cs: Explicitly set constant as static.
8576
8577 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8578
8579         Fixed bug #64226
8580         * cs-parser.jay: Add error 1017 report.
8581
8582 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8583
8584         Fixed bug #59980, #64224
8585         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8586
8587         * typemanager.cs (IsSpecialMethod): Simplified
8588
8589 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8590
8591         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8592         condition with better params.
8593
8594 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8595
8596         Fixed bug #65238
8597         * attribute.cs (Resolve): Property has to have both
8598         accessors.
8599
8600 2004-09-14  Martin Baulig  <martin@ximian.com>
8601
8602         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8603
8604 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8605
8606         Fixed bug #61902
8607         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8608         called and is obsolete then this member suppress message
8609         when call is inside next [Obsolete] method or type.
8610
8611         * expression.cs: Use TestObsoleteMethodUsage member.
8612
8613 2004-09-14  Martin Baulig  <martin@ximian.com>
8614
8615         * cs-parser.jay: Sync a bit with the GMCS version.
8616
8617 2004-09-14  Martin Baulig  <martin@ximian.com>
8618
8619         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8620         (CSharpParser.yacc_verbose_flag): New public field.
8621
8622         * genericparser.cs: Removed.
8623
8624 2004-09-14  Raja R Harinath  <rharinath@novell.com>
8625
8626         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8627
8628 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8629
8630         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8631
8632 2004-09-10  Martin Baulig  <martin@ximian.com>
8633
8634         Backported my MemberName changes from GMCS into MCS.
8635
8636         - we are now using a special `MemberName' class instead of using
8637         strings; in GMCS, the `MemberName' also contains the type
8638         arguments.
8639
8640         - changed the grammar rules a bit:
8641           * the old `member_name' is now a `namespace_or_type_name':
8642             The rule is that we use `namespace_or_type_name' everywhere
8643             where we expect either a "member name" (GetEnumerator) or a
8644             "member name" with an explicit interface name
8645             (IEnumerable.GetEnumerator).
8646             In GMCS, the explicit interface name may include type arguments
8647             (IEnumerable<T>.GetEnumerator).
8648           * we use `member_name' instead of just `IDENTIFIER' for
8649             "member names":
8650             The rule is that we use `member_name' wherever a member may
8651             have type parameters in GMCS.       
8652
8653         * decl.cs (MemberName): New public class.
8654         (MemberCore.MemberName): New public readonly field.
8655         (MemberCore.ctor): Take a `MemberName' argument, not a string.
8656         (DeclSpace): Likewise.
8657
8658         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8659         * enum.cs (Enum.ctor): Likewise.
8660
8661         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8662         MemberName.     
8663         (AliasEntry.ctor): Take a MemberName, not an Expression.
8664         (AliasEntry.UsingAlias): Likewise.
8665
8666         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8667         (IMethodData.MemberName): Changed type from string to MemberName.
8668         (MemberBase.ExplicitInterfaceName): Likewise.
8669         (AbstractPropertyEventMethod.SetupName): Make this private.
8670         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8671         argument; compute the member name here.
8672         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8673         on the `member.MemberName' and the `prefix'.
8674
8675         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8676         not `type_name'.
8677         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8678         thus, we get a `MemberName' instead of a `string'.  These
8679         declarations may have type parameters in GMCS.
8680         (interface_method_declaration, delegate_declaration): Likewise.
8681         (class_declaration, interface_declaration): Likewise.
8682         (method_header): Use `namespace_or_type_name' instead of
8683         `member_name'.  We may be an explicit interface implementation.
8684         (property_declaration, event_declaration): Likewise.
8685         (member_name): This is now just an `IDENTIFIER', not a
8686         `namespace_or_type_name'.
8687         (type_name, interface_type): Removed.
8688         (namespace_or_type_name): Return a MemberName, not an Expression.
8689         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8690         call GetTypeExpression() on the MemberName to get an expression.
8691         (IndexerDeclaration.interface_type): Changed type from string to
8692         MemberName.
8693         (MakeName): Operate on MemberName's instead of string's.
8694
8695 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8696
8697         Fix bug #55770.
8698         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8699         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8700         lookup to avoid symbols introduced by 'using'.
8701         * rootcontext.cs (NamespaceLookup): Update.
8702
8703 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8704
8705         * class.cs (TypeContainer.DoDefineMembers): Do not call
8706         DefineDefaultConstructor for static classes.
8707
8708 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8709
8710         * attribute.cs (Attribute.Resolve): Add error 653 report.
8711
8712         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8713         report.
8714         (Method.ApplyAttributeBuilder): Add error 685 report.
8715         (Operator.Define): Add error 564 report.
8716
8717         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8718
8719         * expression.cs (Invocation.DoResolve): Add error
8720         245 and 250 report.
8721
8722         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8723         error 674 report.
8724
8725 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8726
8727         * class.cs (ConstructorInitializer.Resolve):
8728         Wrong error number (515->516).
8729
8730 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8731
8732         * class.cs (Indexer.Define): Add error 631 report.
8733
8734 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8735
8736         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8737
8738 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8739
8740         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8741
8742 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8743
8744         * cs-parser.jay: Added error CS0241 report.
8745
8746 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8747
8748         * cs-parser.jay (fixed_statement): Introduce a scope for the
8749         declaration in the 'fixed' statement.
8750
8751 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8752
8753         * cs-parser.jay: Added CS0230 error report.
8754
8755 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8756
8757         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8758
8759 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8760
8761         * expression.cs (Argument.Resolve): Added error CS0192 and
8762         CS0199 report.
8763
8764 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8765
8766         C# 2.0 #pragma warning feature
8767
8768         * cs-tokenizer.cs (PreProcessPragma): New method; 
8769         Handles #pragma directive.
8770
8771         * report.cs (WarningRegions): New class; Support
8772         class for #pragma warning directive. It tests whether
8773         warning is enabled for a given line.
8774
8775 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8776
8777         * const.cs: Add more descriptive error report, tahnks to
8778         Sebastien. 
8779
8780 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8781
8782         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8783
8784 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8785
8786         * expression.cs: Apply patch from Ben: Remove dead code from
8787         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8788         as that code just threw an exception anwyays.
8789
8790         * const.cs: Remove the call to the turnintoconstant, for details
8791         see bug: #63144
8792         
8793         * literal.cs: The type of the null-literal is the null type;  So
8794         we use a placeholder type (literal.cs:System.Null, defined here)
8795         for it.
8796
8797         * expression.cs (Conditional.DoResolve): Remove some old code that
8798         is no longer needed, conversions have been fixed.
8799
8800         (ArrayCreationExpression.DoResolve): Return false if we fail to
8801         resolve the inner expression.
8802
8803 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8804
8805         Fix test-290.cs.
8806         * cs-parser.jay (delegate_declaration): Record a delegate
8807         declaration as a type declaration.
8808         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8809
8810 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8811
8812         * parameter.cs: Do not crash if the type can not be resolved. 
8813
8814         * expression.cs: Report errors with unsafe pointers, fixes #64896
8815
8816 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8817
8818         * expression.cs: Pointer arith always needs to do a conv.i
8819         if the operand is a long. fix 65320
8820
8821 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8822
8823         Fixed cs0619-37.cs, cs0619-38.cs
8824
8825         * enum.cs (GetObsoleteAttribute): Removed.
8826
8827         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8828         on Enum member is double staged. The first is tested member
8829         and then enum.
8830
8831 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8832
8833         Fixed #56986, #63631, #65231
8834
8835         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8836         adds member to name container.
8837         (TypeContainer.AddToTypeContainer): New method, adds type to
8838         name container.
8839         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8840         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8841         AddOperator): Simplified by reusing AddToMemberContainer.
8842         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8843         instead of field.
8844         (Method.CheckForDuplications): Fixed implementation to test all
8845         possibilities.
8846         (MemberBase): Detection whether member is explicit interface
8847         implementation is now in constructor.
8848         (MemberBase.UpdateMemberName): Handles IndexerName.
8849         (Accessor): Changed to keep also location information.
8850         (AbstractPropertyEventMethod): Is derived from MemberCore.
8851         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8852         will be emited or not.
8853         (PropertyBase.AreAccessorsDuplicateImplementation):
8854         Tests whether accessors are not in collision with some method.
8855         (Operator): Is derived from MethodCore to simplify common
8856         operations.
8857
8858         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8859         must be performed.
8860         (DeclSpace.AddToContainer): Adds the member to defined_names
8861         table. It tests for duplications and enclosing name conflicts.
8862
8863         * enum.cs (EnumMember): Clean up to reuse the base structures
8864
8865 2004-09-03  Martin Baulig  <martin@ximian.com>
8866
8867         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8868         into TypeContainer, to make partial classes work again.
8869
8870 2004-09-03  Martin Baulig  <martin@ximian.com>
8871
8872         * rootcontext.cs (RootContext.V2): Removed.
8873
8874 2004-03-23  Martin Baulig  <martin@ximian.com>
8875
8876         * expression.cs (Invocation.OverloadResolve): Added `bool
8877         may_fail' argument and use it instead of the Location.IsNull() hack.
8878
8879 2004-09-03  Martin Baulig  <martin@ximian.com>
8880
8881         Merged latest changes into gmcs.  Please keep this comment in
8882         here, it makes it easier for me to see what changed in MCS since
8883         the last time I merged.
8884
8885 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8886
8887         Fix #61128.
8888         * expression.cs (BetterConversion): Don't allow either conversion 
8889         to be null.  Remove redundant implicit conversion test when 'q ==
8890         null' -- when this function is invoked, we already know that the
8891         implicit conversion exists.
8892         (BetterFunction): Assume that 'best' is non-null.  Remove
8893         redundant reimplementation of IsApplicable when 'best' is null.
8894         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8895         number of arguments.
8896         (IsAncestralType): Extract from OverloadResolve.
8897         (OverloadResolve): Make robust to the MethodGroupExpr being
8898         unsorted.  Implement all the logic of Section 14.5.5.1, and
8899         support overloading of methods from multiple applicable types.
8900         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8901
8902         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8903         (RealError, Warning): Append type of report to related symbol.
8904
8905 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8906
8907         * enum.cs: Fixed CLS-Compliance checks for enum members.
8908         Error tests cs3008-8.cs, cs3014-8.cs
8909
8910 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8911
8912         Fixed bug #62342, #63102
8913         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8914         like ImplementMethod.
8915
8916 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8917
8918         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8919         Fixed bug #65170.
8920
8921 2004-09-02  Martin Baulig  <martin@ximian.com>
8922
8923         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8924         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8925         on the MethodBase.
8926
8927 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8928
8929         C# 2.0 Static classes implemented
8930
8931         * class.cs (TypeContainer): instance_constructors,
8932         initialized_fields, initialized_static_fields,
8933         default_constructor, base_inteface_types are protected to be
8934         accessible from StaticClass.
8935         (TypeContainer.DefineDefaultConstructor): New virtual method
8936         for custom default constructor generating
8937         (StaticClass): New class to handle "Static classes" feature.
8938
8939         * cs-parser.jay: Handle static keyword on class like instance
8940         of StaticClass.
8941
8942         * driver.cs: Added "/langversion" command line switch with two
8943         options (iso-1, default).
8944
8945 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8946
8947         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8948
8949 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8950
8951         * delegate.cs: Style.
8952
8953 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8954
8955         * delegate.cs: Add seperate instance expr field for miguel.
8956
8957 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8958
8959         * PointerArithmetic (Resolve): make sure we are not doing
8960         pointer arith on void*. Also, make sure we are resolved
8961         by not setting eclass until resolve.
8962
8963         All callers: Make sure that PointerArithmetic gets resolved.
8964
8965 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8966
8967         * ArrayCreation (LookupType): If the type does not resolve 
8968         to an array, give an error.
8969
8970 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8971
8972         * statement.cs (Try.Resolve): Fixed bug #64222
8973
8974 2004-08-27  Martin Baulig  <martin@ximian.com>
8975
8976         * class.cs
8977         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8978         crash here.     
8979
8980 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8981
8982         * ecore.cs (Constantify): Get underlying type via
8983         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8984         Windows in special cases.
8985
8986 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8987
8988         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8989         for obtaining also private methods.
8990         (GetRemoveMethod): Used GetRemoveMethod (true)
8991         for obtaining also private methods.
8992
8993 2004-08-24  Martin Baulig  <martin@ximian.com>
8994
8995         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8996         MethodAttributes.HideBySig for operators.
8997
8998 2004-08-23  Martin Baulig  <martin@ximian.com>
8999
9000         Back to the old error reporting system :-)
9001
9002         * report.cs (Message): Removed.
9003         (Report.MessageData, ErrorData, WarningData): Removed.
9004         (Report.Error, Warning): Back to the old system.
9005
9006 2004-08-23  Martin Baulig  <martin@ximian.com>
9007
9008         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9009
9010         * class.cs (TypeContainer.ParentContainer): New public virtual
9011         method; replaces the explicit interface implementation.
9012         (ClassPart.ParentContainer): Override.
9013
9014 2004-08-23  Martin Baulig  <martin@ximian.com>
9015
9016         * statement.cs (Switch): Added support for constant switches; see
9017         #59428 or test-285.cs.
9018
9019 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9020
9021         Fixed bug #62740.
9022         * statement.cs (GetEnumeratorFilter): Removed useless
9023         logic because C# specs is strict. GetEnumerator must be
9024         public.
9025
9026 2004-08-22  Martin Baulig  <martin@ximian.com>
9027
9028         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9029         a switch and may break, reset the barrier.  Fixes #59867.
9030
9031 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9032
9033         CLS-Compliance speed up (~5% for corlib)
9034
9035         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9036         New method. Tests container for CLS-Compliant names
9037
9038         * class.cs (TypeContainer.VerifyClsName): New method.
9039         Checks whether container name is CLS Compliant.
9040         (Constructor): Implements IMethodData.
9041
9042         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9043         low-case table for CLS Compliance test.
9044         (MemberCache.VerifyClsParameterConflict): New method.
9045         Checks method parameters for CS3006 error.
9046
9047         * enum.cs (EnumMember): Is derived from MemberCore.
9048         (Enum.VerifyClsName): Optimized for better performance.
9049
9050 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9051
9052         * report.cs: Renamed Error_T to Error and changed all
9053         references.
9054
9055 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9056
9057         * class.cs (TypeContainer.IndexerArrayList): New inner class
9058         container for indexers.
9059         (TypeContainer.DefaultIndexerName): New constant for default
9060         indexer name. Replaced all "Item" with this constant.
9061         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9062
9063         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9064         DefaultMemberAttribute constructor.
9065
9066 2004-08-05  Martin Baulig  <martin@ximian.com>
9067
9068         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9069         Fix bug #59429.
9070
9071 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9072
9073         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9074         multi platforms problem.
9075
9076         * compiler.csproj: Included shared files.
9077
9078 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9079
9080         Fix bug 60333, 55971 in the more general way
9081         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9082         Added arg_type argument for constant conversion.
9083         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9084
9085 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9086
9087         Fix bug #59760
9088         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9089         OperatorArrayList, MethodCoreArrayList for typecontainer
9090         containers. Changed class member types to these new types.
9091         (MethodArrayList.DefineMembers): Added test for CS0659.
9092
9093 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9094
9095         * cfold.cs: Synchronize the folding with the code in expression.cs
9096         Binary.DoNumericPromotions for uint operands.
9097
9098         * attribute.cs: Revert patch from Raja, it introduced a regression
9099         while building Blam-1.2.1 (hard to isolate a test case).
9100
9101 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9102
9103         Fix for #55382
9104         * class.cs:
9105         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9106         name collision.
9107         (MethodCore.parent_method): New member. The method we're overriding
9108         if this is an override method.
9109         (MethodCore.CheckBase): Moved from Method class and made common.
9110         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9111         private.
9112         (MethodCore.CheckForDuplications): New abstract method. For custom
9113         member duplication search in a container
9114         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9115         method and its return type.
9116         (Event.conflict_symbol): New member. Symbol with same name in the
9117         parent class.
9118
9119         * decl.cs:
9120         (MemberCache.FindMemberWithSameName): New method. The method
9121         is looking for conflict with inherited symbols.
9122
9123 2004-08-04  Martin Baulig  <martin@ximian.com>
9124
9125         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9126
9127         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9128
9129 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9130
9131         * report.cs (Message): New enum for better error, warning reference in
9132         the code.
9133         (MessageData): New inner abstract class. It generally handles printing of
9134         error and warning messages.
9135         Removed unused Error, Warning, Message methods.
9136
9137 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9138
9139         Fix for cs0592-8.cs test
9140         * attribute.cs
9141         (Attributable.ValidAttributeTargets): Made public.
9142         (Attribute.ExplicitTarget): New member for explicit target value.
9143         (Attribute.CheckTargets): Now we translate explicit attribute
9144         target to Target here.
9145
9146 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9147
9148         * ecore.cs (MethodGroupExpr): new IsBase property.
9149
9150         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9151
9152         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9153         rather than an instance expr.
9154
9155         (DelegateCreation.Emit): Use the method group rather than
9156         the instance expression. Also, if you have base.Foo as the
9157         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9158
9159         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9160
9161         (NewDelegate.DoResolve): Only check for the existance of Invoke
9162         if the method is going to be needed. Use MethodGroupExpr.
9163
9164         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9165
9166         * expression.cs: For pointer arith., make sure to use
9167         the size of the type, not the size of the pointer to
9168         the type.
9169
9170 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9171
9172         Fix for #60722
9173         * class.cs (Class): Added error CS0502 test.
9174
9175 2004-08-03  John Luke  <jluke@cfl.rr.com>
9176             Raja R Harinath  <rharinath@novell.com>
9177
9178         Fix for #60997.
9179         * attribute.cs (Attribute.complained_before): New flag.
9180         (Attribute.ResolveType, Attribute.Resolve),
9181         (Attribute.DefinePInvokeMethod): Set it.
9182         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9183         
9184 2004-08-03  Martin Baulig  <martin@ximian.com>
9185
9186         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9187         use a user-defined operator; we still need to do numeric
9188         promotions in case one argument is a builtin type and the other
9189         one has an implicit conversion to that type.  Fixes #62322.
9190
9191 2004-08-02  Martin Baulig  <martin@ximian.com>
9192
9193         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9194         (LocalInfo.IsThis): New public property.
9195         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9196
9197 2004-08-01  Martin Baulig  <martin@ximian.com>
9198
9199         * class.cs (TypeContainer.GetClassBases): Don't set the default
9200         here since we may get called from GetPartialBases().
9201         (TypeContainer.DefineType): If GetClassBases() didn't return a
9202         parent, use the default one.
9203
9204 2004-07-30  Duncan Mak  <duncan@ximian.com>
9205
9206         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9207
9208 2004-07-30  Martin Baulig  <martin@ximian.com>
9209
9210         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9211
9212         * class.cs (SourceMethod): New public class, derive from the
9213         symbol writer's ISourceMethod.
9214         (Method): Use the new symbol writer API.
9215
9216         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9217         as argument and use the new symbol writer.
9218
9219         * location.cs
9220         (SourceFile): Implement the symbol writer's ISourceFile.
9221         (Location.SymbolDocument): Removed.
9222         (Location.SourceFile): New public property.
9223
9224         * symbolwriter.cs: Use the new symbol writer API.
9225
9226 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9227
9228         * Makefile (install-local): Remove.  Functionality moved to
9229         executable.make.
9230
9231 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9232
9233         * Makefile: Install mcs.exe.config file together with mcs.exe.
9234         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9235         correct runtime version.
9236         
9237 2004-07-25  Martin Baulig  <martin@ximian.com>
9238
9239         * class.cs
9240         (TypeContainer.RegisterOrder): Removed, this was unused.
9241         (TypeContainer, interface_order): Removed.
9242         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9243         TypeContainer as argument since we can also be called with a
9244         `PartialContainer' for a partial class/struct/interface.
9245         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9246         of checking whether we're an `Interface' - we could be a
9247         `PartialContainer'.
9248         (PartialContainer.Register): Override; call
9249         AddClass()/AddStruct()/AddInterface() on our parent.
9250
9251         * cs-parser.jay (interface_member_declaration): Add things to the
9252         `current_container', not the `current_class'.
9253
9254         * rootcontext.cs (RegisterOrder): The overloaded version which
9255         takes an `Interface' was unused, removed.
9256
9257         * typemanager.cs (TypeManager.LookupInterface): Return a
9258         `TypeContainer', not an `Interface'.
9259         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9260         contain a `PartialContainer' for an interface, so check it's
9261         `Kind' to figure out what it is.
9262
9263 2004-07-25  Martin Baulig  <martin@ximian.com>
9264
9265         * class.cs (Class.DefaultTypeAttributes): New public constant.
9266         (Struct.DefaultTypeAttributes): Likewise.
9267         (Interface.DefaultTypeAttributes): Likewise.
9268         (PartialContainer.TypeAttr): Override this and add the
9269         DefaultTypeAttributes.
9270
9271 2004-07-25  Martin Baulig  <martin@ximian.com>
9272
9273         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9274         we can just use the `Parent' field instead.
9275
9276 2004-07-25  Martin Baulig  <martin@ximian.com>
9277
9278         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9279
9280 2004-07-25  Martin Baulig  <martin@ximian.com>
9281
9282         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9283         our parts before defining any methods.
9284         (TypeContainer.VerifyImplements): Make this virtual.
9285         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9286         on our PartialContainer.
9287
9288 2004-07-25  Martin Baulig  <martin@ximian.com>
9289
9290         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9291
9292         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9293         argument, we can just use the `Parent' field instead.
9294
9295         * class.cs
9296         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9297         (MemberBase.DoDefine): Likewise.
9298
9299 2004-07-24  Martin Baulig  <martin@ximian.com>
9300
9301         * decl.cs (MemberCore.Parent): New public field.
9302         (DeclSpace.Parent): Moved to MemberCore.
9303
9304         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9305         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9306         parent's .ctor.
9307         (FieldBase, Field, Operator): Likewise.
9308         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9309         (EventField, Event): Likewise.
9310
9311 2004-07-23  Martin Baulig  <martin@ximian.com>
9312
9313         * class.cs (PartialContainer): New public class.
9314         (ClassPart): New public class.
9315         (TypeContainer): Added support for partial classes.
9316         (TypeContainer.GetClassBases): Splitted some of the functionality
9317         out into GetNormalBases() and GetPartialBases().
9318
9319         * cs-tokenizer.cs (Token.PARTIAL): New token.
9320         (Tokenizer.consume_identifier): Added some hacks to recognize
9321         `partial', but only if it's immediately followed by `class',
9322         `struct' or `interface'.
9323
9324         * cs-parser.jay: Added support for partial clases.
9325
9326 2004-07-23  Martin Baulig  <martin@ximian.com>
9327
9328         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9329         a `DeclSpace' and also made it readonly.
9330         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9331         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9332         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9333
9334         * cs-parser.jay: Pass the `current_class', not the
9335         `current_container' (at the moment, this is still the same thing)
9336         to a new Method, Property, Event, Indexer or Constructor.
9337
9338 2004-07-23  Martin Baulig  <martin@ximian.com>
9339
9340         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9341         and removed the `current_interface' one.
9342         (struct_declaration, class_declaration, interface_declaration):
9343         Set `current_class' to the newly created class/struct/interface;
9344         set their `Bases' and call Register() before parsing their body.
9345
9346 2004-07-23  Martin Baulig  <martin@ximian.com>
9347
9348         * class.cs (Kind): New public enum.
9349         (TypeContainer): Made this class abstract.
9350         (TypeContainer.Kind): New public readonly field.
9351         (TypeContainer.CheckDef): New public method; moved here from
9352         cs-parser.jay.
9353         (TypeContainer.Register): New public abstract method.
9354         (TypeContainer.GetPendingImplementations): New public abstract
9355         method.
9356         (TypeContainer.GetClassBases): Removed the `is_class' and
9357         `is_iface' parameters.
9358         (TypeContainer.DefineNestedTypes): Formerly known as
9359         DoDefineType().
9360         (ClassOrStruct): Made this class abstract.
9361
9362         * tree.cs (RootTypes): New public type. 
9363
9364 2004-07-20  Martin Baulig  <martin@ximian.com>
9365
9366         * tree.cs (Tree.RecordNamespace): Removed.
9367         (Tree.Namespaces): Removed.
9368
9369         * rootcontext.cs (RootContext.IsNamespace): Removed.
9370
9371         * cs-parser.jay (namespace_declaration): Just create a new
9372         NamespaceEntry here.
9373
9374 2004-07-20  Martin Baulig  <martin@ximian.com>
9375
9376         * statement.cs (ExceptionStatement): New abstract class.  This is
9377         now used as a base class for everyone who's using `finally'.
9378         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9379         our local variables before using them.
9380
9381         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9382         virtual method.  This is used by Yield.Resolve() to "steal" an
9383         outer block's `finally' clauses.
9384         (FlowBranchingException): The .ctor now takes an ExceptionStatement
9385         argument.
9386
9387         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9388         version which takes an ExceptionStatement.  This version must be
9389         used to create exception branchings.
9390
9391         * iterator.cs
9392         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9393         (Iterator.EmitMoveNext): Added exception support; protect the
9394         block with a `fault' clause, properly handle 'finally' clauses.
9395         (Iterator.EmitDispose): Run all the `finally' clauses here.
9396
9397 2004-07-20  Martin Baulig  <martin@ximian.com>
9398
9399         * iterator.cs: This is the first of a set of changes in the
9400         iterator code.  Match the spec more closely: if we're an
9401         IEnumerable, then GetEnumerator() must be called.  The first time
9402         GetEnumerator() is called, it returns the current instance; all
9403         subsequent invocations (if any) must create a copy.
9404
9405 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9406
9407         * expression.cs: Resolve the constant expression before returning
9408         it. 
9409
9410 2004-07-19  Martin Baulig  <martin@ximian.com>
9411
9412         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9413         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9414         the return type of the new EmitContext.
9415
9416 2004-07-18  Martin Baulig  <martin@ximian.com>
9417
9418         * class.cs (Property.Define): Fix iterators.
9419
9420         * iterators.cs (Iterator.Define): Moved the
9421         `container.AddInterator (this)' call here from the .ctor; only do
9422         it if we resolved successfully.
9423
9424 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9425
9426         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9427         `true' for preprocessing directives that we parse.  The return
9428         value indicates whether we should return to regular tokenizing or
9429         not, not whether it was parsed successfully.
9430
9431         In the past if we were in: #if false ... #line #endif, we would
9432         resume parsing after `#line'.  See bug 61604.
9433
9434         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9435         building: IsEnumType should return true only for enums, not for
9436         enums or System.Enum itself.  This fixes #61593.
9437
9438         Likely what happened is that corlib was wrong: mcs depended on
9439         this bug in some places.  The bug got fixed, we had to add the
9440         hack, which caused bug 61593.
9441
9442         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9443         that was a workaround for the older conditions.
9444
9445 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9446
9447         * assign.cs: IAssignMethod has a new interface, as documented
9448         inline. All assignment code now uses this new api.
9449
9450         * ecore.cs, expression.cs: All classes which implement
9451         IAssignMethod now use the new interface.
9452
9453         * expression.cs (Invocation): add a hack to EmitCall so that
9454         IndexerAccess can be the target of a compound assignment without
9455         evaluating its arguments twice.
9456
9457         * statement.cs: Handle changes in Invocation api.
9458
9459 2004-07-16  Martin Baulig  <martin@ximian.com>
9460
9461         * iterators.cs: Rewrote this.  We're now using one single Proxy
9462         class for both the IEnumerable and the IEnumerator interface and
9463         `Iterator' derives from Class so we can use the high-level API.
9464
9465         * class.cs (TypeContainer.AddIterator): New method.
9466         (TypeContainer.DoDefineType): New protected virtual method, which
9467         is called from DefineType().
9468         (TypeContainer.DoDefineMembers): Call DefineType() and
9469         DefineMembers() on all our iterators.
9470         (TypeContainer.Emit): Call Emit() on all our iterators.
9471         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9472
9473         * codegen.cs (EmitContext.CurrentIterator): New public field.
9474
9475 2004-07-15  Martin Baulig  <martin@ximian.com>
9476
9477         * typemanager.cs
9478         (TypeManager.not_supported_exception_type): New type.   
9479
9480 2004-07-14  Martin Baulig  <martin@ximian.com>
9481
9482         * iterators.cs: Use real error numbers.
9483
9484 2004-07-14  Martin Baulig  <martin@ximian.com>
9485
9486         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9487         requires this to be a System.Collection.IEnumerable and not a
9488         class implementing that interface.
9489         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9490
9491 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9492
9493         * class.cs: Fixed previous fix, it broke some error tests.
9494
9495 2004-07-12  Martin Baulig  <martin@ximian.com>
9496
9497         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9498         Fixes #61293.
9499
9500 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9501
9502         * assign.cs (LocalTemporary): Add new argument: is_address,If
9503         `is_address' is true, then the value that we store is the address
9504         to the real value, and not the value itself.
9505         
9506         * ecore.cs (PropertyExpr): use the new local temporary
9507         stuff to allow us to handle X.Y += z (where X is a struct)
9508
9509 2004-07-08  Martin Baulig  <martin@ximian.com>
9510
9511         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9512         not always return, just like we're doing in Using.Resolve().
9513
9514 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9515
9516         * cs-parser.jay (fixed_statement): flag this as Pinned.
9517
9518 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9519
9520         * typemanager.cs (TypeManager): Removed MakePinned method, this
9521         mechanism is replaced with the .NET 2.x compatible mechanism of
9522         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9523
9524         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9525         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9526         `IsFixed' property which has a different meaning.
9527
9528 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9529
9530         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9531         visible from inside a nested class, not just the names of the
9532         immediately enclosing class.
9533         Fix for bug #60730.
9534
9535 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9536
9537         * expression.cs (BetterConversion): Remove buggy special-case
9538         handling of "implicit constant expression conversions".  At this
9539         point, we already know that the conversion is possible -- we're
9540         only checking to see which is better.
9541
9542 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9543
9544         * cs-parser.jay: Added error CS0210 test.
9545
9546 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9547
9548         * cs-parser.jay: Added error CS0134 test.
9549
9550 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9551
9552         Fix bug #52507
9553         * cs-parser.jay: Added error CS0145 test.
9554
9555 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9556
9557         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9558
9559 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9560         
9561         * expression.cs (StackAlloc.Resolve): The argument may not
9562         be a constant; deal with this case.
9563         
9564 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9565
9566         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9567         GetIndexerAttributeValue.
9568         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9569
9570         * class.cs (Indexer.Define): Added error tests for CS0415,
9571         CS0609.
9572
9573 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9574
9575         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9576         property code.
9577
9578 2004-06-23  Martin Baulig  <martin@ximian.com>
9579
9580         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9581         neither return nor throw, reset the barrier as well.  Fixes #60457.
9582
9583 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9584
9585         * class.cs : EventAttributes is now set to None by default.
9586           This fixes bug #60459.
9587
9588 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9589
9590         Fix bug #60219
9591         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9592         Don't throw exception but return null (it's sufficient now).
9593
9594 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9595
9596         * typemanager.cs (GetArgumentTypes): Faster implementation.
9597
9598 2004-06-18  Martin Baulig  <martin@ximian.com>
9599
9600         * attribute.cs (Attribute.Resolve): Check whether we're an
9601         EmptyCast which a Constant child.  Fixes #60333.
9602
9603 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9604
9605         * statement.cs (EmitCollectionForeach): Account for the fact that
9606         not all valuetypes are in areas which we can take the address of.
9607         For these variables, we store to a temporary variable. Also, make
9608         sure that we dont emit a `callvirt' on a valuetype method.
9609
9610 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9611
9612         * expression.cs (StackAlloc.DoReSolve): Added test for
9613         negative parameter (CS0247).
9614
9615 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9616
9617         Fix bug #59792
9618         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9619
9620 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9621
9622         Fix bug #59781
9623         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9624         ulong.
9625
9626 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9627
9628         Fix bug #58254 & cs1555.cs, cs1556.cs
9629         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9630
9631 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9632
9633         * cs-parser.jay: Added error CS1669 test for indexers.
9634
9635 2004-06-11  Martin Baulig  <martin@ximian.com>
9636
9637         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9638         call this twice: for params and varargs methods.
9639
9640 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9641
9642         * class.cs:
9643         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9644
9645 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9646
9647         * attribute.cs (Attribute.GetValidTargets): Made public.
9648
9649         * class.cs: 
9650         (AbstractPropertyEventMethod): New class for better code sharing.
9651         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9652         CS1667 report.
9653         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9654
9655 2004-06-11  Raja R Harinath  <rharinath@novell.com>
9656
9657         Fix bug #59477.
9658         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9659         that the call to Resolve is part of a MemberAccess.
9660         (Expression.Resolve): Use it for SimpleName resolution.
9661         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9662         Add 'intermediate' boolean argument.
9663         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
9664         error message when the SimpleName can be resolved ambiguously
9665         between an expression and a type.
9666         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9667         public.
9668         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9669         call on the left-side.
9670
9671 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9672
9673         * class.cs:
9674         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9675
9676 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9677
9678         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9679
9680 2004-06-11  Martin Baulig  <martin@ximian.com>
9681
9682         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9683         varargs methods if applicable.
9684
9685 2004-06-11  Martin Baulig  <martin@ximian.com>
9686
9687         * expression.cs (Invocation.EmitCall): Don't use
9688         `method.CallingConvention == CallingConventions.VarArgs' since the
9689         method could also have `CallingConventions.HasThis'.
9690
9691 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9692
9693         * class.cs (Event.GetSignatureForError): Implemented.
9694         Fixed crash in error test cs3010.cs
9695
9696 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * cs-tokenizer.cs: Change the way we track __arglist to be
9699         consistent with the other keywords.
9700
9701 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9702
9703         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9704         tomorrow.
9705
9706 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9707
9708         * codegen.cs: Check that all referenced assemblies have a strongname
9709         before strongnaming the compiled assembly. If not report error CS1577.
9710         Fix bug #56563. Patch by Jackson Harper.
9711         * typemanager.cs: Added a method to return all referenced assemblies.
9712         Fix bug #56563. Patch by Jackson Harper.
9713
9714 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9715
9716         * class.cs:
9717         (Method.ApplyAttributeBuilder): Moved and added conditional
9718         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9719
9720         * delegate.cs:
9721         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9722
9723 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9724
9725         Fixed #59640
9726         * class.cs: (EventField.attribute_targets): Changed default target.
9727
9728 2004-06-08  Martin Baulig  <martin@ximian.com>
9729
9730         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9731
9732 2004-06-08  Martin Baulig  <martin@ximian.com>
9733
9734         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9735
9736 2004-06-07  Martin Baulig  <martin@ximian.com>
9737
9738         Added support for varargs methods.
9739
9740         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9741         keyword.
9742
9743         * cs-parser.jay: Added support for `__arglist'.
9744
9745         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9746
9747         * expression.cs (Argument.AType): Added `ArgList'.
9748         (Invocation): Added support for varargs methods.
9749         (ArglistAccess): New public class.
9750         (Arglist): New public class.
9751
9752         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9753
9754         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9755         a method's top-level block if the method has varargs.
9756
9757         * support.cs (ReflectionParameters, InternalParameters): Added
9758         support for varargs methods.    
9759
9760 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9761
9762         * class.cs: Provide location in indexer error report.
9763
9764         * driver.cs: Use standard names.
9765
9766         * namespace.cs: Catch the use of using after a namespace has been
9767         declared also on using aliases.
9768
9769 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9770
9771         Bug #50820.
9772         * typemanager.cs (closure_private_ok, closure_invocation_type)
9773         (closure_qualifier_type, closure_invocation_assembly)
9774         (FilterWithClosure): Move to ...
9775         (Closure): New internal nested class.
9776         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9777         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9778         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9779         (MemberLookup, MemberLookupFailed): Use it.
9780         * expression.cs (New.DoResolve): Treat the lookup for the
9781         constructor as being qualified by the 'new'ed type.
9782         (Indexers.GetIndexersForTypeOrInterface): Update.
9783
9784 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9785
9786         * attribute.cs
9787         (GetConditionalAttributeValue): New method. Returns
9788         condition of ConditionalAttribute.
9789         (SearchMulti): New method.  Returns all attributes of type 't'.
9790         Use it when attribute is AllowMultiple = true.
9791         (IsConditionalMethodExcluded): New method.
9792
9793         * class.cs
9794         (Method.IsExcluded): Implemented. Returns true if method has conditional
9795         attribute and the conditions is not defined (method is excluded).
9796         (IMethodData): Extended interface for ConditionalAttribute support.
9797         (PropertyMethod.IsExcluded): Implemented.
9798
9799         * decl.cs
9800         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9801
9802         * expression.cs
9803         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9804         on the method.
9805
9806 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9807
9808         * expression.cs (ArrayCreationExpression): Make this just an
9809         `expression'. It can't be a statement, so the code here was
9810         dead.
9811
9812 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9813
9814         Fixed #59072
9815         * typemanager.cs (GetFullNameSignature): New method for
9816         MethodBase types.
9817
9818 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9819
9820         Fixed #56452
9821         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9822         Use this method when MethodBuilder is null.
9823         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9824         Added test for error CS0626 (MONO reports error for this situation).
9825         (IMethodData.GetSignatureForError): Extended interface.
9826
9827 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9828
9829         * attribute.cs
9830         (AttributeTester.GetObsoleteAttribute): Returns instance of
9831         ObsoleteAttribute when type is obsolete.
9832
9833         * class.cs
9834         (TypeContainer.VerifyObsoleteAttribute): Override.
9835         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9836         (MethodCode.VerifyObsoleteAttribute): Override.
9837         (MemberBase.VerifyObsoleteAttribute): Override.
9838
9839         * decl.cs
9840         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9841         and report proper error.
9842
9843         *delegate.cs
9844         Delegate.VerifyObsoleteAttribute): Override.
9845
9846         * ecore.cs
9847         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9848         and report proper error.
9849         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9850
9851         * enum.cs
9852         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9853         and enum member.
9854
9855         * expression.cs
9856         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9857         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9858         Added test for ObsoleteAttribute.
9859
9860         * statement.cs
9861         (Catch): Derived from Statement.
9862
9863 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9864  
9865         Fixed bug #59071 & cs0160.cs
9866  
9867         * statement.cs (Try.Resolve): Check here whether order of catch
9868         clauses matches their dependencies.
9869
9870 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9871
9872         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9873         caused a regression: #59343.  Referencing nested classes from an
9874         assembly stopped working.
9875
9876 2004-05-31  Martin Baulig  <martin@ximian.com>
9877
9878         MCS is now frozen for beta 2.
9879
9880 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9881
9882         * convert.cs: add a trivial cache for overload operator resolution.
9883
9884 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9885
9886         * decl.cs: If possible, use lookuptypedirect here. We can only do
9887         this if there is no `.' after the namespace. Avoids using
9888         LookupType, which does lots of slow processing.
9889         (FindNestedType) New method, does what it says :-).
9890         * namespace.cs: use LookupTypeDirect.
9891         * rootcontext.cs: use membercache, if possible.
9892         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9893
9894 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9895
9896         * expression.cs:
9897         According to the spec, 
9898
9899         In a member access of the form E.I, if E is a single identifier,
9900         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9901         field, property, localvariable, or parameter with the same type as
9902         the meaning of E as a type-name (§3.8), then both possible
9903         meanings of E are permitted.
9904
9905         We did not check that E as a simple-name had the same type as E as
9906         a type name.
9907
9908         This trivial check gives us 5-7% on bootstrap time.
9909
9910 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9911
9912         * expression.cs (Invocation.OverloadResolve): Avoid the
9913         use of hashtables and boxing here by allocating on demand.
9914
9915 2004-05-30  Martin Baulig  <martin@ximian.com>
9916
9917         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9918         we're doing a silent lookup.  Don't try to lookup nested types in
9919         TypeManager.object_type (thanks to Ben Maurer).
9920
9921 2004-05-30  Martin Baulig  <martin@ximian.com>
9922
9923         Committing a patch from Ben Maurer.
9924
9925         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9926
9927 2004-05-29  Martin Baulig  <martin@ximian.com>
9928
9929         * class.cs (IMethodData.ShouldIgnore): New method.
9930
9931         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9932         `Location' argument, we don't need it anywhere.  Use
9933         `IMethodData.ShouldIgnore ()' instead of
9934         `MethodData.GetMethodFlags ()'.
9935         (TypeManager.AddMethod): Removed.
9936         (TypeManager.AddMethod2): Renamed to AddMethod.
9937
9938 2004-05-29  Martin Baulig  <martin@ximian.com>
9939
9940         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9941
9942         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9943         converting from a class type S to an interface type and we already
9944         have an object on the stack, don't box it again.  Fixes #52578.
9945
9946 2004-05-29  Martin Baulig  <martin@ximian.com>
9947
9948         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9949         Added support for `params' parameters.  Fixes #59267.
9950
9951 2004-05-29  Martin Baulig  <martin@ximian.com>
9952
9953         * literal.cs (NullPointer): Provide a private .ctor which sets
9954         `type' to TypeManager.object_type.  Fixes #59048.
9955
9956 2004-05-29  Martin Baulig  <martin@ximian.com>
9957
9958         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9959         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9960
9961         * ecore.cs (EventExpr.instance_expr): Make the field private.
9962
9963 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9964
9965         Fixed bug #50080 & cs0214-2.cs
9966         * expression.cs (Cast.DoResolve): Check unsafe context here.
9967         
9968         * statement.cs (Resolve.DoResolve): Likewise.
9969
9970 2004-05-26  Martin Baulig  <martin@ximian.com>
9971
9972         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9973
9974         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9975         (RootContext.LookupType): Pass down the `silent' flag.
9976
9977 2004-05-25  Martin Baulig  <martin@ximian.com>
9978
9979         * expression.cs
9980         (MethodGroupExpr.IdenticalTypeName): New public property.
9981         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9982         expression actually refers to a type.
9983
9984 2004-05-25  Martin Baulig  <martin@ximian.com>
9985
9986         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9987         for #56176 and made it actually work.
9988
9989 2004-05-25  Martin Baulig  <martin@ximian.com>
9990
9991         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9992         (FieldExpr, PropertyExpr): Override and implement
9993         CacheTemporaries.  Fixes #52279.
9994
9995 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * location.cs: In the new compiler listing a file twice is a
9998         warning, not an error.
9999
10000 2004-05-24  Martin Baulig  <martin@ximian.com>
10001
10002         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10003         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10004
10005 2004-05-24  Martin Baulig  <martin@ximian.com>
10006
10007         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10008         walking the `using' list.  Fixes #53921.
10009
10010 2004-05-24  Martin Baulig  <martin@ximian.com>
10011
10012         * const.cs (Const.LookupConstantValue): Added support for
10013         EmptyCast's; fixes #55251.
10014
10015 2004-05-24  Martin Baulig  <martin@ximian.com>
10016
10017         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10018         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10019         which does the CS0135 check.  The reason is that we first need to
10020         check whether the variable actually exists.
10021
10022 2004-05-24  Martin Baulig  <martin@ximian.com>
10023
10024         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10025         than RootContext.LookupType() to find the explicit interface
10026         type.  Fixes #58584.
10027
10028 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10029
10030         * Makefile: Simplify.  Use executable.make.
10031         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10032
10033 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10034
10035         * decl.cs:
10036         * enum.cs:
10037         Use the invariant culture when doing String.Compare for CLS case
10038         sensitivity.
10039         
10040 2004-05-23  Martin Baulig  <martin@ximian.com>
10041
10042         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10043         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10044
10045         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10046         
10047 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10048
10049         * class.cs (MemberBase.Define): Reuse MemberType member for 
10050         resolved type. Other methods can use it too.
10051
10052 2004-05-23  Martin Baulig  <martin@ximian.com>
10053
10054         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10055         the variable also exists in the current block (otherwise, we need
10056         to report a CS0103).  Fixes #58670.
10057
10058 2004-05-23  Martin Baulig  <martin@ximian.com>
10059
10060         * flowanalysis.cs (Reachability.Reachable): Compute this
10061         on-the-fly rather than storing it as a field.
10062
10063 2004-05-23  Martin Baulig  <martin@ximian.com>
10064
10065         * flowanalysis.cs (Reachability.And): Manually compute the
10066         resulting `barrier' from the reachability.      
10067        
10068 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10069
10070         Fix bug #57835
10071         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10072         instance of ObsoleteAttribute when symbol is obsolete.
10073
10074         * class.cs
10075         (IMethodData): Extended interface for ObsoleteAttribute support.
10076
10077 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10078
10079         * attribute.cs: Fix bug #55970
10080
10081 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10082
10083         Fix bug #52705
10084         * attribute.cs
10085         (GetObsoleteAttribute): New method. Creates the instance of
10086         ObsoleteAttribute.
10087         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10088         ObsoleteAttribute when member is obsolete.
10089         (AttributeTester.Report_ObsoleteMessage): Common method for
10090         Obsolete error/warning reporting.
10091
10092         * class.cs
10093         (TypeContainer.base_classs_type): New member for storing parent type.
10094
10095         * decl.cs
10096         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10097         for this MemberCore.
10098
10099 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10100
10101         * attribute.cs, const.cs: Fix bug #58590
10102
10103 2004-05-21  Martin Baulig  <martin@ximian.com>
10104
10105         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10106         out parameters if the end of the method is unreachable.  Fixes
10107         #58098. 
10108
10109 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10110
10111         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10112         Hari was right, why extra method.
10113
10114 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10115
10116         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10117
10118 2004-05-20  Martin Baulig  <martin@ximian.com>
10119
10120         Merged this back from gmcs to keep the differences to a minumum.
10121
10122         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10123         instead of a Declspace.
10124         (Attribute.ResolveType): Likewise.
10125         (Attributes.Search): Likewise.
10126         (Attributes.Contains): Likewise.
10127         (Attributes.GetClsCompliantAttribute): Likewise.
10128
10129         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10130         argument.
10131         (MethodData.ApplyAttributes): Take an EmitContext instead of a
10132         DeclSpace.
10133
10134 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10135
10136         Fix bug #58688 (MCS does not report error when the same attribute
10137         is assigned twice)
10138
10139         * attribute.cs (Attribute.Emit): Distinction between null and default.
10140
10141 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10142
10143         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10144         of a top-level attribute without an attribute target.
10145         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10146         Make non-static.
10147         (Attribute.Conditional_GetConditionName), 
10148         (Attribute.Obsolete_GetObsoleteMessage): Update.
10149         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10150         part of ScanForIndexerName.
10151         (Attribute.CanIgnoreInvalidAttribute): New function.
10152         (Attribute.ScanForIndexerName): Move to ...
10153         (Attributes.ScanForIndexerName): ... here.
10154         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10155         (Attributes.Search): New internal variant that can choose not to
10156         complain if types aren't resolved.  The original signature now
10157         complains.
10158         (Attributes.GetClsCompliantAttribute): Use internal variant, with
10159         complaints suppressed.
10160         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10161         only if it not useful.
10162         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10163         top-level for attributes that are shared between the assembly
10164         and a top-level class.
10165         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10166         * class.cs: Update to reflect changes.
10167         (DefineIndexers): Fuse loops.
10168         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10169         a couple more variants of attribute names.
10170
10171 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10172
10173         Fix bug #52585 (Implemented explicit attribute declaration)
10174
10175         * attribute.cs:
10176         (Attributable.ValidAttributeTargets): New abstract method. It gets
10177         list of valid attribute targets for explicit target declaration.
10178         (Attribute.Target): It holds target itself.
10179         (AttributeSection): Removed.
10180         (Attribute.CheckTargets): New method. It checks whether attribute
10181         target is valid for the current element.
10182
10183         * class.cs:
10184         (EventProperty): New class. For events that are declared like
10185         property (with add and remove accessors).
10186         (EventField): New class. For events that are declared like field.
10187         class.cs
10188
10189         * cs-parser.jay: Implemented explicit attribute target declaration.
10190
10191         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10192         Override ValidAttributeTargets.
10193
10194         * parameter.cs:
10195         (ReturnParameter): Class for applying custom attributes on 
10196         the return type.
10197         (ParameterAtribute): New class. Class for applying custom
10198         attributes on the parameter type.
10199
10200 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10201
10202         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10203         definitions. 
10204
10205         (Method): Allow UNSAFE here.
10206
10207         * modifiers.cs: Support unsafe reporting.
10208
10209 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10210
10211         * decl.cs: Fix bug #58478.
10212
10213 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10214
10215         * statement.cs: When checking for unreachable code on an EmptyStatement,
10216         set the location. Fixes bug #58488.
10217
10218 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10219
10220         * driver.cs: Add -pkg handling.
10221
10222         From Gonzalo: UseShelLExecute=false
10223
10224 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10225
10226         * attribute.cs:
10227         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10228         for attribute.
10229         (Attribute.IsClsCompliaceRequired): Moved to base for better
10230         accesibility.
10231         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10232         when attribute is AttributeUsageAttribute.
10233         (Attribute.GetValidTargets): Simplified.
10234         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10235         attribute for this type.
10236         (Attribute.ApplyAttributes): Method renamed to Emit and make
10237         non-static.
10238         (GlobalAttributeSection): New class for special handling of global
10239         attributes (assembly, module).
10240         (AttributeSection.Emit): New method.
10241
10242         * class.cs: Implemented Attributable abstract methods.
10243         (MethodCore.LabelParameters): Moved to Parameter class.
10244         (Accessor): Is back simple class.
10245         (PropertyMethod): Implemented Attributable abstract class.
10246         (DelegateMethod): Implemented Attributable abstract class.
10247         (Event): New constructor for disctintion between normal Event
10248         and Event with accessors.
10249
10250         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10251
10252         * codegen.cs, const.cs, decl.cs, delegate.cs:
10253         (CommonAssemblyModulClass): Implemented Attributable abstract class
10254         and simplified.
10255
10256         * enum.cs: Implement IAttributeSupport interface.
10257         (EnumMember): New class for emum members. Implemented Attributable
10258         abstract class
10259
10260         * parameter.cs:
10261         (ParameterBase): Is abstract.
10262         (ReturnParameter): New class for easier [return:] attribute handling.
10263
10264         * typemanager.cs: Removed builder_to_attr.
10265
10266 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10267
10268         Fix bug #57151.
10269         * attribute.cs (Attribute.GetPositionalValue): New function.
10270         * class.cs (TypeContainer.VerifyMembers): New function.
10271         (TypeContainer.Emit): Use it.
10272         (ClassOrStruct): New base class for Class and Struct.
10273         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10274         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10275         class.
10276         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10277         then each non-static field should have a FieldOffset attribute.
10278         Otherwise, none of the fields should have a FieldOffset attribute.
10279         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10280         and FieldOffset attributes.
10281         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10282         (TypeManager.field_offset_attribute_type): New core types.
10283         (TypeManager.InitCoreTypes): Initialize them.
10284
10285 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10286
10287         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10288         Return correct type.
10289         From bug #58270.
10290
10291 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10292
10293         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10294         be implicitly converted to ulong.
10295         
10296         * expression.cs: The logic for allowing operator &, | and ^ worked
10297         was wrong, it worked before because we did not report an error in
10298         an else branch.  Fixes 57895.
10299
10300         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10301         allow volatile fields to be reference types.
10302
10303 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10304
10305         * driver.cs: Add support for /debug-
10306
10307 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10308
10309         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10310         Add a 'complain' parameter to silence errors.
10311         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10312         silently overlooked type-resolutions.
10313         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10314         to reflect changes.
10315         (Attributes.Search): New function.
10316         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10317         (Attributes.GetAttributeFullName): Remove hack.
10318         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10319         Update to reflect changes.
10320         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10321         Use Attributes.Search instead of nested loops.
10322
10323 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10324
10325         * decl.cs:
10326         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10327         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10328         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10329
10330         * report.cs: (Report.Warning): Renamed to Warning_T because of
10331         parameter collision.
10332
10333 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10334
10335         * expression.cs (MemberAccess.ResolveMemberAccess):
10336         Exit with non-zero status after Report.Error.
10337         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10338         Likewise.
10339         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10340
10341 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10342
10343         * support.cs: Don't hang when the file is empty.
10344
10345 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10346
10347         * support.cs: In SeekableStreamReader, compute the preamble size of the
10348           underlying stream. Position changes should take into account that initial
10349           count of bytes.
10350
10351 2004-05-03  Todd Berman  <tberman@sevenl.net>
10352
10353         * driver.cs: remove unused GetSysVersion function.
10354
10355 2004-05-03  Todd Berman  <tberman@sevenl.net>
10356
10357         * driver.cs: Remove the hack from saturday, as well as the hack
10358         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10359         link_paths to get that bit proper.
10360
10361 2004-05-01  Todd Berman  <tberman@sevenl.net>
10362
10363         * driver.cs: Try a LoadFrom before a Load, this checks the current
10364         path. This is currently a bug in mono that is be fixed, however, this
10365         provides a workaround for now. This will be removed when the bug
10366         is fixed.
10367
10368 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10369
10370         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10371         incomplete key pairs (#57941).
10372
10373 2004-05-01  Todd Berman  <tberman@sevenl.net>
10374
10375         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10376         from the GAC
10377
10378 2004-04-30  Jackson Harper  <jackson@ximian.com>
10379
10380         * codegen.cs: Open keys readonly.
10381         
10382 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10383
10384         * typemanager.cs: don't report cyclic struct layout when a struct
10385         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10386         which has 2 Pango.Rectangle fields.
10387
10388 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10389
10390         * expression.cs: Handle IntPtr comparisons with IL code
10391         rather than a method call.
10392
10393 2004-04-29  Martin Baulig  <martin@ximian.com>
10394
10395         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10396         the list of PropertyInfo's in class hierarchy and find the
10397         accessor.  Fixes #56013.
10398
10399 2004-04-29  Martin Baulig  <martin@ximian.com>
10400
10401         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10402
10403 2004-04-29  Martin Baulig  <martin@ximian.com>
10404
10405         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10406
10407         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10408
10409 2004-04-29  Martin Baulig  <martin@ximian.com>
10410
10411         * class.cs (ConstructorInitializer.Resolve): Check whether the
10412         parent .ctor is accessible.  Fixes #52146.
10413
10414 2004-04-29  Martin Baulig  <martin@ximian.com>
10415
10416         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10417
10418         * statement.cs (Using.EmitLocalVariableDecls): Use
10419         TypeManager.idisposable_type, not typeof (IDisposable).
10420         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10421
10422 2004-04-29  Martin Baulig  <martin@ximian.com>
10423
10424         * class.cs (Event.Define): Don't emit the field and don't set
10425         RTSpecialName and SpecialName for events on interfaces.  Fixes
10426         #57703. 
10427
10428 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10429
10430         Refactor Attribute.ApplyAttributes.
10431         * attribute.cs (Attributable): New base class for objects that can
10432         have Attributes applied on them.
10433         (Attribute): Make AttributeUsage fields public.
10434         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10435         (Attribute.IsInternalCall): New property.
10436         (Attribute.UsageAttr): Convert to a public read-only property.
10437         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10438         (Attribute.ResolveType, Attribute.Resolve)
10439         (Attribute.ScanForIndexerName): Update to reflect changes.
10440         (Attribute.CheckAttributeTarget): Re-format.
10441         (Attribute.ApplyAttributes): Refactor, to various
10442         Attributable.ApplyAttributeBuilder methods.
10443         * decl.cs (MemberCore): Make Attributable.
10444         * class.cs (Accessor): Make Attributable.
10445         (MethodData.ApplyAttributes): Use proper attribute types, not
10446         attribute names.
10447         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10448         (TypeContainer.ApplyAttributeBuilder)
10449         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10450         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10451         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10452         (Operator.ApplyAttributeBuilder): New factored-out methods.
10453         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10454         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10455         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10456         * parameter.cs (ParameterBase): New Attributable base class
10457         that can also represent Return types.
10458         (Parameter): Update to the changes.
10459
10460 2004-04-29  Jackson Harper  <jackson@ximian.com>
10461
10462         * driver.cs: Prefer the corlib system version when looking for
10463         assemblies in the GAC. This is still a hack, but its a better hack
10464         now.
10465         
10466 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10467
10468         * decl.cs, enum.cs: Improved error 3005 reporting.
10469   
10470         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10471         (related_symbols): New private member for list of symbols
10472         related to reported error/warning.
10473         
10474         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10475
10476 2004-04-29  Martin Baulig  <martin@ximian.com>
10477
10478         * ecore.cs (Expression.Constantify): If we're an enum and
10479         TypeManager.TypeToCoreType() doesn't give us another type, use
10480         t.UnderlyingSystemType.  Fixes #56178.  
10481
10482 2004-04-29  Martin Baulig  <martin@ximian.com>
10483
10484         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10485         interfaces and for each interface, only add members directly
10486         declared in that interface.  Fixes #53255.
10487
10488 2004-04-28  Martin Baulig  <martin@ximian.com>
10489
10490         * expression.cs (ConditionalLogicalOperator): Use a temporary
10491         variable for `left' to avoid that we evaluate it more than once;
10492         bug #52588.
10493
10494 2004-04-28  Martin Baulig  <martin@ximian.com>
10495
10496         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10497         `void[]' (CS1547).
10498
10499 2004-04-28  Martin Baulig  <martin@ximian.com>
10500
10501         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10502         void (CS1547).
10503
10504         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10505         whether the type is not void (CS1547).
10506
10507 2004-04-28  Martin Baulig  <martin@ximian.com>
10508
10509         * expression.cs (Unary.DoResolveLValue): Override this and report
10510         CS0131 for anything but Operator.Indirection.
10511
10512 2004-04-28  Martin Baulig  <martin@ximian.com>
10513
10514         Committing a patch from Ben Maurer; see bug #50820.
10515
10516         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10517         check for classes.
10518
10519         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10520         classes.        
10521
10522 2004-04-28  Martin Baulig  <martin@ximian.com>
10523
10524         Committing a patch from Ben Maurer; see bug #50820.
10525
10526         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10527         check for classes.
10528
10529         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10530         classes.        
10531
10532 2004-04-28  Martin Baulig  <martin@ximian.com>
10533
10534         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10535         (Block.AddLabel): Call DoLookupLabel() to only search in the
10536         current block.
10537
10538 2004-04-28  Martin Baulig  <martin@ximian.com>
10539
10540         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10541         comparing StringConstants and NullLiterals in Equality and Inequality.
10542
10543 2004-04-28  Jackson Harper  <jackson@ximian.com>
10544
10545         * driver.cs: Attempt to load referenced assemblies from the
10546         GAC. This is the quick and dirty version of this method that
10547         doesnt take into account versions and just takes the first
10548         canidate found. Will be good enough for now as we will not have more
10549         then one version installed into the GAC until I update this method.
10550
10551 2004-04-28  Martin Baulig  <martin@ximian.com>
10552
10553         * typemanager.cs (TypeManager.CheckStructCycles): New public
10554         static method to check for cycles in the struct layout.
10555
10556         * rootcontext.cs (RootContext.PopulateTypes): Call
10557         TypeManager.CheckStructCycles() for each TypeContainer.
10558         [Note: We only need to visit each type once.]
10559
10560 2004-04-28  Martin Baulig  <martin@ximian.com>
10561
10562         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10563
10564         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10565         success and added `out object value'.  Use a `bool resolved' field
10566         to check whether we've already been called rather than
10567         `ConstantValue != null' since this breaks for NullLiterals.
10568
10569 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10570
10571         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10572         setting of this flag, since the 'set' method may be non-public.
10573
10574 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10575
10576         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10577         check on current_vector.Block.
10578
10579 2004-04-27  Martin Baulig  <martin@ximian.com>
10580
10581         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10582         a field initializer.  Fixes #56459.
10583
10584 2004-04-27  Martin Baulig  <martin@ximian.com>
10585
10586         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10587         we're not attempting to use an indexer.  Fixes #52154.
10588
10589 2004-04-27  Martin Baulig  <martin@ximian.com>
10590
10591         * statement.cs (Return): Don't create a return label if we don't
10592         need it; reverts my change from January 20th.  Thanks to Ben
10593         Maurer for this.
10594
10595 2004-04-27  Martin Baulig  <martin@ximian.com>
10596
10597         According to the spec, `goto' can only leave a nested scope, but
10598         never enter it.
10599
10600         * statement.cs (Block.LookupLabel): Only lookup in the current
10601         block, don't recurse into parent or child blocks.
10602         (Block.AddLabel): Check in parent and child blocks, report
10603         CS0140/CS0158 if we find a duplicate.
10604         (Block): Removed this indexer for label lookups.
10605         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10606         this already does the error reporting for us.
10607
10608         * flowanalysis.cs
10609         (FlowBranching.UsageVector.Block): New public variable; may be null.
10610         (FlowBranching.CreateSibling): Added `Block' argument.
10611         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10612         label for the target of a `goto' and check whether we're not
10613         leaving a `finally'.
10614
10615 2004-04-27  Martin Baulig  <martin@ximian.com>
10616
10617         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10618         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10619         just for returns).
10620
10621 2004-04-27  Martin Baulig  <martin@ximian.com>
10622
10623         * statement.cs (Block.AddLabel): Also check for implicit blocks
10624         and added a CS0158 check.
10625
10626 2004-04-27  Martin Baulig  <martin@ximian.com>
10627
10628         * flowanalysis.cs (FlowBranchingLoop): New class.
10629         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10630         UsageVector's instead of an ArrayList.
10631         (FlowBranching.Label): Likewise.
10632         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10633         (FlowBranching.AddBreakVector): New method.
10634
10635 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10636
10637         * attribute.cs: Small regression fix: only convert the type if we
10638         the type is different, fixes System.Drawing build.
10639
10640 2004-04-27  Martin Baulig  <martin@ximian.com>
10641
10642         * attribute.cs (Attribute.Resolve): If we have a constant value
10643         for a named field or property, implicity convert it to the correct
10644         type.
10645
10646 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10647
10648         * statement.cs (Block.Block): Implicit blocks share
10649         'child_variable_names' fields with parent blocks.
10650         (Block.AddChildVariableNames): Remove.
10651         (Block.AddVariable): Mark variable as "used by a child block" in
10652         every surrounding block.
10653         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10654         been used in a child block, complain about violation of "Invariant
10655         meaning in blocks" rule.
10656         * cs-parser.jay (declare_local_variables): Don't use
10657         AddChildVariableNames.
10658         (foreach_statement): Don't create an implicit block: 'foreach'
10659         introduces a scope.
10660
10661 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10662
10663         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10664         converting from 0L to ulong.  Fixes 57522.
10665
10666 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10667
10668         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10669         derived class hides via 'new' keyword field from base class (test-242.cs).
10670         TODO: Handle this in the more general way.
10671         
10672         * class.cs (CheckBase): Ditto.
10673
10674 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10675
10676         * decl.cs (caching_flags): New member for storing cached values
10677         as bit flags.
10678         (MemberCore.Flags): New enum where bit flags for caching_flags
10679         are defined.
10680         (MemberCore.cls_compliance): Moved to caching_flags.
10681         (DeclSpace.Created): Moved to caching_flags.
10682
10683         * class.cs: Use caching_flags instead of DeclSpace.Created
10684         
10685 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10686
10687         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10688         if we are only a derived class, not a nested class.
10689
10690         * typemanager.cs: Same as above, but do this at the MemberLookup
10691         level (used by field and methods, properties are handled in
10692         PropertyExpr).   Allow for the qualified access if we are a nested
10693         method. 
10694
10695 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10696
10697         * class.cs: Refactoring.
10698         (IMethodData): New inteface; Holds links to parent members
10699         to avoid member duplication (reduced memory allocation).
10700         (Method): Implemented IMethodData interface.
10701         (PropertyBase): New inner classes for get/set methods.
10702         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10703         (Event): New inner classes for add/remove methods.
10704         (Event.DelegateMethod): Implemented IMethodData interface.
10705
10706         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10707         EmitContext (related to class.cs refactoring).
10708
10709 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10710
10711         * delegate.cs (Delegate.VerifyApplicability): If the number of
10712         arguments are the same as the number of parameters, first try to
10713         verify applicability ignoring  any 'params' modifier on the last
10714         parameter.
10715         Fixes #56442.
10716
10717 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10718
10719         * class.cs (TypeContainer.AddIndexer): Use
10720         'ExplicitInterfaceName' to determine if interface name was
10721         explicitly specified.  'InterfaceType' is not initialized at this time.
10722         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10723         Indexers array is already in the required order.  Initialize
10724         'IndexerName' only if there are normal indexers.
10725         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10726         (TypeContainer.Emit): Emit DefaultMember attribute only if
10727         IndexerName is initialized.
10728         Fixes #56300.
10729
10730 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10731
10732         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10733         Fixes #57007
10734
10735 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10736
10737         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10738         attributes.
10739         Fix for #56456.
10740
10741         * attribute.cs (Attribute.Resolve): Check for duplicate named
10742         attributes.
10743         Fix for #56463.
10744
10745 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10746
10747         * iterators.cs (MarkYield): track whether we are in an exception,
10748         and generate code accordingly.  Use a temporary value to store the
10749         result for our state.
10750
10751         I had ignored a bit the interaction of try/catch with iterators
10752         since their behavior was not entirely obvious, but now it is
10753         possible to verify that our behavior is the same as MS .NET 2.0
10754
10755         Fixes 54814
10756
10757 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * iterators.cs: Avoid creating temporaries if there is no work to
10760         do. 
10761
10762         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10763         Enumerations, use TypeManager.EnumToUnderlying and call
10764         recursively. 
10765
10766         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10767         bug #57013
10768
10769         (This.Emit): Use EmitContext.EmitThis to emit our
10770         instance variable.
10771
10772         (This.EmitAssign): Ditto.
10773
10774         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10775         codepaths, we will move all the functionality into
10776         Mono.CSharp.This 
10777
10778         (FieldExpr.EmitAssign): Ditto.
10779
10780         This fixes several hidden bugs that I uncovered while doing a code
10781         review of this today.
10782
10783         * codegen.cs (EmitThis): reworked so the semantics are more clear
10784         and also support value types "this" instances.
10785
10786         * iterators.cs: Changed so that for iterators in value types, we
10787         do not pass the value type as a parameter.  
10788
10789         Initialization of the enumerator helpers is now done in the caller
10790         instead of passing the parameters to the constructors and having
10791         the constructor set the fields.
10792
10793         The fields have now `assembly' visibility instead of private.
10794
10795 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * expression.cs (Argument.Resolve): Check if fields passed as ref
10798         or out are contained in a MarshalByRefObject.
10799
10800         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10801         another compiler type.
10802
10803 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10804
10805         * class.cs (Indexer.Define): use the new name checking method.
10806         Also, return false on an error.
10807         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10808         (is_identifier_[start/part]_character): make static.
10809
10810 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10811
10812         * expression.cs (Binary.ResolveOperator): Do no append strings
10813         twice: since we can be invoked more than once (array evaluation)
10814         on the same concatenation, take care of this here.  Based on a fix
10815         from Ben (bug #56454)
10816
10817 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10818
10819         * codegen.cs: Fix another case where CS1548 must be reported (when 
10820         delay-sign isn't specified and no private is available #56564). Fix
10821         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10822         error when MCS is used on the MS runtime and we need to delay-sign 
10823         (which seems unsupported by AssemblyBuilder - see #56621).
10824
10825 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10826
10827         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10828         (TypeManager.ComputeNamespaces): Faster implementation for
10829         Microsoft runtime.
10830
10831         * compiler.csproj: Updated AssemblyName to mcs.
10832
10833 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10834
10835         * rootcontext.cs: Add new types to the boot resolution.
10836
10837         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10838         MulticastDelegate is not allowed.
10839
10840         * typemanager.cs: Add new types to lookup: System.TypedReference
10841         and ArgIterator.
10842
10843         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10844         check for TypedReference or ArgIterator, they are not allowed. 
10845
10846         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10847         makes us properly catch 1510 in some conditions (see bug 56016 for
10848         details). 
10849
10850 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10851
10852         * CryptoConvert.cs: update from corlib version
10853         with endian fixes.
10854
10855 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * class.cs (Indexer.Define): Check indexername declaration
10858
10859 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10860
10861         * attribute.cs (IsClsCompliant): Fixed problem with handling
10862         all three states (compliant, not-compliant, undetected).
10863
10864 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10865
10866         * attribute.cs (Attribute): Location is now public.
10867         (Resolve): Store resolved arguments (pos_values) in attribute class.
10868         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10869         (GetClsCompliantAttributeValue): New method that gets
10870         CLSCompliantAttribute value.
10871         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10872         if exists else null.
10873         (AttributeTester): New class for CLS-Compliant verification routines.
10874
10875         * class.cs (Emit): Add CLS-Compliant verification.
10876         (Method.GetSignatureForError): Implemented.
10877         (Constructor.GetSignatureForError): Implemented
10878         (Constructor.HasCompliantArgs): Returns if constructor has
10879         CLS-Compliant arguments.
10880         (Constructor.Emit): Override.
10881         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10882         is needed to test only parameters.
10883         (FieldBase.GetSignatureForError): Implemented.
10884         (TypeContainer): New member for storing base interfaces.
10885         (TypeContainer.FindMembers): Search in base interfaces too.
10886
10887         * codegen.cs (GetClsComplianceAttribute): New method that gets
10888         assembly or module CLSCompliantAttribute value.
10889         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10890         for assembly.
10891         (ModuleClass.Emit): Add error 3012 test.
10892
10893         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10894
10895         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10896         state for all decl types.
10897         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10898         if CLS-Compliant tests are required.
10899         (IsClsCompliaceRequired): New method. Analyze whether code
10900         must be CLS-Compliant.
10901         (IsExposedFromAssembly): New method. Returns true when MemberCore
10902         is exposed from assembly.
10903         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10904         value or gets cached value.
10905         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10906         is explicitly marked with CLSCompliantAttribute.
10907         (IsIdentifierClsCompliant): New abstract method. This method is
10908         used to testing error 3005.
10909         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10910         for identifier and parameters CLS-Compliant testing.
10911         (VerifyClsCompliance): New method. The main virtual method for
10912         CLS-Compliant verifications.
10913         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10914         null. I don't know why is null (too many public members !).
10915         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10916         and get value of first CLSCompliantAttribute that found.
10917
10918         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10919         (VerifyClsCompliance): Override and add extra tests.
10920
10921         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10922         clscheck- disable CLS-Compliant verification event if assembly is has
10923         CLSCompliantAttribute(true).
10924
10925         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10926         ApllyAttribute is now called in emit section as in the other cases.
10927         Possible future Emit integration.
10928         (IsIdentifierClsCompliant): New override.
10929         (VerifyClsCompliance): New override.
10930         (GetEnumeratorName): Returns full enum name.
10931
10932         * parameter.cs (GetSignatureForError): Implemented.
10933
10934         * report.cs (WarningData): New struct for Warning message information.
10935         (LocationOfPreviousError): New method.
10936         (Warning): New method. Reports warning based on the warning table.
10937         (Error_T): New method. Reports error based on the error table.
10938
10939         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10940         verifications are done here.
10941
10942         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10943
10944         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10945         CLSCompliantAttribute.
10946         (all_imported_types): New member holds all imported types from other
10947         assemblies.
10948         (LoadAllImportedTypes): New method fills static table with exported types
10949         from all referenced assemblies.
10950         (Modules): New property returns all assembly modules.
10951
10952 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10953
10954         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10955         throwing a parser error.
10956
10957         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10958         which removes the hardcoded get_/set_ prefixes for properties, as
10959         IL allows for the properties to be named something else.  
10960
10961         Bug #56013
10962
10963         * expression.cs: Do not override operand before we know if it is
10964         non-null.  Fix 56207
10965
10966 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10967
10968         * typemanager.cs: support for pinned variables.
10969
10970 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10971
10972         * decl.cs, typemanager.cs: Avoid using an arraylist
10973         as a buffer if there is only one result set.
10974
10975 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10976
10977         * expression.cs: Make sure you cant call a static method
10978         with an instance expression, bug #56174.
10979
10980 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10981
10982         * class.cs (IsDuplicateImplementation): Improve error reporting to
10983         flag 663 (method only differs in parameter modifier).
10984
10985         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10986         in preprocessor directives.
10987
10988         * location.cs (LookupFile): Allow for the empty path.
10989
10990         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10991         better approach for some of that patch, but its failing with the
10992         CharSet enumeration.  For now try/catch will do.
10993
10994         * typemanager.cs: Do not crash if a struct does not have fields.
10995         Fixes 56150.
10996
10997 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10998
10999         * expression.cs: cs0213, cant fix a fixed expression.
11000         fixes 50231.
11001
11002 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11003
11004         * cs-parser.jay: detect invalid embeded statements gracefully.
11005         bug #51113.
11006
11007 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11008
11009         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11010         As a regex:
11011         s/
11012         the invocation type may not be a subclass of the tye of the item/
11013         The type of the item must be a subclass of the invocation item.
11014         /g
11015
11016         Fixes bug #50820.
11017
11018 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11019
11020         * attribute.cs: Added methods to get a string and a bool from an
11021         attribute. Required to information from AssemblyKeyFileAttribute,
11022         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11023         * codegen.cs: Modified AssemblyName creation to include support for
11024         strongnames. Catch additional exceptions to report them as CS1548.
11025         * compiler.csproj: Updated include CryptoConvert.cs.
11026         * compiler.csproj.user: Removed file - user specific configuration.
11027         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11028         Mono.Security assembly. The original class is maintained and tested in
11029         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11030         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11031         like CSC 8.0 (C# v2) supports.
11032         * Makefile: Added CryptoConvert.cs to mcs sources.
11033         * rootcontext.cs: Added new options for strongnames.
11034
11035 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11036
11037         * driver.cs: For --expect-error, report error code `2'
11038         if the program compiled with no errors, error code `1' if
11039         it compiled with an error other than the one expected.
11040
11041 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11042
11043         * compiler.csproj: Updated for Visual Studio .NET 2003.
11044         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11045         * compiler.sln: Updated for Visual Studio .NET 2003.
11046
11047 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11048
11049         * expression.cs: Fix bug #47234. We basically need to apply the
11050         rule that we prefer the conversion of null to a reference type
11051         when faced with a conversion to 'object' (csc behaviour).
11052
11053 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11054
11055         * statement.cs: Shorter form for foreach, eliminates
11056         a local variable. r=Martin.
11057
11058 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11059
11060         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11061         checks if we can use brtrue/brfalse to test for 0.
11062         * expression.cs: use the above in the test for using brtrue/brfalse.
11063         cleanup code a bit.
11064
11065 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11066
11067         * expression.cs: Rewrite string concat stuff. Benefits:
11068
11069         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11070         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11071         rather than a concat chain.
11072
11073         * typemanager.cs: Add lookups for more concat overloads.
11074
11075 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11076
11077         * expression.cs: Emit shorter il code for array init.
11078
11079         newarr
11080         dup
11081         // set 1
11082
11083         // set 2
11084
11085         newarr
11086         stloc.x
11087
11088         ldloc.x
11089         // set 1
11090
11091         ldloc.x
11092         // set 2
11093
11094 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11095
11096         * statement.cs: Before, two switch blocks would be merged if the
11097         total size of the blocks (end_item - begin_item + 1) was less than
11098         two times the combined sizes of the blocks.
11099
11100         Now, it will only merge if after the merge at least half of the
11101         slots are filled.
11102
11103         fixes 55885.
11104
11105 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11106
11107         * class.cs : csc build fix for GetMethods(). See bug #52503.
11108
11109 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11110
11111         * expression.cs: Make sure fp comparisons work with NaN.
11112         This fixes bug #54303. Mig approved this patch a long
11113         time ago, but we were not able to test b/c the runtime
11114         had a related bug.
11115
11116 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11117
11118         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11119
11120 2004-03-19  Martin Baulig  <martin@ximian.com>
11121
11122         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11123         error here and not in our caller.
11124
11125 2004-03-19  Martin Baulig  <martin@ximian.com>
11126
11127         * interface.cs: Completely killed this file.
11128         (Interface): We're now a TypeContainer and live in class.cs.
11129
11130         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11131         argument; we're now also called for interfaces.
11132         (TypeContainer.DefineMembers): Allow this method being called
11133         multiple times.
11134         (TypeContainer.GetMethods): New public method; formerly known as
11135         Interface.GetMethod().  This is used by PendingImplementation.
11136         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11137         it's now private and non-static.
11138         (Interface): Moved this here; it's now implemented similar to
11139         Class and Struct.
11140         (Method, Property, Event, Indexer): Added `bool is_interface'
11141         argument to their .ctor's.
11142         (MemberBase.IsInterface): New public field.
11143
11144         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11145         instances instead of InterfaceMethod, InterfaceProperty, etc.
11146         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11147         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11148
11149 2004-03-19  Martin Baulig  <martin@ximian.com>
11150
11151         * class.cs (MethodCore.IsDuplicateImplementation): New private
11152         method which does the CS0111 checking.
11153         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11154         Use IsDuplicateImplementation().
11155
11156 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11157
11158         * decl.cs (FindMemberToOverride): New method to find the correct
11159         method or property to override in the base class.
11160         * class.cs
11161             - Make Method/Property use the above method to find the
11162               version in the base class.
11163             - Remove the InheritableMemberSignatureCompare as it is now
11164               dead code.
11165
11166         This patch makes large code bases much faster to compile, as it is
11167         O(n) rather than O(n^2) to do this validation.
11168
11169         Also, it fixes bug 52458 which is that nested classes are not
11170         taken into account when finding the base class member.
11171
11172         Reviewed/Approved by Martin.
11173
11174 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11175
11176         * interface.cs: In all interface classes removed redundant
11177         member initialization.
11178
11179 2004-03-16  Martin Baulig  <martin@ximian.com>
11180
11181         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11182
11183 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11184
11185         * decl.cs (DefineTypeAndParents): New helper method to define a
11186         type's containers before the type itself is defined;  This is a
11187         bug exposed by the recent changes to Windows.Forms when an
11188         implemented interface was defined inside a class that had not been
11189         built yet.   
11190
11191         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11192
11193         (Check): Loop correctly to report errors modifiers
11194         (UNSAFE was not in the loop, since it was the same as TOP).
11195
11196         * interface.cs: Every interface member now takes a ModFlags,
11197         instead of a "is_new" bool, which we set on the base MemberCore. 
11198
11199         Every place where we called "UnsafeOk" in the interface, now we
11200         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11201         the unsafe settings from the member declaration instead of the
11202         container interface. 
11203
11204         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11205
11206         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11207         `set_indexer_name' to the pending bits (one per type).
11208
11209         We fixed a bug today that was picking the wrong method to
11210         override, since for properties the existing InterfaceMethod code
11211         basically ignored the method name.  Now we make sure that the
11212         method name is one of the valid indexer names.
11213
11214 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11215  
11216         * support.cs (SeekableStreamReader): Keep track of stream byte
11217         positions and don't mix them with character offsets to the buffer.
11218
11219         Patch from Gustavo Giráldez
11220
11221 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11222
11223         * interface.cs (InterfaceSetGetBase): Removed double member
11224         initialization, base class does it as well.
11225
11226 2004-03-13  Martin Baulig  <martin@ximian.com>
11227
11228         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11229         when compiling corlib.
11230
11231 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11232
11233         * convert.cs (ExplicitConversion): We were reporting an error on
11234         certain conversions (object_type source to a value type, when the
11235         expression was `null') before we had a chance to pass it through
11236         the user defined conversions.
11237
11238         * driver.cs: Replace / and \ in resource specifications to dots.
11239         Fixes 50752
11240
11241         * class.cs: Add check for duplicate operators.  Fixes 52477
11242
11243 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11244
11245         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11246         that are in the middle of the statements, not only at the end.
11247         Fixes #54987
11248
11249         * class.cs (TypeContainer.AddField): No longer set the
11250         `HaveStaticConstructor' flag, now we call it
11251         `UserDefineStaticConstructor' to diferentiate the slightly
11252         semantic difference.
11253
11254         The situation is that we were not adding BeforeFieldInit (from
11255         Modifiers.TypeAttr) to classes that could have it.
11256         BeforeFieldInit should be set to classes that have no static
11257         constructor. 
11258
11259         See:
11260
11261         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11262
11263         And most importantly Zoltan's comment:
11264
11265         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11266
11267         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11268          before its static fields are used', i.e. initialization does not need
11269          to be triggered by the first access to the type. Setting this flag
11270          helps the JIT to compile better code, since it can run the static
11271          constructor at JIT time, and does not need to generate code to call it
11272          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11273          this flag for lots of classes like String. 
11274          
11275          csc sets this flag if the type does not have an explicit static 
11276          constructor. The reasoning seems to be that if there are only static
11277          initalizers for a type, and no static constructor, then the programmer
11278          does not care when this initialization happens, so beforefieldinit
11279          can be used.
11280          
11281          This bug prevents the AOT compiler from being usable, since it 
11282          generates so many calls to mono_runtime_class_init that the AOT code
11283          is much slower than the JITted code. The JITted code is faster, 
11284          because it does not generate these calls if the vtable is type is
11285          already initialized, which is true in the majority of cases. But the
11286          AOT compiler can't do this."
11287
11288 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11289
11290         * class.cs (MethodData.Emit): Refactor the code so symbolic
11291         information is generated for destructors;  For some reasons we
11292         were taking a code path that did not generate symbolic information
11293         before. 
11294
11295 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11296
11297         * class.cs: Create a Constructor.CheckBase method that
11298         takes care of all validation type code. The method
11299         contains some code that was moved from Define.
11300
11301         It also includes new code that checks for duplicate ctors.
11302         This fixes bug #55148.
11303
11304 2004-03-09  Joshua Tauberer <tauberer@for.net>
11305
11306         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11307         a { ... }-style array creation invokes EmitStaticInitializers
11308         which is not good for reference-type arrays.  String, decimal
11309         and now null constants (NullCast) are not counted toward
11310         static initializers.
11311
11312 2004-03-05  Martin Baulig  <martin@ximian.com>
11313
11314         * location.cs (SourceFile.HasLineDirective): New public field;
11315         specifies whether the file contains or is referenced by a "#line"
11316         directive.
11317         (Location.DefineSymbolDocuments): Ignore source files which
11318         either contain or are referenced by a "#line" directive.        
11319
11320 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11321
11322         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11323         direct access to our parent, so check the method inline there.
11324
11325 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11326
11327         * expression.cs (Invocation.EmitCall): Miguel's last commit
11328         caused a regression. If you had:
11329
11330             T t = null;
11331             t.Foo ();
11332
11333         In Foo the implict this would be null.
11334
11335 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11336
11337         * expression.cs (Invocation.EmitCall): If the method is not
11338         virtual, do not emit a CallVirt to it, use Call.
11339
11340         * typemanager.cs (GetFullNameSignature): Improve the method to
11341         cope with ".ctor" and replace it with the type name.
11342
11343         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11344         as an argument the ConstructorBuilder where it is being defined,
11345         to catch the recursive constructor invocations.
11346
11347 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11348
11349         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11350         routines to check if a type is an enumerable/enumerator allow
11351         classes that implement the IEnumerable or IEnumerator interfaces.
11352
11353         * class.cs (Property, Operator): Implement IIteratorContainer, and
11354         implement SetYields.
11355
11356         (Property.Define): Do the block swapping for get_methods in the
11357         context of iterators.   We need to check if Properties also
11358         include indexers or not.
11359
11360         (Operator): Assign the Block before invoking the
11361         OperatorMethod.Define, so we can trigger the Iterator code
11362         replacement. 
11363
11364         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11365         Property and Operator classes are not created when we parse the
11366         declarator but until we have the block completed, so we use a
11367         singleton SimpleIteratorContainer.Simple to flag whether the
11368         SetYields has been invoked.
11369
11370         We propagate this setting then to the Property or the Operator to
11371         allow the `yield' to function.
11372
11373 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11374
11375         * codegen.cs: Implemented attribute support for modules.
11376         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11377         Assembly/Module functionality.
11378
11379         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11380         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11381         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11382
11383 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11384
11385         * interface.cs (FindMembers): The operation is performed on all base
11386         interfaces and not only on the first. It is required for future CLS Compliance patch.
11387
11388 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11389
11390         * statement.cs, codegen.cs:
11391         This patch deals with patterns such as:
11392
11393         public class List : IEnumerable {
11394
11395                 public MyEnumerator GetEnumerator () {
11396                         return new MyEnumerator(this);
11397                 }
11398
11399                 IEnumerator IEnumerable.GetEnumerator () {
11400                         ...
11401                 }
11402                 
11403                 public struct MyEnumerator : IEnumerator {
11404                         ...
11405                 }
11406         }
11407
11408         Before, there were a few things we did wrong:
11409         1) we would emit callvirt on a struct, which is illegal
11410         2) we emited ldarg when we needed to emit ldarga
11411         3) we would mistakenly call the interface methods on an enumerator
11412         type that derived from IEnumerator and was in another assembly. For example:
11413
11414         public class MyEnumerator : IEnumerator
11415
11416         Would have the interface methods called, even if there were public impls of the
11417         method. In a struct, this lead to invalid IL code.
11418
11419 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11420
11421         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11422           renamed to Emit.
11423
11424         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11425
11426 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11427
11428         * cs-parser.jay: Fix small regression: we were not testing V2
11429         compiler features correctly.
11430
11431         * interface.cs: If the emit context is null, then create one
11432
11433 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11434
11435         * decl.cs (GetSignatureForError): New virtual method to get full name
11436           for error messages.
11437
11438         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11439           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11440
11441         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11442           Duplicated members and code in these classes has been removed.
11443           Better encapsulation in these classes.
11444
11445 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11446
11447         * assign.cs (Assign.DoResolve): When dealing with compound
11448         assignments, there is a new rule in ECMA C# 2.4 (might have been
11449         there before, but it is documented here) that states that in:
11450
11451         a op= b;
11452
11453         If b is of type int, and the `op' is a shift-operator, then the
11454         above is evaluated as:
11455
11456         a = (int) a op b 
11457
11458         * expression.cs (Binary.ResolveOperator): Instead of testing for
11459         int/uint/long/ulong, try to implicitly convert to any of those
11460         types and use that in pointer arithmetic.
11461
11462         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11463         method to print information for from the type, not from the
11464         null-method we were given.
11465
11466 2004-02-01  Duncan Mak  <duncan@ximian.com>
11467
11468         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11469         parsing for cmd, fixes bug #53694.
11470
11471 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11472
11473         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11474         in the member name duplication tests. Property and operator name duplication
11475         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11476
11477 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11478
11479         * interface.cs (PopulateMethod): Fixed crash when interface method
11480         returns not existing type (error test cs0246-3.cs).
11481
11482 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11483
11484         * cs-parser.jay (interface_accessors): Re-write actions to also
11485         store attributes attached to get and set methods. Fix spelling
11486         while at it.
11487
11488         (inteface_property_declaration): Modify accordingly.
11489
11490         (InterfaceAccessorInfo): New helper class to store information to pass
11491         around between rules that use interface_accessors.
11492
11493         * interface.cs (Emit): Apply attributes on the get and set
11494         accessors of properties and indexers too.
11495
11496         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11497         right MethodBuilder when applying attributes to the get and set accessors.
11498
11499 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11500
11501         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11502
11503 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11504
11505         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11506
11507 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11508
11509         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11510         changes that treat `yield' specially when present before `break'
11511         or `return' tokens.
11512
11513         * cs-tokenizer.cs: yield is no longer a keyword.
11514
11515 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11516
11517         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11518         setting for default constructors.
11519         For default constructors are almost every time set wrong Modifier. The
11520         generated IL code has been alright. But inside mcs this values was
11521         wrong and this was reason why several of my CLS Compliance tests
11522         failed.
11523
11524 2004-01-22  Martin Baulig  <martin@ximian.com>
11525
11526         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11527         not a QualifiedIdentifier.  This is what `type_name_expression'
11528         was previously doing.
11529         (type_name_expression): Removed; the code is now in
11530         `namespace_or_type_name'.
11531         (qualified_identifier): Removed, use `namespace_or_type_name'
11532         instead.
11533         (QualifiedIdentifier): Removed this class.      
11534
11535 2004-01-22  Martin Baulig  <martin@ximian.com>
11536
11537         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11538         not a string as alias name.
11539
11540 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11541
11542         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11543         #52730 bug, and instead compute correctly the need to use a
11544         temporary variable when requesting an address based on the
11545         static/instace modified of the field and the constructor.
11546  
11547 2004-01-21  Martin Baulig  <martin@ximian.com>
11548
11549         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11550         class and namespace before looking up aliases.  Fixes #52517.
11551
11552 2004-01-21  Martin Baulig  <martin@ximian.com>
11553
11554         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11555         assinged in a 'try'; fixes exception4.cs.
11556
11557 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11558         * class.cs : Implemented parameter-less constructor for TypeContainer
11559
11560         * decl.cs: Attributes are now stored here. New property OptAttributes
11561
11562         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11563
11564         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11565
11566 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11567
11568         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11569           (CSharpSignature): New method for indexer and property signature.
11570
11571 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11572
11573         * pending.cs (IsVirtualFilter): Faster implementation.
11574
11575 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11576
11577         * typemanager.cs: Avoid inclusion of same assembly more than once.
11578
11579 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11580
11581         * cs-parser.jay: Fixed problem where the last assembly attribute
11582           has been applied also to following declaration (class, struct, etc.)
11583           
11584 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11585
11586         * class.cs: Added error CS0538, CS0539 reporting.
11587         Fixed crash on Microsoft runtime when field type is void.
11588
11589         * cs-parser.jay: Added error CS0537 reporting.
11590
11591         * pending.cs: Added error CS0535 reporting.
11592         Improved error report for errors CS0536, CS0534.
11593
11594 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11595
11596         Merge a few bits from the Anonymous Method MCS tree.
11597
11598         * statement.cs (ToplevelBlock): New class for toplevel methods,
11599         will hold anonymous methods, lifted variables.
11600
11601         * cs-parser.jay: Create toplevel blocks for delegates and for
11602         regular blocks of code. 
11603
11604 2004-01-20  Martin Baulig  <martin@ximian.com>
11605
11606         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11607         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11608         and `NeedExplicitReturn'; added `IsLastStatement'.
11609         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11610         have a `ReturnLabel' or we're not unreachable.
11611
11612         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11613         child's reachability; don't just override ours with it.  Fixes
11614         #58058 (lluis's example).
11615         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11616         InFinally(), InLoop(), InSwitch() and
11617         BreakCrossesTryCatchBoundary() methods.
11618
11619         * statement.cs (Return): Do all error checking in Resolve().
11620         Unless we are the last statement in a top-level block, always
11621         create a return label and jump to it.
11622         (Break, Continue): Do all error checking in Resolve(); also make
11623         sure we aren't leaving a `finally'.
11624         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11625         statement in a top-level block.
11626         (Block.Flags): Added `IsDestructor'.
11627         (Block.IsDestructor): New public property.
11628
11629 2004-01-20  Martin Baulig  <martin@ximian.com>
11630
11631         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11632
11633 2004-01-20  Martin Baulig  <martin@ximian.com>
11634
11635         * statement.cs (Statement.ResolveUnreachable): New public method.
11636         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11637         (Block.Resolve): Resolve unreachable statements.
11638
11639 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11640
11641         * expression.cs: We need to fix the case where we do
11642         not have a temp variable here.
11643
11644         * assign.cs: Only expression compound assignments need
11645         temporary variables.
11646
11647 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11648
11649         * flowanalysis.cs: Reduce memory allocation in a few ways:
11650           - A block with no variables should not allocate a bit
11651             vector for itself.
11652           - A method with no out parameters does not need any tracking
11653             for assignment of the parameters, so we need not allocate
11654             any data for it.
11655           - The arrays:
11656                 public readonly Type[] VariableTypes;
11657                 public readonly string[] VariableNames;
11658             Are redundant. The data is already stored in the variable
11659             map, so we need not allocate another array for it.
11660           - We need to add alot of checks for if (params | locals) == null
11661             due to the first two changes.
11662
11663 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11666         implement IMemoryLocation, we store a copy on a local variable and
11667         take the address of it.  Patch from Benjamin Jemlich
11668
11669         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11670         to use a special "type_name_expression" rule which reduces the
11671         number of "QualifiedIdentifier" classes created, and instead
11672         directly creates MemberAccess expressions.
11673
11674 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11677         that fixes #52853.  Null literal assignment to ValueType
11678
11679         * class.cs (MethodData.Emit): Instead of checking the name of the
11680         method to determine if its a destructor, create a new derived
11681         class from Method called Destructor, and test for that.  
11682
11683         * cs-parser.jay: Create a Destructor object instead of a Method.  
11684
11685         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11686
11687         Fixes: 52933
11688
11689 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11690
11691         * expression.cs (Binary.ResolveOperator): Perform an implicit
11692         conversion from MethodGroups to their delegate types on the
11693         Addition operation.
11694
11695         * delegate.cs: Introduce a new class DelegateCreation that is the
11696         base class for `NewDelegate' and `ImplicitDelegateCreation',
11697         factor some code in here.
11698
11699         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11700         conversion from MethodGroups to compatible delegate types. 
11701
11702         * ecore.cs (Expression.Resolve): Do not flag error 654
11703         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11704         we allow conversions from MethodGroups to delegate types now.
11705
11706         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11707         assignments in v2 either.
11708
11709 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11710
11711         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11712         static read-only fields in ctors.
11713
11714         Applied patch from Benjamin Jemlich 
11715
11716         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11717
11718 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11719
11720         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11721         here to return true, as they can be used like this:
11722
11723                 (XXX) int.MEMBER ()
11724
11725         Fixed 49836 and all the other dups
11726
11727 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11728
11729         * driver.cs: Implement /win32res and /win32icon.
11730
11731 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11732
11733         * cs-parser.jay: Add a rule to improve error handling for the
11734         common mistake of placing modifiers after the type.
11735
11736 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11737
11738         * cs-parser.jay (interface_event_declaration): Catch
11739         initialization of events on interfaces, and report cs0068
11740
11741         * cs-parser.jay (interface_event_declaration): Catch
11742         initialization of events. 
11743
11744         * ecore.cs: Better report missing constructors.
11745
11746         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11747         the error reporting done in the wrong place.  Fix.
11748
11749         * expression.cs (Binary.ResolveOperator): Catch the 
11750         operator + (E x, E y) error earlier, and later allow for implicit
11751         conversions in operator +/- (E e, U x) from U to the underlying
11752         type of E.
11753
11754         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11755         52596, if the container class is abstract, the default constructor
11756         is protected otherwise its public (before, we were always public).
11757
11758         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11759         fixed statement.
11760
11761         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11762         Jemlich that fixes bug #52597, MCS was generating invalid code for
11763         idisposable structs.   Thanks to Ben for following up with this
11764         bug as well.
11765
11766 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11767
11768         * driver.cs: Allow assemblies without code to be generated, fixes
11769         52230.
11770
11771 2004-01-07  Nick Drochak <ndrochak@gol.com>
11772
11773         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11774
11775 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * cs-parser.jay: Add rules to improve error reporting if fields or
11778         methods are declared at the namespace level (error 116)
11779
11780         * Add rules to catch event add/remove
11781
11782 2004-01-04  David Sheldon <dave-mono@earth.li>
11783
11784   * expression.cs: Added matching ")" to error message for 
11785   CS0077
11786
11787 2004-01-03 Todd Berman <tberman@gentoo.org>
11788
11789         * ecore.cs, attribute.cs:
11790         Applying fix from #52429.
11791
11792 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11793
11794         * ecore.cs, expression.cs, statement.cs:
11795         Total rewrite of how we handle branching. We
11796         now handle complex boolean expressions with fewer
11797         jumps. As well if (x == 0) no longer emits a ceq.
11798
11799         if (x is Foo) is much faster now, because we generate
11800         better code.
11801
11802         Overall, we get a pretty big improvement on our benchmark
11803         tests. The code we generate is smaller and more readable.
11804
11805         I did a full two-stage bootstrap. The patch was reviewed
11806         by Martin and Miguel.
11807
11808 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11809
11810         * cs-parser.jay: Make primary_expression not take a QI.
11811         we dont need this because the member_access rule covers
11812         us here. So we replace the rule with just IDENTIFIER.
11813
11814         This has two good effects. First, we remove a s/r conflict.
11815         Second, we allocate many fewer QualifiedIdentifier objects.
11816
11817 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11818
11819         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11820         set the correct information via SRE. This prevents
11821         hanging on the MS runtime. Fixes #29374.
11822
11823 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11824
11825         * convert.cs: correctly handle conversions to value types
11826         from Enum and ValueType as unboxing conversions.
11827
11828         Fixes bug #52569. Patch by Benjamin Jemlich.
11829
11830 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11831
11832         * expression.cs (BetterConversion): Prefer int -> uint
11833         over int -> ulong (csc's behaviour). This fixed bug #52046.
11834
11835 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11836
11837         * decl.cs (MemberCache.FindMembers): now returns a
11838         MemberInfo [].
11839
11840         * typemanager.cs: In general, go with with ^^.
11841         (CopyNewMethods): take an IList.
11842         (RealMemberLookup): Only allocate an arraylist
11843         if we copy from two sets of methods.
11844
11845         This change basically does two things:
11846         1) Fewer array lists allocated due to CopyNewMethods.
11847         2) the explicit cast in MemberList costed ALOT.
11848
11849 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11850
11851         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11852         a hashtable to avoid needless string allocations when an identifier is
11853         used more than once (the common case).
11854
11855 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11856
11857         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11858         is broken, it will not return anything. So, we
11859         have to use the information we have in mcs to
11860         do the task.
11861
11862         * typemanager.cs: Add a cache for GetInterfaces,
11863         since this will now be used more often (due to ^^)
11864
11865         (GetExplicitInterfaces) New method that gets the
11866         declared, not effective, interfaces on a type
11867         builder (eg, if you have interface IFoo, interface
11868         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11869         { IBar }.
11870
11871         This patch makes MCS able to bootstrap itself on
11872         Windows again.
11873
11874 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11875
11876         * expression.cs: Remove the Nop's that Miguel put
11877         in by mistake.
11878
11879 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11880
11881         * report.cs, codegen.cs: Give the real stack trace to
11882         the error when an exception is thrown.
11883
11884 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11885
11886         * decl.cs: only allocate hashtables for ifaces if 
11887         it is an iface!
11888
11889 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11890
11891         * expression.cs: fix the error from cs0121-2.cs
11892         (a parent interface has two child interfaces that
11893         have a function with the same name and 0 params
11894         and the function is called through the parent).
11895
11896 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11897
11898         * class.cs, rootcontext.cs, typmanager.cs: do not
11899         leak pointers.
11900
11901 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11902
11903         * codegen.cs: remove stack for the ec flow branching.
11904         It is already a linked list, so no need.
11905
11906 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11907
11908         * Makefile: Allow custom profiler here.
11909
11910 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11911
11912         * typemanager.cs (LookupType):
11913           - Use a static char [], because split takes
11914             a param array for args, so it was allocating
11915             every time.
11916           - Do not store true in a hashtable, it boxes.
11917
11918 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11919
11920         * flowanalysis.cs: bytify common enums.
11921
11922 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11923
11924         * modifiers.cs: Add a new set of flags for the
11925         flags allowed on explicit interface impls.
11926         * cs-parser.jay: catch the use of modifiers in
11927         interfaces correctly.
11928         * class.cs: catch private void IFoo.Blah ().
11929
11930         All related to bug #50572.
11931
11932 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11933
11934         * decl.cs: Rewrite the consistant accessability checking.
11935         Accessability is not linear, it must be implemented in
11936         a tableish way. Fixes #49704.
11937
11938 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11939
11940         * expression.cs: Handle negation in a checked context.
11941         We must use subtraction from zero. Fixes #38674.
11942
11943 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11944
11945         * class.cs: Ignore static void main in DLLs.
11946         * rootcontext.cs: Handle the target type here,
11947         since we are have to access it from class.cs
11948         * driver.cs: account for the above.
11949
11950 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11951
11952         * report.cs: Give line numbers and files if available.
11953
11954 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11955
11956         * driver.cs: Implement /addmodule.
11957
11958         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11959         ModuleBuilders.
11960
11961 2003-12-20  Martin Baulig  <martin@ximian.com>
11962
11963         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11964         (FieldBase.IsAssigned): Removed this field.
11965         (FieldBase.SetAssigned): New public method.
11966         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11967
11968 2003-12-20  Martin Baulig  <martin@ximian.com>
11969
11970         * expression.cs (LocalVariableReference.DoResolve): Don't set
11971         `vi.Used' if we're called from DoResolveLValue().
11972
11973         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11974         returns the usage vector it just merged into the current one -
11975         pass this one to UsageWarning().
11976         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11977         of the `EmitContext', don't call this recursively on our children.
11978
11979 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11980
11981         * driver.cs: Implement /target:module.
11982
11983 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11984
11985         * support.cs (CharArrayHashtable): New helper class.
11986
11987         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11988         char arrays, not strings, so we can avoid creating a string in
11989         consume_identifier if the identifier is a keyword.
11990
11991 2003-12-16  Martin Baulig  <martin@ximian.com>
11992
11993         * statement.cs (LocalInfo.Assigned): Removed this property.
11994         (LocalInfo.Flags): Removed `Assigned'.
11995         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11996         and uses flow analysis.
11997         (Block.UsageWarning): Made this method private.
11998         (Block.Resolve): Call UsageWarning() if appropriate.
11999
12000         * expression.cs (LocalVariableReference.DoResolve): Always set
12001         LocalInfo.Used here.
12002
12003 2003-12-13  Martin Baulig  <martin@ximian.com>
12004
12005         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12006         any value here; we're now using flow analysis to figure out
12007         whether a statement/block returns a value.
12008
12009 2003-12-13  Martin Baulig  <martin@ximian.com>
12010
12011         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12012         working again.
12013         (FlowBranching.MergeFinally): Don't call
12014         `branching.CheckOutParameters()' here, this is called in
12015         MergeTopBlock().
12016         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12017         when adding the `finally' vector.       
12018
12019 2003-12-13  Martin Baulig  <martin@ximian.com>
12020
12021         * flowanalysis.cs
12022         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12023         actually work and also fix #48962.
12024
12025 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12026
12027         * decl.cs: Do not check System.Object for nested types,
12028         since we know it does not have any. Big bang for buck:
12029
12030         BEFORE:
12031            Run 1:   8.35 seconds
12032            Run 2:   8.32 seconds
12033            corlib:  17.99 seconds
12034         AFTER:
12035            Run 1:   8.17 seconds
12036            Run 2:   8.17 seconds
12037            corlib:  17.39 seconds
12038
12039 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12040
12041         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12042         time we are returning 0 members, so we save alot here.
12043
12044 2003-12-11  Martin Baulig  <martin@ximian.com>
12045
12046         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12047         `MergeChild()', also just take the `FlowBranching' as argument;
12048         call Merge() on it and return the result.
12049         (FlowBranching.Merge): We don't need to do anything if we just
12050         have one sibling.
12051
12052 2003-12-11  Martin Baulig  <martin@ximian.com>
12053
12054         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12055         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12056         Maurer for this idea.
12057
12058 2003-12-11  Martin Baulig  <martin@ximian.com>
12059
12060         * flowanalysis.cs (MergeResult): This class is now gone; we now
12061         use the `UsageVector' for this.  The reason for this is that if a
12062         branching just has one sibling, we don't need to "merge" them at
12063         all - that's the next step to do.
12064         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12065         `MergeResult'.
12066
12067 2003-12-11  Martin Baulig  <martin@ximian.com>
12068
12069         Reworked flow analyis and made it more precise and bug-free.  The
12070         most important change is that we're now using a special `Reachability'
12071         class instead of having "magic" meanings of `FlowReturns'.  I'll
12072         do some more cleanups and optimizations and also add some more
12073         documentation this week.
12074
12075         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12076         largely reworked this class.
12077         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12078         the new `Reachability' class instead of having "magic" values here.
12079         (FlowBranching): We're now using an instance of `Reachability'
12080         instead of having separate `Returns', `Breaks' etc. fields.
12081
12082         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12083         based on flow analysis; ignore the return value of block.Emit ().
12084
12085 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12086
12087         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12088         if they are private.
12089
12090 2003-12-09  Martin Baulig  <martin@ximian.com>
12091
12092         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12093         call them directly on the UsageVector.
12094
12095 2003-12-09  Martin Baulig  <martin@ximian.com>
12096
12097         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12098         Changed return type from `FlowReturns' to `Reachability'.
12099
12100 2003-12-09  Martin Baulig  <martin@ximian.com>
12101
12102         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12103         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12104         `Reachable' fields with a single `Reachability' one.
12105
12106 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12107
12108         * class.cs (FindMembers): Remove foreach's.
12109
12110         Bootstrap times:
12111
12112         BEFORE
12113                 Run 1:   8.74 seconds
12114                 Run 2:   8.71 seconds
12115
12116         AFTER
12117                 Run 1:   8.64 seconds
12118                 Run 2:   8.58 seconds
12119
12120
12121 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12122
12123         * cs-parser.jay:
12124         * gen-treedump.cs:
12125         * statement.cs:
12126         This patch does a few things:
12127                 1. EmptyStatement is now a singleton, so it is never reallocated.
12128                 2. All blah is EmptyStatement constructs have been changed to
12129                    blah == EmptyStatement.Value, which is much faster and valid
12130                    now that EmptyStatement is a singleton.
12131                 3. When resolving a block, rather than allocating a new array for
12132                    the non-empty statements, empty statements are replaced with
12133                    EmptyStatement.Value
12134                 4. Some recursive functions have been made non-recursive.
12135         Mainly the performance impact is from (3), however (1) and (2) are needed for
12136         this to work. (4) does not make a big difference in normal situations, however
12137         it makes the profile look saner.
12138
12139         Bootstrap times:
12140
12141         BEFORE
12142         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12143         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12144         Total memory allocated: 56397 KB
12145
12146         AFTER
12147         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12148         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12149         Total memory allocated: 55666 KB
12150
12151 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12152
12153         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12154         than the hashtable in a hashtable version
12155
12156         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12157         we always end up concating a string. This results in a huge perf
12158         loss, because many strings have to be tracked by the GC. In this
12159         patch, we first use a hashtable that works with two keys, so that
12160         the strings do not need to be concat'ed.
12161
12162         Bootstrap times:
12163         BEFORE
12164                 Run 1:   8.74 seconds
12165                 Run 2:   8.71 seconds
12166
12167         AFTER
12168                 Run 1:   8.65 seconds
12169                 Run 2:   8.56 seconds
12170
12171 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12172
12173         * Makefile: Add a new target `do-time' that does a quick and simple
12174         profile, leaving easy to parse output.
12175
12176 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12177
12178         * codegen.cs (Init): Create the dynamic assembly with 
12179         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12180
12181 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12182
12183         * support.cs: Make the PtrHashtable use only one
12184         instance of its comparer.
12185
12186 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12187
12188         * typemanager.cs: Fix lookup of GetNamespaces.
12189
12190 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12191
12192         * expression.cs: Removed redundant line.
12193
12194         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12195         ArrayLists, use for loops with bounds.  
12196
12197         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12198         arraylist.
12199
12200         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12201         arraylists, use for loop with bounds.
12202
12203         The above three changes give us a 0.071 second performance
12204         improvement out of 3.294 seconds down to 3.223.  On my machine
12205         the above changes reduced the memory usage by 1,387 KB during
12206         compiler bootstrap.
12207
12208         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12209         QualifiedIdentifiers.  Before we created a new string through
12210         concatenation, and mostly later on, the result would be
12211         manipulated by DecomposeQI through string manipulation.
12212
12213         This reduced the compiler memory usage for bootstrapping from
12214         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12215         compile times in 0.05 seconds.
12216
12217 2003-11-28  Dick Porter  <dick@ximian.com>
12218
12219         * support.cs: Do string compares with the Invariant culture.
12220
12221         * rootcontext.cs: 
12222         * gen-treedump.cs: 
12223         * expression.cs: 
12224         * driver.cs: 
12225         * decl.cs: 
12226         * codegen.cs: 
12227         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12228         the comparison is done with the Invariant culture.
12229
12230 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12231
12232         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12233         GetEnumerator method.
12234
12235         (ProbeCollectionType): Iterate starting at the most specific type
12236         upwards looking for a GetEnumerator
12237
12238         * expression.cs: Shift count can be up to 31 for int/uint and 63
12239         for long/ulong.
12240
12241 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12242
12243         * statement.cs (Block.LookupLabel): Also look for the label on the
12244         children blocks.  Use a hash table to keep track of visited
12245         nodes. 
12246
12247         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12248         we actually did transform the other operand, otherwise fall back
12249         to the common codepath that casts to long.
12250
12251         * cs-tokenizer.cs: Use the same code pattern as the int case.
12252         Maybe I should do the parsing myself, and avoid depending on the
12253         Parse routines to get this done.
12254
12255 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12256
12257         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12258         which fixes bug 51347.  This time test it.
12259
12260         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12261         attributes for example can not tell the difference between these.
12262         The difference was only a syntax feature of the language. 
12263
12264         * attribute.cs: Apply attributes to delegates.
12265
12266         * delegate.cs: Call the apply attributes method.
12267
12268 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12269
12270         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12271         comparing 0 vs Byte.MinValue, not the value
12272
12273         (ImplicitConversionRequired): When reporting a conversion error,
12274         use error 31 to print out the constant error instead of the
12275         simpler 29.
12276
12277         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12278         which fixes bug 51347.
12279
12280 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12281
12282         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12283         which fixes the -warnaserror command line option.
12284
12285 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12286
12287         * cfold.cs (DoNumericPromotions): During constant folding of
12288         additions on UIntConstant, special case intconstants with
12289         IntConstants like we do on the expression binary operator. 
12290
12291 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12292
12293         * convert.cs (ImplicitReferenceConversion): We were missing a case
12294         (System.Enum are not value types or class types, so we need to
12295         classify them separatedly).
12296
12297         * driver.cs: We do not support error 2007.
12298
12299 2003-11-12 Jackson Harper <jackson@ximian.com>
12300
12301         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12302         system directory. Also use the full file name so users can
12303         libraries names mscorlib-o-tron.dll in a non system dir.
12304
12305 2003-11-10  Martin Baulig  <martin@ximian.com>
12306
12307         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12308         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12309         calling `ResolveType()' on them, directly assign their `Type'.
12310
12311 2003-11-08  Martin Baulig  <martin@ximian.com>
12312
12313         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12314         return value and the `out parent' parameter.
12315         (TypeContainer.DefineType): Moved the CS0644 check into
12316         GetClassBases().  Don't pass the interface types to the
12317         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12318         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12319
12320         * ecore.cs (TypeExpr.IsAttribute): New property.
12321         (TypeExpr.GetInterfaces): New method.
12322
12323         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12324         TypeExpr instead of a Type.
12325         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12326         (Interface.DefineType): Don't pass the interface types to the
12327         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12328         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12329
12330         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12331         instead of a `Type[]'.
12332         (TypeManager.RegisterBuilder): Likewise.
12333         (TypeManager.AddUserInterface): Likewise.
12334         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12335         `Type[]' and also return a `TypeExpr[]'.
12336         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12337
12338 2003-11-08  Martin Baulig  <martin@ximian.com>
12339
12340         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12341         Expression.     
12342
12343 2003-11-08  Martin Baulig  <martin@ximian.com>
12344
12345         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12346         TypeManager.ResolveExpressionTypes().
12347
12348         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12349         instead of an Expression.
12350         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12351         (TypeExpression): New public class; formerly known as `TypeExpr'.
12352
12353         * expression.cs (ComposedCast): Derive from TypeExpr.
12354
12355         * typemanager.cs (TypeManager.system_*_expr): These are now
12356         TypExpr's instead of Expression's.
12357         (TypeManager.ResolveExpressionTypes): New public static function;
12358         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12359         of them.        
12360
12361 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12362
12363         * expression.cs (New.DoResolve): Do not dereference value that
12364         might be a null return.
12365
12366         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12367         sure that the constant value has the right type.  Fixes an
12368         unreported bug, similar to 50425.
12369
12370         * const.cs (Const.LookupConstantValue): Call
12371         ImplicitStandardConversionExists before doing a conversion to
12372         avoid havng the TypeManager.ChangeType do conversions.
12373
12374         Reduced the number of casts used
12375
12376         (Const.ChangeType): New routine to enable reuse of the constant
12377         type changing code from statement.
12378
12379         * typemanager.cs (ChangeType): Move common initialization to
12380         static global variables.
12381
12382         Fixes #50425.
12383
12384         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12385         every value type to go through, even if it was void.  Fix that. 
12386
12387         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12388         character of the define, and the is_identifier_part_character for
12389         the rest of the string.
12390
12391 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12392
12393         * expression.cs (UnaryMutator.EmitCode): When I updated
12394         LocalVariableReference.DoResolve, I overdid it, and dropped an
12395         optimization done on local variable references.
12396
12397 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12398
12399         * ecore.cs: Convert the return from Ldlen into an int.
12400
12401 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12402
12403         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12404         the accessibility, this is a special case for toplevel non-public
12405         classes (internal for instance).
12406
12407 2003-10-20  Nick Drochak <ndrochak@gol.com>
12408
12409         * ecore.cs: Fix typo and build.  Needed another right paren.
12410
12411 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12412
12413         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12414         `internal' case regular and protected, but not allowing protected
12415         to be evaluated later.  Bug 49840
12416
12417 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12418
12419         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12420         to kb.Nlast, and not the kb.nFirst to isolate the switch
12421         statement.
12422
12423         Extract the underlying type, so enumerations of long/ulong are
12424         treated like long/ulong.
12425
12426 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12427
12428         * expression.cs (New): Overload the meaning of RequestedType to
12429         track the possible creation of the NewDelegate type, since
12430         DoResolve is invoked more than once for new constructors on field
12431         initialization.
12432
12433         See bugs: #48800 and #37014
12434
12435         * cs-parser.jay (declare_local_constants): Take an arraylist
12436         instead of a single constant.
12437
12438         (local_constant_declaration): It should take a
12439         constant_declarators, not a constant_declarator.  Fixes 49487
12440
12441         * convert.cs: Fix error report.
12442
12443 2003-10-13 Jackson Harper <jackson@ximian.com>
12444
12445         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12446         bug #49611
12447
12448 2003-10-09  Martin Baulig  <martin@ximian.com>
12449
12450         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12451         to the .ctor.
12452         (MethodCore.DoDefineParameters): Removed the TypeContainer
12453         argument; use the DeclSpace which was passed to the .ctor instead.
12454         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12455         TypeContainer; we only need a DeclSpace here.
12456
12457 2003-10-09  Martin Baulig  <martin@ximian.com>
12458
12459         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12460         to the .ctor.
12461         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12462         EmitContext's .ctor.    
12463
12464 2003-10-09  Martin Baulig  <martin@ximian.com>
12465
12466         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12467         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12468         AsAccessible(), moved them as well.
12469
12470         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12471
12472 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12473
12474         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12475
12476 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12477
12478         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12479         generation for >=, as spotted by Paolo, bug 48679.  
12480         Patch from David Waite.
12481
12482         * cs-tokenizer.cs: Add handling for #pragma.
12483
12484         * cs-parser.jay: Allow for both yield and yield return in the
12485         syntax.  The anti-cobolization of C# fight will go on!
12486
12487         * class.cs (TypeBuilder.DefineType): Catch error condition here
12488         (Parent.DefineType erroring out and returning null).
12489
12490         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12491         coping with enumerations variables, we were mistakenly processing
12492         them as a regular value type instead of built-in types.  Fixes the
12493         bug #48063
12494
12495         * typemanager.cs (IsBuiltinOrEnum): New method.
12496
12497 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12498
12499         * cs-parser.jay: Upgrade: yield now needs the return clause.
12500
12501 2003-09-19  Martin Baulig  <martin@ximian.com>
12502
12503         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12504         `MemberCache parent' argument.  Normally, an interface doesn't
12505         have a parent type except System.Object, but we use this in gmcs
12506         for generic type parameters.
12507
12508 2003-09-18  Martin Baulig  <martin@ximian.com>
12509
12510         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12511         on `type.IsInterface'; don't check whether the type has a parent
12512         to determine whether it's an interface.
12513
12514 2003-09-15  Martin Baulig  <martin@ximian.com>
12515
12516         * class.cs (TypeContainer.DefineType): Added an error flag to
12517         avoid reporting duplicate CS0146's ("class definition is
12518         circular.").
12519
12520         * driver.cs (Driver.MainDriver): Abort if
12521         RootContext.ResolveTree() reported any errors.
12522
12523 2003-09-07  Martin Baulig  <martin@ximian.com>
12524
12525         * report.cs (Error, Warning): Added overloaded versions which take
12526         a `params object[] args' and call String.Format().
12527
12528 2003-09-07  Martin Baulig  <martin@ximian.com>
12529
12530         * decl.cs (DeclSpace..ctor): Don't call
12531         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12532         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12533         (DeclSpace.RecordDecl): New method.
12534
12535         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12536
12537 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12538
12539         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12540         value attributes to be applied to ParameterBuilders.
12541
12542         * class.cs (MethodCore.LabelParameters): Make static and more
12543         generic so that it can be used from other places - like interface
12544         methods, for instance.
12545
12546         * interface.cs (Interface.Emit): Call LabelParameters before
12547         emitting attributes on the InterfaceMethod.
12548
12549 2003-08-26  Martin Baulig  <martin@ximian.com>
12550
12551         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12552         resolving aliases; fixes #47927.
12553
12554 2003-08-26  Martin Baulig  <martin@ximian.com>
12555
12556         * statement.cs (Using.DoResolve): This is internally emitting a
12557         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12558         do not always return.  Fixes #47681.
12559
12560 2003-08-26  Martin Baulig  <martin@ximian.com>
12561
12562         * decl.cs (MemberCore): Moved WarningNotHiding(),
12563         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12564         into MemberBase.
12565         (AdditionResult): Make this nested in DeclSpace.
12566         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12567         argument; call NamespaceEntry.Define() unless we're nested in a
12568         class or struct.
12569
12570         * namespace.cs (Namespace.DefineName): New public function.  This
12571         is called from DeclSpace's .ctor to add 
12572         (Namespace.Lookup): Include DeclSpaces in the lookup.
12573
12574         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12575
12576         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12577
12578 2003-08-25  Martin Baulig  <martin@ximian.com>
12579
12580         * convert.cs (Convert.ExplicitReferenceConversion): When
12581         converting from an interface type to a class, unbox if the target
12582         type is a struct type.  Fixes #47822.
12583
12584 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12585
12586         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12587         #47854.
12588
12589 2003-08-22  Martin Baulig  <martin@ximian.com>
12590
12591         * class.cs (TypeManager.DefineType): When defining a nested type,
12592         call DefineType() on our parent; fixes #47801.
12593
12594 2003-08-22  Martin Baulig  <martin@ximian.com>
12595
12596         * class.cs (MethodData.Define): While checking if a method is an
12597         interface implementation, improve the test a bit more to fix #47654.
12598
12599 2003-08-22  Martin Baulig  <martin@ximian.com>
12600
12601         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12602         correctly; fixes #47722.
12603
12604 2003-08-22  Martin Baulig  <martin@ximian.com>
12605
12606         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12607         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12608
12609         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12610
12611 2003-08-22  Martin Baulig  <martin@ximian.com>
12612
12613         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12614         can only be assigned in static constructors.  Fixes #47161.
12615
12616 2003-08-22  Martin Baulig  <martin@ximian.com>
12617
12618         Rewrote and improved the flow analysis code.
12619
12620         * flowbranching.cs (FlowBranching): Make this class abstract.
12621         (FlowBranching.CreateBranching): New static function to create a
12622         new flow branching.
12623         (FlowBranchingBlock, FlowBranchingException): New classes.
12624         (FlowBranching.UsageVector.Type): New public readonly field.
12625         (FlowBranching.UsageVector.Breaks): Removed the setter.
12626         (FlowBranching.UsageVector.Returns): Removed the setter.
12627         (FlowBranching.UsageVector): Added Break(), Return(),
12628         NeverReachable() and Throw() methods to modify the reachability.
12629         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12630         done by FlowBranching.Merge().
12631         (FlowBranching.UsageVector.MergeChild): New method; merges the
12632         merge result into the current vector.
12633         (FlowBranching.Merge): New abstract method to merge a branching.
12634
12635 2003-08-12  Martin Baulig  <martin@ximian.com>
12636
12637         * expression.cs (Indirection.CacheTemporaries): Create the
12638         LocalTemporary with the pointer type, not its element type.
12639
12640 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12641
12642         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12643         token was a keyword or not.
12644
12645         Add `error' options where an IDENTIFIER was expected;  Provide
12646         CheckToken and CheckIdentifierToken convenience error reporting
12647         functions. 
12648
12649         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12650
12651         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12652         NameSpaceEntry NameSpaceEntry.
12653
12654         (LookupInterfaceOrClass): Avoid creating a full qualified name
12655         from namespace and name: avoid doing lookups when we know the
12656         namespace is non-existant.   Use new Tree.LookupByNamespace which
12657         looks up DeclSpaces based on their namespace, name pair.
12658
12659         * driver.cs: Provide a new `parser verbose' to display the
12660         exception thrown during parsing.  This is turned off by default
12661         now, so the output of a failure from mcs is more graceful.
12662
12663         * namespace.cs: Track all the namespaces defined in a hashtable
12664         for quick lookup.
12665
12666         (IsNamespace): New method
12667
12668 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12671         we know that we need to concatenate (full typename can never be
12672         null). 
12673
12674         * class.cs: ditto.
12675
12676         * statement.cs: Use a bitfield;  Do not initialize to null things
12677         which are done by the constructor by default.
12678
12679         * cs-parser.jay: bug fix, parameter was 4, not 3.
12680
12681         * expression.cs: Just use the property;
12682
12683         * statement.cs: No need for GetVariableInfo method.
12684
12685 2003-08-08  Martin Baulig  <martin@ximian.com>
12686
12687         * flowanalysis.cs (FlowReturns): This is now nested in the
12688         `FlowBranching' class.
12689         (MyBitVector): Moved this here from statement.cs.
12690         (FlowBranching.SiblingType): New enum type.
12691         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12692
12693 2003-08-07  Martin Baulig  <martin@ximian.com>
12694
12695         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12696         `FlowBranching' class and called `BranchingType'.
12697
12698 2003-08-07  Martin Baulig  <martin@ximian.com>
12699
12700         * flowanalysis.cs: Moved all the control flow analysis code into
12701         its own file.
12702
12703 2003-08-07  Martin Baulig  <martin@ximian.com>
12704
12705         * assign.cs (Assign.DoResolve): `target' must either be an
12706         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12707         #37319.
12708
12709 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12710
12711         * expression.cs (BinaryMethod): This kind of expression is created by the
12712         Binary class if it determines that the operator has to be handled
12713         by a method.
12714
12715         (BinaryDelegate): This kind of expression is created if we are
12716         dealing with a + or - operator on delegates.
12717
12718         (Binary): remove method, argumetns, and DelegateOperator: when
12719         dealing with methods, 
12720
12721         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12722
12723         * statement.cs (Block): use bitfields for the three extra booleans
12724         we had in use.   Remove unused topblock parameter.
12725
12726         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12727
12728         * assign.cs: Drop extra unneeded tests.
12729
12730 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12731
12732         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12733
12734         * statement.cs (Foreach): Use VariableStorage instead of
12735         LocalBuilders.   
12736
12737         * codegen.cs (VariableStorage): New class used by clients that
12738         require a variable stored: locals or fields for variables that
12739         need to live across yield.
12740
12741         Maybe provide a convenience api for EmitThis+EmitLoad?
12742
12743         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12744         these bad boys.
12745
12746 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12747
12748         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12749         RemapParameterLValue): New methods that are used to turn a
12750         precomputed FieldInfo into an expression like this:
12751
12752                 instance.FieldInfo
12753
12754         The idea is to use this instead of making LocalVariableReference
12755         have more than one meaning.
12756
12757         * cs-parser.jay: Add error production to BASE.
12758
12759         * ecore.cs: Deal with TypeManager.GetField returning null, which
12760         is now a valid return value.
12761
12762         (FieldExprNoAddress): New expression for Fields whose address can
12763         not be taken.
12764
12765         * expression.cs (LocalVariableReference): During the resolve
12766         phases, create new expressions if we are in a remapping context.
12767         Remove code that dealt with remapping here.
12768
12769         (ParameterReference): same.
12770
12771         (ProxyInstance): New expression, like the `This' expression, but
12772         it is born fully resolved.  We know what we are doing, so remove
12773         the errors that are targeted to user-provided uses of `this'.
12774
12775         * statement.cs (Foreach): our variable is now stored as an
12776         Expression;  During resolution, follow the protocol, dont just
12777         assume it will return this.
12778
12779 2003-08-06  Martin Baulig  <martin@ximian.com>
12780
12781         * support.cs (SeekableStreamReader.cs): New public class.
12782
12783         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12784         SeekableStreamReader instead of the normal StreamReader.
12785
12786 2003-08-04  Martin Baulig  <martin@ximian.com>
12787
12788         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12789         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12790         deambiguate casts and delegate invocations.
12791         (parenthesized_expression): Use the new tokens to ensure this is
12792         not a cast of method invocation.
12793
12794         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12795         when reading a `)' and Deambiguate_CloseParens () was previously
12796         called.
12797
12798         * expression.cs (ParenthesizedExpression): New class.  This is
12799         just used for the CS0075 test.
12800         (Binary.DoResolve): Check for CS0075.   
12801
12802 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12803
12804         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12805         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12806         reference comparison.
12807
12808         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12809         examine the ReturnType for equality - this is necessary in the
12810         cases of implicit and explicit operators whose signature also
12811         includes the return type.
12812
12813 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12814
12815         * namespace.cs: Cache the result of the namespace computation,
12816         instead of computing it every time.
12817
12818 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12819
12820         * decl.cs: Use a global arraylist that we reuse over invocations
12821         to avoid excesive memory consumption.  Reduces memory usage on an
12822         mcs compile by one meg (45 average).
12823
12824         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12825         private, work around that.
12826
12827 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12828
12829         * literal.cs (IntLiteral): Define Zero and One static literals. 
12830
12831         * cs-parser.jay (integer_literal): use static literals to reduce
12832         memory usage for the most used literals (0, 1 and -1).  211kb
12833         reduced in memory usage.
12834
12835         Replace all calls to `new ArrayList' with `new
12836         ArrayList(4)' which is a good average number for most allocations,
12837         and also requires only 16 bytes of memory for its buffer by
12838         default. 
12839
12840         This reduced MCS memory usage in seven megabytes for the RSS after
12841         bootstrapping.
12842
12843 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12844
12845         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12846         handle params methods the correct way by forming only one
12847         applicable set with params and normal methods in them. Earlier we
12848         were looking at params methods only if we found no normal methods
12849         which was not the correct thing to do.
12850
12851         (Invocation.BetterFunction): Take separate arguments indicating
12852         when candidate and the best method are params methods in their
12853         expanded form.
12854
12855         This fixes bugs #43367 and #46199.
12856
12857         * attribute.cs: Documentation updates.
12858
12859         (CheckAttribute): Rename to CheckAttributeTarget.
12860         (GetValidPlaces): Rename to GetValidTargets.
12861
12862         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12863         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12864
12865         Fixes bug #44468.
12866
12867 2003-07-28  Martin Baulig  <martin@ximian.com>
12868
12869         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12870         name when looking up the base class of a nested class.  Fixes #46977.
12871
12872 2003-07-26  Martin Baulig  <martin@ximian.com>
12873
12874         * expression.cs (Indexers.Indexer): New nested struct; contains
12875         getter, setter and the indexer's type.
12876         (Indexers.Properties): This is now an ArrayList of
12877         Indexers.Indexer's.
12878         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12879         indexer doesn't have any getters.
12880
12881         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12882         for embedded property and indexer assignments.
12883
12884 2003-07-26  Martin Baulig  <martin@ximian.com>
12885
12886         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12887         preprocessor directive is not the first non-whitespace character
12888         on a line.
12889
12890 2003-07-26  Martin Baulig  <martin@ximian.com>
12891
12892         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12893         namespace parsing, follow the spec more closely.
12894
12895         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12896         NamespaceEntry.Lookup().
12897
12898 2003-07-25  Martin Baulig  <martin@ximian.com>
12899
12900         * MethodCore.cs (OverridesSomething): New public field; it's set
12901         from TypeContainer.DefineMembers if this method overrides
12902         something (which doesn't need to be a method).  Fix #39462.
12903
12904 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12905
12906         * typemanager.cs (GetMembers): Ensure that the list of members is
12907         reversed. This keeps things in sync.
12908
12909         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12910         find an AttributeUsage attribute.
12911
12912         * expression.cs (Invocation.OverloadResolve): Perform the check
12913         which disallows Invoke to be directly called on a Delegate.
12914
12915         (Error_InvokeOnDelegate): Report error cs1533.
12916
12917 2003-07-25  Martin Baulig  <martin@ximian.com>
12918
12919         * expression.cs (Indexers.GetIndexersForType): Only look in the
12920         interface hierarchy if the requested type is already an
12921         interface.  Fixes #46788 while keeping #46502 fixed.
12922
12923 2003-07-25  Martin Baulig  <martin@ximian.com>
12924
12925         * class.cs (TypeContainer.DefineMembers): Check whether all
12926         readonly fields have been assigned and report warning CS0649 if
12927         not.
12928
12929         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12930         a valuetype.
12931
12932 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12933
12934         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12935         returned from GetMethods to make things consistent with the
12936         assumptions MCS makes about ordering of methods.
12937
12938         This should comprehensively fix bug #45127 and it does :-)
12939
12940         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12941         ordering is actually reverse.
12942
12943         * Clean up some debug messages I left lying around.
12944
12945         * interface.cs (Populate*): Get rid of code which emits attributes
12946         since the stage in which we emit attributes is the 'Emit' stage,
12947         not the define stage.
12948
12949         (Emit): Move attribute emission for interface members here.
12950
12951 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12952
12953         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12954         closely: we eliminate methods in base types when we have an
12955         applicable method in a top-level type.
12956
12957         Please see section 14.5.5.1 for an exact description of what goes
12958         on. 
12959
12960         This fixes bug #45127 and a host of other related to corlib compilation.
12961
12962         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12963         array is the method corresponding to the top-level type (this is
12964         because of the changes made to icall.c) so we change this
12965         accordingly.
12966
12967         (MethodGroupExpr.Name): This too.
12968
12969         * typemanager.cs (GetElementType): New method which does the right
12970         thing when compiling corlib. 
12971
12972         * everywhere: Make use of the above in the relevant places.
12973
12974 2003-07-22  Martin Baulig  <martin@ximian.com>
12975
12976         * cs-parser.jay (invocation_expression): Moved
12977         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12978         `cast_expression', but create a InvocationOrCast which later
12979         resolves to either an Invocation or a Cast.
12980
12981         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12982         method; call this before EmitStatement() to make sure that this
12983         expression can be used as a statement.
12984
12985         * expression.cs (InvocationOrCast): New class; resolves to either
12986         an Invocation or a Cast.
12987
12988         * statement.cs (StatementExpression): Call ResolveStatement() on
12989         the ExpressionStatement before emitting it.
12990
12991 2003-07-21  Martin Baulig  <martin@ximian.com>
12992
12993         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12994         `ref' and `out' attributes match; fixes #46220.
12995         (MemberAccess.ResolveMemberAccess): You can't reference a type
12996         through an expression; fixes #33180.
12997         (Indexers.GetIndexersForType): Don't return the indexers from
12998         interfaces the class implements; fixes #46502.
12999
13000 2003-07-21  Martin Baulig  <martin@ximian.com>
13001
13002         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13003         CS0661 checks; fixes bug #30442.
13004
13005 2003-07-21  Martin Baulig  <martin@ximian.com>
13006
13007         * decl.cs (AdditionResult): Added `Error'.
13008
13009         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13010
13011         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13012         makes cs0031.cs actually work.
13013
13014 2003-07-20  Martin Baulig  <martin@ximian.com>
13015
13016         * namespace.cs: Fixed that bug which caused a crash when compiling
13017         the debugger's GUI.
13018
13019 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13020
13021         * typemanager.cs (LookupTypeReflection): Never expose types which
13022         are NotPublic, NestedPrivate, NestedAssembly, or
13023         NestedFamANDAssem.  We used to return these, and later do a check
13024         that would report a meaningful error, but the problem is that we
13025         would not get the real match, if there was a name override.
13026
13027 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13028
13029         * namespace.cs (Namespace, Name): Do not compute the namespace
13030         name dynamically, compute it in the constructor.  This reduced
13031         memory usage by 1697 KB.
13032
13033         * driver.cs: Use --pause to pause at the end.
13034
13035 2003-07-17  Peter Williams  <peter@newton.cx>
13036
13037         * Makefile: Change the name of the test target so that it doesn't
13038         conflict with the recursive test target.
13039
13040 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13041
13042         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13043         AddressOf): Do not use EmitThis, that was wrong, use the actual
13044         this pointer.
13045
13046 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13047
13048         * class.cs (MethodData.Define): While checking if a method is an
13049         interface implementation, improve the test: If we are not public
13050         (use new test here: use the computed MethodAttributes directly,
13051         instead of the parsed modifier flags) check if the `implementing'
13052         method comes from an interface or not.
13053
13054         * pending.cs (VerifyPendingMethods): Slightly better error
13055         message.
13056
13057         * makefile: add test target that does the mcs bootstrap.
13058
13059 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13060
13061         * interface.cs (Define): Do nothing here since there are no
13062         members to populate etc. Move the attribute emission out of here
13063         since this was just totally the wrong place to put it. Attribute
13064         application happens during the 'Emit' phase, not in the 'Define'
13065         phase.
13066
13067         (Emit): Add this method and move the attribute emission here
13068
13069         * rootcontext.cs (EmitCode): Call the Emit method on interface
13070         types too.
13071
13072 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13073
13074         * expression.cs (OverloadResolve): Report error only if Location
13075         is not 'Null' which means that there was a probe going on.
13076
13077 2003-07-14  Martin Baulig  <martin@ximian.com>
13078
13079         * expression.cs (ConditionalLogicalOperator): New public class to
13080         implement user defined conditional logical operators.
13081         This is section 14.11.2 in the spec and bug #40505.
13082
13083 2003-07-14  Martin Baulig  <martin@ximian.com>
13084
13085         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13086
13087 2003-07-14  Martin Baulig  <martin@ximian.com>
13088
13089         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13090
13091         * ecore.cs (IVariable.VerifyFixed): New interface method.
13092
13093         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13094         operator, check whether the variable is actually fixed.  Fixes bug
13095         #36055.  Set a variable definitely assigned when taking its
13096         address as required by the spec.
13097
13098         * statement.cs (LocalInfo.IsFixed): New field.
13099         (LocalInfo.MakePinned): Set `IsFixed' to true.
13100
13101 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13102
13103         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13104         for .ctors, ensure that we only ask for members declared in the
13105         attribute type (BindingFlags.DeclaredOnly).
13106
13107         Fixes bug #43632.
13108
13109         * expression.cs (Error_WrongNumArguments): Report error 1501
13110         correctly the way CSC does.
13111
13112 2003-07-13  Martin Baulig  <martin@ximian.com>
13113
13114         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13115         lookup on the fully qualified name, to make things like "X.X" work
13116         where "X.X" is a fully qualified type name, but we also have a
13117         namespace "X" in the using list.  Fixes #41975.
13118
13119 2003-07-13  Martin Baulig  <martin@ximian.com>
13120
13121         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13122         function. If we're a CompoundAssign, we need to create an embedded
13123         CompoundAssign, not an embedded Assign.
13124         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13125         Fixes #45854.
13126
13127 2003-07-13  Martin Baulig  <martin@ximian.com>
13128
13129         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13130         work to fix bug #46088.
13131
13132 2003-07-13  Ravi Pratap <ravi@ximian.com>
13133
13134         * class.cs (Operator.Emit): Do not emit attributes here - it is
13135         taken care of by the Method class that we delegate too. This takes
13136         care of bug #45876.
13137
13138 2003-07-10  Martin Baulig  <martin@ximian.com>
13139
13140         * expression.cs (TypeOfVoid): New class.
13141         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13142
13143 2003-07-10  Martin Baulig  <martin@ximian.com>
13144
13145         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13146         bug #35957.
13147
13148 2003-07-10  Martin Baulig  <martin@ximian.com>
13149
13150         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13151         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13152
13153         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13154
13155         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13156
13157 2003-07-10  Martin Baulig  <martin@ximian.com>
13158
13159         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13160         of decimal.  Fixes #42850.
13161
13162         NOTE: I also fixed the created byte blob, but this doesn't work on
13163         the MS runtime and csc never produces any byte blobs for decimal
13164         arrays.
13165
13166 2003-07-10  Martin Baulig  <martin@ximian.com>
13167
13168         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13169         structs; fixes #32068.
13170         (Block.AddChildVariableNames): Fixed #44302.
13171
13172 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13173
13174         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13175
13176 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13177
13178         * attribute.cs: And this test is onger needed.
13179
13180 2003-07-08  Martin Baulig  <martin@ximian.com>
13181
13182         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13183         inaccessible types.  Fixes #36313.
13184
13185         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13186
13187         * namespace.cs (NamespaceEntry): Create implicit entries for all
13188         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13189         implicit entries for N1.N2 and N1.
13190
13191 2003-07-08  Martin Baulig  <martin@ximian.com>
13192
13193         Rewrote the handling of namespaces to fix a lot of the issues
13194         wrt. `using' aliases etc.
13195
13196         * namespace.cs (Namespace): Splitted this class into a
13197         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13198
13199         * typemanager.cs (TypeManager.IsNamespace): Removed.
13200         (TypeManager.ComputeNamespaces): Only compute namespaces from
13201         loaded assemblies here, not the namespaces from the assembly we're
13202         currently compiling.
13203
13204 2003-07-08  Martin Baulig  <martin@ximian.com>
13205
13206         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13207
13208 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13209
13210         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13211         already fixed it.  
13212
13213         I thought about the memory savings here, but LookupTypeReflection
13214         is used under already very constrained scenarios.  Compiling
13215         corlib or mcs only exposes one hit, so it would not really reduce
13216         any memory consumption.
13217
13218 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13219
13220         * typemanager.cs: fixes bug #45889 by only adding public types from
13221         other assemblies to the list of known types.
13222
13223 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13224
13225         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13226         on the type we resolved.
13227
13228 2003-07-05  Martin Baulig  <martin@ximian.com>
13229
13230         * pending.cs (PendingImplementation.ParentImplements): Don't
13231         create the proxy if the parent is abstract.
13232
13233         * class.cs (TypeContainer.DefineIndexers): Process explicit
13234         interface implementations first.  Fixes #37714.
13235
13236 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13237
13238         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13239         defined recursively;  but since we modify the input parameters
13240         (left is set to `this' temporarily), we reset this value if the
13241         left_is_explicit is false, which gives the original semantics to
13242         the code.  
13243
13244         * literal.cs (NullPointer): new class used to represent a null
13245         literal in a pointer context.
13246
13247         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13248         type is a pointer, use a NullPointer object instead of a
13249         NullLiteral.   Closes 43687
13250
13251         (ExplicitConversion): Convert pointer values using
13252         the conv opcode to the proper type.
13253
13254         * ecore.cs (New): change ValueTypeVariable property into a method,
13255         that returns whether the valuetype is suitable for being used.
13256
13257         * expression.cs (Binary.DoNumericPromotions): Only return if we
13258         the int constant was a valid uint, and we can return both left and
13259         right as uints.  If not, we continue processing, to trigger the
13260         type conversion.  This fixes 39018.
13261
13262         * statement.cs (Block.EmitMeta): During constant resolution, set
13263         the CurrentBlock property on the emitcontext, so that we resolve
13264         constants propertly.
13265
13266 2003-07-02  Martin Baulig  <martin@ximian.com>
13267
13268         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13269         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13270
13271         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13272         than emitting it here.
13273
13274         * statement.cs: Fixed some more flow analysis bugs.
13275
13276 2003-07-02  Martin Baulig  <martin@ximian.com>
13277
13278         * class.cs (MethodData.Define): When implementing interface
13279         methods, set Final unless we're Virtual.
13280
13281         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13282         check work for interface methods.
13283
13284 2003-07-01  Martin Baulig  <martin@ximian.com>
13285
13286         * ecore.cs (EmitContext.This): Replaced this property with a
13287         GetThis() method which takes a Location argument.  This ensures
13288         that we get the correct error location for a CS0188.
13289
13290 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13291
13292         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13293         ImplicitStandardConversion.
13294
13295         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13296
13297 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13298
13299         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13300         optimization.
13301
13302 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13303
13304         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13305         constructors.
13306
13307         (MethodData.Define): Turn off initlocals for unsafe methods.
13308
13309 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13310
13311         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13312         complete;  Fixes #37521.
13313
13314         * delegate.cs: Use Modifiers.TypeAttr to compute the
13315         TypeAttributes, instead of rolling our own.  This makes the flags
13316         correct for the delegates.
13317
13318 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13319
13320         * class.cs (Constructor.Define): Set the private flag for static
13321         constructors as well.
13322
13323         * cs-parser.jay (statement_expression): Set the return value to
13324         null, to avoid a crash when we catch an error.
13325
13326 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * cs-parser.jay: Applied patch from Jackson that adds support for
13329         extern and unsafe modifiers to destructor declarations.
13330
13331         * expression.cs: Report error 21 if the user is trying to index a
13332         System.Array.
13333
13334         * driver.cs: Add an error message, suggested by the bug report.
13335
13336         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13337         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13338
13339 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13340
13341         * namespace.cs: Add some information to reduce FAQs.
13342
13343 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13344
13345         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13346         underlying enumeration types.  Fixes #43915.
13347
13348         * expression.cs: Treat ushort/short as legal values to be used in
13349         bitwise operations.
13350
13351 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13352
13353         * delegate.cs: transfer custom attributes for paramenters from
13354         the delegate declaration to Invoke and BeginInvoke.
13355
13356 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13357
13358         * attribute.cs: handle custom marshalers and emit marshal info
13359         for fields, too.
13360
13361 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13362
13363         * makefile.gnu: Added anonymous.cs to the compiler sources.
13364
13365 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13366
13367         * iterators.cs: Change the name of the proxy class to include two
13368         underscores.
13369
13370         * cs-parser.jay: Update grammar to include anonymous methods.
13371
13372         * anonymous.cs: new file.
13373
13374 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13375
13376         * class.cs (Field.Define): Add missing test for pointers and
13377         safety. 
13378
13379 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13380
13381         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13382         we use the stobj opcode.
13383
13384         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13385         since it wasn't the correct fix. 
13386
13387         It still is puzzling that we are required to use stobj for IntPtr
13388         which seems to be a ValueType.
13389
13390 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13393         during regular simple name resolution.   Now, the trick is that
13394         instead of returning for processing the simplename, we do a
13395         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13396         contextual lookup type).   If a match is found, return that, if
13397         not, return for further composition.
13398
13399         This fixes long-standing 30485.
13400
13401         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13402         using the address to initialize an object, do an Stobj instead of
13403         using the regular Stelem.
13404
13405         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13406         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13407         Because if we are a BaseIndexerAccess that value will be true.
13408         Fixes 43643.
13409
13410         * statement.cs (GotoCase.Resolve): Return after reporting an
13411         error, do not attempt to continue. 
13412
13413         * expression.cs (PointerArithmetic.Emit): If our operand is a
13414         long, convert our constants to match the operand before
13415         multiplying.  Convert to I type before adding.   Fixes 43670.
13416
13417 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13418
13419         * enum.cs (ImplicitConversionExists) : Rename to
13420         ImplicitEnumConversionExists to remove ambiguity. 
13421
13422         * ecore.cs (NullCast): New type of cast expression class which
13423         basically is very similar to EmptyCast with the difference being
13424         it still is a constant since it is used only to cast a null to
13425         something else
13426         (eg. (string) null)
13427
13428         * convert.cs (ImplicitReferenceConversion): When casting a null
13429         literal, we return a NullCast.
13430
13431         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13432         should be around anymore.
13433
13434         The renaming (reported was slightly wrong). Corrections:
13435
13436         ConvertImplicitStandard -> ImplicitConversionStandard
13437         ConvertExplicitStandard -> ExplicitConversionStandard
13438
13439         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13440         before passing them in !
13441
13442         * convert.cs (ImplicitConversionStandard): When comparing for
13443         equal expr and target types, ensure that expr is not a
13444         NullLiteral.
13445
13446         In general, we must not be checking (expr_type ==
13447         target_type) in the top level conversion methods
13448         (ImplicitConversion, ExplicitConversion etc). This checking is
13449         done in the methods that they delegate to.
13450
13451 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13452
13453         * convert.cs: Move Error_CannotConvertType,
13454         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13455         ImplicitNumericConversion, ImplicitConversionExists,
13456         ImplicitUserConversionExists, StandardConversionExists,
13457         FindMostEncompassedType, FindMostSpecificSource,
13458         FindMostSpecificTarget, ImplicitUserConversion,
13459         ExplicitUserConversion, GetConversionOperators,
13460         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13461         TryImplicitIntConversion, Error_CannotConvertImplicit,
13462         ConvertImplicitRequired, ConvertNumericExplicit,
13463         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13464         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13465         its own file.
13466
13467         Perform the following renames:
13468
13469         StandardConversionExists -> ImplicitStandardConversionExists
13470         ConvertImplicit -> ImplicitConversion
13471         ConvertImplicitStandard -> ImplicitStandardConversion
13472         TryImplicitIntConversion -> ImplicitIntConversion
13473         ConvertImplicitRequired -> ImplicitConversionRequired
13474         ConvertNumericExplicit -> ExplicitNumericConversion
13475         ConvertReferenceExplicit -> ExplicitReferenceConversion
13476         ConvertExplicit -> ExplicitConversion
13477         ConvertExplicitStandard -> ExplicitStandardConversion
13478
13479 2003-05-19  Martin Baulig  <martin@ximian.com>
13480
13481         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13482         (TypeInfo): Added support for structs having structs as fields.
13483
13484         * ecore.cs (FieldExpr): Implement IVariable.
13485         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13486         VariableInfo for the field.
13487
13488 2003-05-18  Martin Baulig  <martin@ximian.com>
13489
13490         * expression.cs (This.DoResolve): Report a CS0027 if we're
13491         emitting a field initializer.
13492
13493 2003-05-18  Martin Baulig  <martin@ximian.com>
13494
13495         * expression.cs (This.ResolveBase): New public function.
13496         (This.DoResolve): Check for CS0188.
13497
13498         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13499         This.Resolve().
13500
13501         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13502         `instance_expression' to null if we don't have any non-static
13503         methods.
13504
13505 2003-05-18  Martin Baulig  <martin@ximian.com>
13506
13507         Reworked the way how local variables and parameters are handled by
13508         the flow analysis code.
13509
13510         * statement.cs (TypeInfo, VariableMap): New public classes.
13511         (VariableInfo): New public class.  This is now responsible for
13512         checking whether a variable has been assigned.  It is used for
13513         parameters and local variables.
13514         (Block.EmitMeta): Take the InternalParameters as argument; compute
13515         the layout of the flow vectors here.
13516         (Block.LocalMap, Block.ParameterMap): New public properties.
13517         (FlowBranching): The .ctor doesn't get the InternalParameters
13518         anymore since Block.EmitMeta() now computes the layout of the flow
13519         vector.
13520         (MyStructInfo): This class is now known as `StructInfo' and nested
13521         in `TypeInfo'; we don't access this directly anymore.
13522
13523         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13524         property and removed IsAssigned(), IsFieldAssigned(),
13525         SetAssigned() and SetFieldAssigned(); we now call them on the
13526         VariableInfo so we don't need to duplicate this code everywhere.
13527
13528         * expression.cs (ParameterReference): Added `Block block' argument
13529         to the .ctor.
13530         (LocalVariableReference, ParameterReference, This): The new
13531         VariableInfo class is now responsible for all the definite
13532         assignment stuff.
13533
13534         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13535         IsParameterAssigned, SetParameterAssigned): Removed.
13536
13537 2003-05-18  Martin Baulig  <martin@ximian.com>
13538
13539         * typemanager.cs (InitCoreTypes): Try calling
13540         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13541         the 3-args-version.  Corlib now also needs our `void_type'.
13542         (GetMethod): Added overloaded version which takes an optional
13543         `bool report_errors' to allow lookups of optional methods.
13544
13545 2003-05-12  Martin Baulig  <martin@ximian.com>
13546
13547         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13548         only used for locals and not for parameters.
13549
13550 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13551
13552         * support.cs (InternalParameters.ParameterType): Return the
13553         ExternalType of the parameter.
13554
13555         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13556         they were unused.
13557
13558 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13559
13560         * class.cs (MethodData.Define): Do not set the `newslot' on
13561         interface members, if they are also flagged as "override".
13562
13563         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13564         better code for ++i and i++.  This only works for static fields
13565         and local variables.
13566
13567         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13568         want to pull the DeclSpace out of the builder_to_declspace instead
13569         of the TypeBuilder (like in TypeContainer.FindMembers).
13570
13571         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13572         instead of LookupTypeContainer.  Fixes the crash on .NET for
13573         looking up interface members.
13574
13575         * const.cs: Create our own emit context during the Definition
13576         stage, so that constants are evaluated in the proper context, when
13577         a recursive definition happens.
13578
13579 2003-05-11  Martin Baulig  <martin@ximian.com>
13580
13581         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13582         new block for a switch section.
13583         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13584         the adding/lookup in the switch block.  Fixes #39828.
13585
13586 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13589         functionality: I needed to convert the data after I had performed
13590         the add/sub operation into the operands type size.
13591
13592         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13593         pass the type for the box operation, otherwise the resulting
13594         object would have been of type object.
13595
13596         (BoxedCast): Add constructor to specify the type to box as.
13597
13598 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13599
13600         * iterators.cs: I was reusing the `count' variable inadvertently,
13601         take steps to not allow this to happen.
13602
13603 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13604
13605         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13606         by creating an array at the point where the params starts and
13607         putting all those arguments there, then adjusting the size of the
13608         array.
13609
13610 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * expression.cs (New.AddressOf): Implement interface
13613         IMemoryLocation.  This is used when the `new' operator is used in
13614         the context of an invocation to a method on a value type.
13615
13616         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13617         example. 
13618
13619         * namespace.cs: Also check the using aliases here.
13620
13621         * driver.cs: Move the test for using validity after the types have
13622         been entered, so we do a single pass that also includes the using
13623         aliases. 
13624
13625         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13626         in the regular case.   CreateSiblingForFinally is doing extra
13627         error checking.
13628
13629         * attribute.cs (GetAttributeArgumentExpression): Store the result
13630         on an out value, and use the return value to indicate failure
13631         instead of using null (which is a valid return for Constant.GetValue).
13632
13633         * statement.cs: Perform the analysis flow for the increment
13634         portion after the statement, because this will be the real flow of
13635         execution.  Fixes #42385
13636
13637         * codegen.cs (EmitContext.EmitArgument,
13638         EmitContext.EmitStoreArgument): New helper functions when the
13639         RemapToProxy flag is set.
13640
13641         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13642         function.
13643
13644         Add support for remapping parameters. 
13645
13646         * iterators.cs: Propagate parameter values;  Store parameter
13647         values in the proxy classes.
13648
13649 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13650
13651         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13652         need a proxy reference;  I do not know what I was thinking
13653
13654         * cs-parser.jay (constructor_initializer): catch another error,
13655         and display nice message.
13656
13657         (field_declaration): catch void field declaration
13658         to flag a better error. 
13659
13660         * class.cs (MemberBase.CheckBase): Report an error instead of a
13661         warning if a new protected member is declared in a struct. 
13662         (Field.Define): catch the error of readonly/volatile.
13663
13664         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13665
13666         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13667         volatile variable is taken
13668
13669 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13670
13671         * statement.cs (Fixed.Resolve): Report an error if we are not in
13672         an unsafe context.
13673
13674 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * typemanager.cs: reuse the code that handles type clashes for
13677         delegates and enumerations.
13678
13679         * class.cs (Report28): Always report.
13680
13681         * expression.cs (EncodeAsAttribute): Allow nulls here.
13682
13683 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13684
13685         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13686         the functionality for testing whether an expression is valid for
13687         an attribute here.  Also handle the case of arrays of elements
13688         being stored. 
13689
13690         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13691         encoding a linear array into an array of objects that are suitable
13692         to be passed to an CustomAttributeBuilder.
13693
13694         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13695
13696         * ecore.cs: (FieldExpr): Handle field remapping here.
13697
13698         * iteratators.cs: Pass the instance variable (if the method is an
13699         instance method) to the constructors, so we can access the field
13700         variables on the class.
13701
13702         TODO: Test this with structs.  I think the THIS variable on
13703         structs might have to be a pointer, and not a refenrece
13704
13705 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13706
13707         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13708         local variables to fields in a proxy class.
13709
13710         * iterators.cs (PopulateProxy): Rename our internal fields to
13711         <XXX>.  
13712         Create a <THIS> field if we are an instance method, so we can
13713         reference our parent container variables.
13714         (MapVariable): Called back from the EmitContext code to enter a
13715         new variable to field mapping into the proxy class (we just create
13716         a FieldBuilder).
13717
13718         * expression.cs
13719         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13720         for using the remapped locals to fields.
13721
13722         I placed the code here, because that gives the same semantics to
13723         local variables, and only changes the Emit code.
13724
13725         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13726         statements inside iterators.
13727         (VariableInfo): Add a FieldBuilder for the cases when we are
13728         remapping local variables to fields in a proxy class
13729
13730         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13731         current_block != null.
13732
13733         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13734         not cope with strings, as it has been moved to the
13735         TableSwitchEmit.  Fixed bug in switch generation.
13736
13737         * expression.cs (New.DoResolve): Provide more context for the user
13738         when reporting an error.
13739
13740         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13741         pointers. 
13742
13743         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13744         check the permissions for it.  Note than in a type-resolution
13745         context the check was already present in DeclSpace.ResolveType,
13746         but was missing from the MemberAccess.
13747
13748         (ArrayCreation.CheckIndices): warn if the user has
13749         more nested levels of expressions, but there are no more
13750         dimensions specified.  Avoids crash on bug 41906.
13751
13752 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13753
13754         * statement.cs (Block): replace Implicit bool, for a generic
13755         flags.   
13756         New flag: `Unchecked'.  This is used during the EmitMeta phase
13757         (which is out-of-line with the regular Resolve/Emit process for a
13758         statement, as this is done ahead of time, but still gets a chance
13759         to call constant resolve).
13760
13761         (Block.Flags): new enum for adding a new flag.
13762
13763         (Block.EmitMeta): track the state of unchecked.
13764
13765         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13766         to enable constant resolution to work there as well.
13767
13768 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13769
13770         * typemanager.cs (ienumerable_type): Also look up
13771         System.Collections.IEnumerable. 
13772
13773 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13774
13775         TODO: Test more than one conditional per method.
13776
13777         * class.cs (Indexer.Define): Report the location where the user is
13778         referencing the unsupported feature.
13779
13780         (MethodData): Overload the use of `conditionals' to
13781         minimize the creation of needless ArrayLists.   This saves roughly
13782         212kb on my machine.
13783
13784         (Method): Implement the new IIteratorContainer interface.
13785         (Method.SetYields): Implement the method by setting the ModFlags
13786         to contain METHOD_YIELDS.
13787
13788         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13789         which just got set to null.
13790
13791         * iterators.cs: New file.
13792
13793         (Yield, YieldBreak): New statements.
13794
13795         * statement.cs (Return.Resolve): Flag an error if we are used in
13796         an iterator method.
13797
13798         * codegen.cs (InIterator): New flag set if the code is being
13799         compiled in an iterator method.
13800
13801         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13802         internal modifier, and we just use it to avoid adding extra
13803         fields, as this is seldom used.  
13804
13805         * cs-parser.jay: Add yield_statement (yield and yield break).
13806
13807         * driver.cs: New flag -v2 to turn on version 2 features. 
13808
13809         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13810         hashtable when v2 is enabled.
13811
13812 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13813
13814         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13815         there is already a namespace defined with this name.
13816
13817         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13818         people upgraded their corlibs.
13819
13820         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13821         always use fully qualified types, no need to use the compiler
13822         front end.
13823
13824         (TypeManager.IsNamespace): Use binarysearch.
13825
13826         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13827         AddDelegate): I did not quite use the new IsValid API properly: I
13828         have to pass the short-name and the fullname.  I was passing only
13829         the basename instead of the fullname sometimes. 
13830
13831         (TypeContainer.DefineType): call NamespaceClash.
13832
13833         * interface.cs (Interface.DefineType): use NamespaceClash before
13834         defining the type.
13835
13836         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13837         defining the type.
13838
13839         * enum.cs: (Enum.DefineType): use NamespaceClash before
13840         defining the type.
13841
13842         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13843         speed increase.  First, use the negative_hits cache when we get a
13844         negative.  Second, add the type with its full original name
13845         instead of the new . and + encoded name (reflection uses + to
13846         separate type from a nested type).  Use LookupTypeReflection
13847         directly which bypasses the type->name hashtable (that we already
13848         know does not contain the type.
13849
13850         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13851         location/container type. 
13852
13853         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13854
13855 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13856
13857         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13858
13859         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13860         method is being referenced in the method group from a static
13861         context, and report error 120 if so.
13862
13863         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13864         Error118. 
13865
13866         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13867         is created, we create the A namespace).
13868
13869         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13870         Fixes #41591
13871
13872 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13873
13874         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13875         invocation to ModuleBuilder.GetType with the same values will
13876         return a new type instance, so we need to cache its return
13877         values. 
13878
13879         * expression.cs (Binary.ResolveOperator): Only allow the compare
13880         operators on enums if they are of the same type.
13881
13882         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13883         types of ValueType on their own case.  Before we were giving them
13884         the same treatment as objects.
13885
13886         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13887         fullname.  Short name is used to compare against container name.
13888         Fullname is used to check against defined namespace names.
13889
13890         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13891         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13892
13893         (Method.CheckBase): Call parent.
13894         (MemberBase.CheckBase): Check for protected members on sealed
13895         classes.
13896         (PropertyBase.CheckBase): Call parent.
13897         (Field.Define): Call parent.
13898
13899         * report.cs: Negative error codes are now mapped to 8000 - code,
13900         so that the display is render more nicely.
13901
13902         * typemanager.cs: Do not use try/catch, instead report a regular
13903         error. 
13904
13905         (GetPointerType, GetReferenceType): These methods provide
13906         mechanisms to obtain the T* and T& from a T.  We had the code
13907         previously scattered around the code base, and it also used
13908         TypeManager.LookupType that would go through plenty of caches.
13909         This one goes directly to the type source.
13910
13911         In some places we did the Type.GetType followed by
13912         ModuleBuilder.GetType, but not in others, so this unifies the
13913         processing as well.
13914
13915         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13916         statements now that we have namespace information.
13917
13918         * typemanager.cs (IsNamespace): New method, returns whether the
13919         string presented is a namespace or not.
13920
13921         (ComputeNamespaces): New public entry point, computes the list of
13922         available namespaces, using the GetNamespaces API call in Mono, or
13923         the slower version in MS.NET.   
13924
13925         Now before we start the semantic analysis phase, we have a
13926         complete list of namespaces including everything that the user has
13927         provided.
13928
13929         Deleted old code to cache namespaces in .nsc files.
13930
13931 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13932
13933         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13934         class/struct location definition Location for the implicit
13935         constructor location.
13936
13937         (Operator.Define): Use the location of the operator for the
13938         implicit Method definition.
13939
13940         (Constructor.Emit): use the constructor location for the implicit
13941         base initializer constructor.
13942
13943         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13944         and the Expression class now contains two new methods:
13945
13946         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13947         isolate type lookup from the rest of the resolution process.
13948
13949         Since we use Expressions to hold type definitions due to the way
13950         we parse the input we have historically overloaded Resolve to
13951         perform the Type lookups if a special flag is passed.  Now this is
13952         eliminated and two methods take their place. 
13953
13954         The differences in the two methods between xStep and xTerminal is
13955         that xStep is involved in our current lookup system that uses
13956         SimpleNames to compose a name, while xTerminal is used just to
13957         catch the case where the simplename lookup failed.
13958
13959 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13960
13961         * expression.cs (ResolveMemberAccess): Remove redundant code.
13962         TypeExpr expressions are always born fully resolved.
13963
13964         * interface.cs (PopulateMethod): Do not lookup the types twice.
13965         We were doing it once during SemanticAnalysis and once during
13966         PopulateMethod.
13967
13968         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13969         in local variable type definitions, were being returned as a
13970         SimpleName (we decomposed everything into a string), that is
13971         because primary_expression was being used instead of a type in the
13972         grammar (reduce/reduce conflicts).
13973
13974         The part that was wrong is that we converted the expression into a
13975         string (an oversimplification in one hand, compounded with primary
13976         expressions doing string concatenation).
13977
13978         So things like:
13979
13980         A.B.C [] x;
13981
13982         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13983         using clauses from working on this particular context.  And a type
13984         was being matched directly against "A.B.C[]".
13985
13986         We now use the correct approach, and allow for ComposedCast to be
13987         part of the unary expression.  So the "A.B.C []" become a composed
13988         cast of "A.B.C" (as a nested group of MemberAccess with a
13989         SimpleName at the end) plus the rank composition "[]". 
13990
13991         Also fixes 35567
13992
13993 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13994
13995         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13996         for the access level checking.
13997
13998         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13999         `TypeContainer container', because I kept getting confused when I
14000         was debugging this code.
14001
14002         * expression.cs (Indexers): Instead of tracking getters/setters,
14003         we now track them in parallel.  We create one arraylist less, but
14004         most importantly it is possible now for the LValue code to find a
14005         matching get for a set.
14006
14007         (IndexerAccess.DoResolveLValue): Update the code.
14008         GetIndexersForType has been modified already to extract all the
14009         indexers from a type.  The code assumed it did not.
14010
14011         Also make the code set the correct return type for the indexer.
14012         This was fixed a long time ago for properties, but was missing for
14013         indexers.  It used to be void_type.
14014
14015         (Binary.Emit): Test first for doubles instead of
14016         floats, as they are more common.
14017
14018         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14019         when dealing with floats and the <=, >= operators.  This fixes bug
14020         #39314 
14021
14022         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14023         to load the array value by emitting a load on the foreach variable
14024         type.  This was incorrect.  
14025
14026         We now emit the code to load an element using the the array
14027         variable type, and then we emit the conversion operator.
14028
14029         Fixed #40176
14030
14031 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14032
14033         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14034
14035 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14036
14037         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14038         test for protection before we test for signatures. 
14039
14040         (MethodSignature.ToString): implement.
14041
14042         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14043         to the case where we reduced into a LongConstant.
14044
14045         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14046         depend on whether the information is acurrate, because the
14047         Microsoft runtime will always claim that the array type is public,
14048         regardless of the real state.
14049
14050         If the type is a pointer, another problem happens: the type is
14051         reported as non-public in Microsoft.  
14052
14053         In both cases we have to call CheckAccessLevel recursively with
14054         the underlying type as the argument to be tested.
14055
14056 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * assign.cs (Assign.Emit): If we are dealing with a compound
14059         assignment expression, we should use the code path that stores the
14060         intermediate result in a temporary value.  This fixes #40903.
14061
14062         *expression.cs (Indirection.ToString): Provide ToString method for
14063         debugging. 
14064
14065 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14066
14067         * class.cs: Null out fields holding references to Block objects so
14068         they can be garbage collected.
14069
14070         * expression.cs (OverloadResolve): Remove unused local.
14071
14072 2003-04-07  Martin Baulig  <martin@ximian.com>
14073
14074         * codegen.cs (EmitContext.CurrentFile): New public field.
14075         (EmitContext.Mark): Use the CurrentFile to check whether the
14076         location is in the correct file.
14077         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14078
14079 2003-04-07  Martin Baulig  <martin@ximian.com>
14080
14081         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14082
14083         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14084         location.  [FIXME: The location argument which gets passed to this
14085         method is sometimes wrong!]
14086
14087 2003-04-07  Nick Drochak <ndrochak@gol.com>
14088
14089         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14090
14091 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14092
14093         * expression.cs (Indirection.EmitAssign): We were using the
14094         temporary, but returning immediately instead of continuing the
14095         EmitAssing flow.
14096
14097 2003-04-06  Martin Baulig  <martin@ximian.com>
14098
14099         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14100         if it's a nested child, but also deriving from the outer class.
14101         See test 190.cs.
14102
14103         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14104         nested child, but also deriving from the outer class.  See
14105         test-190.cs.
14106         (FilterWithClosure): We may access private members of the outer
14107         class if we're a nested child and deriving from the outer class.
14108         (RealMemberLookup): Only set `closure_private_ok' if the
14109         `original_bf' contained BindingFlags.NonPublic.
14110
14111 2003-04-05  Martin Baulig  <martin@ximian.com>
14112
14113         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14114
14115 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14116
14117         * class.cs (Event.Define): Do not allow abstract events to have
14118         initializers. 
14119
14120 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14123         block in event declarations.
14124
14125         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14126         value type, get its address.
14127
14128         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14129         leaving a class on the stack instead of a boolean value (int
14130         0/1).  Change the code so we compare against null, and then the
14131         result against zero.
14132
14133         * class.cs (TypeContainer.GetClassBases): We were checking for the
14134         parent class being sealed too late.
14135
14136         * expression.cs (Binary.Emit): For <= and >= when dealing with
14137         floating point values, use cgt.un and clt.un instead of cgt and
14138         clt alone.
14139
14140 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14141
14142         * statement.cs: Apply the same optimization as MS: skip the 
14143         GetEnumerator returning an IEnumerator, and use the one returning a 
14144         CharEnumerator instead. This allows us to avoid the try-finally block 
14145         and the boxing.
14146
14147 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14148
14149         * cs-parser.jay: Attributes cannot be applied to
14150                          namespaces. Fixes #40473
14151
14152 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14153
14154         * class.cs:
14155         (Add*): check if the name is valid using the full name for constants,
14156         fields, properties and events.
14157
14158 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14159
14160         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14161         char constants to be part of the enumeration.
14162
14163         * expression.cs (Conditional.DoResolve): Add support for operator
14164         true. Implements the missing functionality from 14.12
14165
14166         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14167         operator true/false as required by the spec.
14168
14169         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14170         implicit conversion to boolean.
14171
14172         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14173         also one where the type implements `operator true'. 
14174
14175         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14176         get an expression that will invoke operator true based on an
14177         expression.  
14178
14179         (GetConversionOperators): Removed the hack that called op_True
14180         here.  
14181
14182         (Expression.ResolveBoolean): Move this from Statement.
14183
14184 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14185
14186         * ecore.cs (FieldExpr): do not allow initialization of initonly
14187         fields on derived classes
14188
14189 2003-03-13  Martin Baulig  <martin@ximian.com>
14190
14191         * statement.cs (Block.Emit): Call ig.BeginScope() and
14192         ig.EndScope() when compiling with debugging info; call
14193         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14194
14195 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14196
14197         * expression.cs (Indexers): Do not construct immediately, allow
14198         for new members to be appended as we go.  Fixes 38143
14199
14200 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14201
14202         * expression.cs: save/restore context when resolving an unchecked
14203         expression.
14204
14205 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14206
14207         * cfold.cs: Catch division by zero in modulus operator during
14208         constant folding.
14209
14210 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * interface.cs (Interface.DefineMembers): Avoid defining members
14213         twice. 
14214
14215 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14216
14217         * driver.cs: handle the +/- options for -noconfig
14218
14219         * statement.cs (Unckeched.Resolve): Also track the state of
14220         unchecked in the Resolve phase.
14221
14222 2003-02-27  Martin Baulig  <martin@ximian.com>
14223
14224         * ecore.cs (Expression.MemberLookup): Don't create a
14225         MethodGroupExpr for something which is not a method.  Fixes #38291.
14226
14227 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14228
14229         * class.cs (MemberBase.CheckParameters): Also check that the type
14230         is unmanaged if it is a pointer.
14231
14232         * expression.cs (SizeOf.Resolve): Add location information.
14233
14234         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14235         a managed type is declared.
14236
14237         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14238         parameter modifiers as well.  Fixes bug 38606
14239
14240         * class.cs: Very sad.  Am backing out the speed up changes
14241         introduced by the ArrayList -> Array in the TypeContainer, as they
14242         were not actually that much faster, and introduced a bug (no error
14243         reports on duplicated methods).
14244
14245         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14246         source first, this will guarantee that we have a valid expression
14247         before calling in lower levels functions that will require a
14248         resolved object.  Then use this original_source in the
14249         target.ResolveLValue instead of the original source that was
14250         passed to us.
14251
14252         Another change.  Use target.Resolve instead of LValueResolve.
14253         Although we are resolving for LValues, we will let the Assign code
14254         take care of that (it will be called again from Resolve).  This
14255         basically allows code like this:
14256
14257         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14258         class Y { void A (X x) { x [0] += o; }
14259
14260         The problem was that the indexer was trying to resolve for
14261         set_Item (idx, object o) and never finding one.  The real set_Item
14262         was set_Item (idx, X).  By delaying the process we get the right
14263         semantics. 
14264
14265         Fixes bug 36505
14266
14267 2003-02-23  Martin Baulig  <martin@ximian.com>
14268
14269         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14270         while calling DoEmit ().
14271
14272         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14273         source files; if you use the #line directive inside a method, the
14274         compiler stops emitting line numbers for the debugger until it
14275         reaches the end of the method or another #line directive which
14276         restores the original file.
14277
14278 2003-02-23  Martin Baulig  <martin@ximian.com>
14279
14280         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14281
14282 2003-02-23  Martin Baulig  <martin@ximian.com>
14283
14284         * statement.cs (Block.AddChildVariableNames): We need to call this
14285         recursively, not just for our immediate children.
14286
14287 2003-02-23  Martin Baulig  <martin@ximian.com>
14288
14289         * class.cs (Event.Define): Always make the field private, like csc does.
14290
14291         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14292         actually work, fixes bug #37521.
14293
14294 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14295
14296         * delegate.cs: When creating the various temporary "Parameters"
14297         classes, make sure that we call the ComputeAndDefineParameterTypes
14298         on those new parameters (just like we do with the formal ones), to
14299         allow them to be resolved in the context of the DeclSpace.
14300
14301         This fixes the bug that Dick observed in Bugzilla #38530.
14302
14303 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14304
14305         * expression.cs (ResolveMemberAccess): When resolving a constant,
14306         do not attempt to pull a constant if the value was not able to
14307         generate a valid constant.
14308
14309         * const.cs (LookupConstantValue): Do not report more errors than required.
14310
14311 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14312
14313         * expression.cs: fixes bug #38328.
14314
14315 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14316
14317         * class.cs: Changed all the various members that can be part of a
14318         class from being an ArrayList to be an Array of the right type.
14319         During the DefineType type_list, interface_list, delegate_list and
14320         enum_list are turned into types, interfaces, delegates and enums
14321         arrays.  
14322
14323         And during the member population, indexer_list, event_list,
14324         constant_list, field_list, instance_constructor_list, method_list,
14325         operator_list and property_list are turned into their real arrays.
14326
14327         Although we could probably perform this operation earlier, for
14328         good error reporting we need to keep the lists and remove the
14329         lists for longer than required.
14330
14331         This optimization was triggered by Paolo profiling the compiler
14332         speed on the output of `gen-sample-program.pl' perl script. 
14333
14334         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14335         not crash in methods like MemberLookupFailed that use this field.  
14336
14337         This problem arises when the compiler fails to resolve a type
14338         during interface type definition for example.
14339
14340 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14341
14342         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14343         inherit from System.Object, so we have to stop at null, not only
14344         when reaching System.Object.
14345
14346 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14347
14348         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14349         DeclaredOnly because the parent indexer might have had a different
14350         name, but did not loop until the top of the hierarchy was reached.
14351
14352         The problem this one fixes is 35492: when a class implemented an
14353         indexer from an interface, we were getting the interface method
14354         (which was abstract) and we were flagging an error (can not invoke
14355         abstract method).
14356
14357         This also keeps bug 33089 functioning, and test-148 functioning.
14358
14359         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14360         out if a method is special is to see if it is declared in a
14361         property or event, or whether it is one of the predefined operator
14362         names.   This should fix correctly #36804.
14363
14364 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14365
14366         The goal here is to remove the dependency on EmptyCast.Peel ().
14367         Killing it completely.
14368
14369         The problem is that currently in a number of places where
14370         constants are expected, we have to "probe" for an EmptyCast, and
14371         Peel, which is not the correct thing to do, as this will be
14372         repetitive and will likely lead to errors. 
14373
14374         The idea is to remove any EmptyCasts that are used in casts that
14375         can be reduced to constants, so we only have to cope with
14376         constants. 
14377
14378         This bug hunt was triggered by Bug 37363 and the desire to remove
14379         the duplicate pattern where we were "peeling" emptycasts to check
14380         whether they were constants.  Now constants will always be
14381         constants.
14382
14383         * ecore.cs: Use an enumconstant here instead of wrapping with
14384         EmptyCast.  
14385
14386         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14387         throwing me off.  By handling this we can get rid of a few hacks.
14388
14389         * statement.cs (Switch): Removed Peel() code.
14390
14391 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * class.cs: Location information for error 508
14394
14395         * expression.cs (New.DoResolve): Add a guard against double
14396         resolution of an expression.  
14397
14398         The New DoResolve might be called twice when initializing field
14399         expressions (see EmitFieldInitializers, the call to
14400         GetInitializerExpression will perform a resolve on the expression,
14401         and later the assign will trigger another resolution
14402
14403         This leads to bugs (#37014)
14404
14405         * delegate.cs: The signature for EndInvoke should contain any ref
14406         or out parameters as well.  We were not doing this in the past. 
14407
14408         * class.cs (Field.Define): Do not overwrite the type definition
14409         inside the `volatile' group.  Turns out that volatile enumerations
14410         were changing the type here to perform a validity test, which
14411         broke conversions. 
14412
14413 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14414
14415         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14416         and structs, we do not want to load the instance variable
14417
14418         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14419         enum_type has to be handled like an object reference (implicit
14420         conversions exists from this to object), but the regular IsClass
14421         and IsValueType tests will never return true for this one.
14422
14423         Also we use TypeManager.IsValueType instead of type.IsValueType,
14424         just for consistency with the rest of the code (this is only
14425         needed if we ever use the construct exposed by test-180.cs inside
14426         corlib, which we dont today).
14427
14428 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14429
14430         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14431         just InternalCall.
14432
14433 2003-02-09  Martin Baulig  <martin@ximian.com>
14434
14435         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14436         (Namespace.DefineNamespaces): New static public method; this is
14437         called when we're compiling with debugging to add all namespaces
14438         to the symbol file.
14439
14440         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14441         pass it to the Namespace's .ctor.
14442
14443         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14444         and MethodBase arguments; pass the namespace ID to the symwriter;
14445         pass the MethodBase instead of the token to the symwriter.
14446         (SymbolWriter.DefineNamespace): New method to add a namespace to
14447         the symbol file.
14448
14449 2003-02-09  Martin Baulig  <martin@ximian.com>
14450
14451         * symbolwriter.cs: New file.  This is a wrapper around
14452         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14453         methods here in near future.
14454
14455 2003-02-09  Martin Baulig  <martin@ximian.com>
14456
14457         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14458         ILGenerator.MarkSequencePoint() which are actually used by the
14459         symbol writer.
14460
14461 2003-02-09  Martin Baulig  <martin@ximian.com>
14462
14463         * location.cs (SourceFile): New public sealed class.  This
14464         contains the name and an index which is used in the location's token.
14465         (Location): Reserve an appropriate number of bits in the token for
14466         the source file instead of walking over that list, this gives us a
14467         really huge performance improvement when compiling with debugging.
14468
14469         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14470         `SourceFile' argument instead of a string.
14471         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14472         but don't parse/tokenize here, we need to generate the list of all
14473         source files before we do that.
14474         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14475         the files.
14476
14477         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14478         instead of a string.
14479
14480         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14481         of a string.
14482
14483 2003-02-09  Martin Baulig  <martin@ximian.com>
14484
14485         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14486         filename on `#line default'.
14487
14488 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14489
14490         * statement.cs: don't clear the pinned var when the fixed statement
14491         returns from the method (fixes bug#37752).
14492
14493 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14494
14495         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14496         to IsValueType.
14497
14498 2003-02-07  Martin Baulig  <martin@ximian.com>
14499
14500         * driver.cs: Removed the `--debug-args' command line argument.
14501
14502         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14503         automatically by the AsssemblyBuilder.
14504         (CodeGen.InitializeSymbolWriter): We don't need to call any
14505         initialization function on the symbol writer anymore.  This method
14506         doesn't take any arguments.
14507
14508 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14511         from referenced assemblies as well.
14512
14513 2003-02-02  Martin Baulig  <martin@ximian.com>
14514
14515         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14516
14517 2003-02-02  Martin Baulig  <martin@ximian.com>
14518
14519         * class.cs (Constructor.Emit): Open the symbol writer before
14520         emitting the constructor initializer.
14521         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14522         single-stepping through constructor initializers.
14523
14524 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14525
14526         * class.cs: Handle error 549: do not allow virtual methods in
14527         sealed classes. 
14528
14529 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14530
14531         * decl.cs: Check access levels when resolving types
14532
14533 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14534
14535         * statement.cs: Add parameters and locals set in catch blocks that might 
14536         return to set vector
14537
14538 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * class.cs (Operator): Set the SpecialName flags for operators.
14541
14542         * expression.cs (Invocation.DoResolve): Only block calls to
14543         accessors and operators on SpecialName methods.
14544
14545         (Cast.TryReduce): Handle conversions from char constants.
14546
14547
14548 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14549
14550         * statement.cs: small memory and time optimization in FlowBranching.
14551
14552 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14553
14554         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14555         problem that the last fix but in the other sid (Set).
14556
14557         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14558         access when there is no indexer in the hierarchy.
14559
14560 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14561
14562         * class.cs: Combine some if statements.
14563
14564 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14565
14566         * driver.cs: fixed bug #37187.
14567
14568 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14569
14570         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14571         any indexer, it's needed to build a list with all the indexers in the
14572         hierarchy (AllGetters), else we have problems. Fixes #35653.
14573
14574 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14575
14576         * class.cs (MethodData.Define): It is wrong for an interface
14577         implementation to be static in both cases: explicit and implicit.
14578         We were only handling this in one case.
14579
14580         Improve the if situation there to not have negations.
14581
14582         * class.cs (Field.Define): Turns out that we do not need to check
14583         the unsafe bit on field definition, only on usage.  Remove the test.
14584
14585 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14586
14587         * driver.cs: use assembly.Location instead of Codebase (the latest
14588         patch made mcs fail when using MS assemblies).
14589
14590 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14591
14592         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14593         get the path to *corlib.dll.
14594
14595 2003-01-21  Nick Drochak <ndrochak@gol.com>
14596
14597         * cs-tokenizer.cs:
14598         * pending.cs:
14599         * typemanager.cs: Remove compiler warnings
14600
14601 2003-01-20  Duncan Mak  <duncan@ximian.com>
14602
14603         * AssemblyInfo.cs: Bump the version number to 0.19.
14604
14605 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14606
14607         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14608
14609 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14610
14611         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14612
14613 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14614
14615         * cs-parser.jay: Small fix: we were not comparing the constructor
14616         name correctly.   Thanks to Zoltan for the initial pointer.
14617
14618 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14619
14620         * cs-tokenizer.cs: Set file name when specified with #line
14621
14622 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14623
14624         * cs-parser.jay: Only perform the constructor checks here if we
14625         are named like the class;  This will help provider a better
14626         error.  The constructor path is taken when a type definition is
14627         not found, but most likely the user forgot to add the type, so
14628         report that rather than the constructor error.
14629
14630 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14631
14632         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14633         allocations.
14634
14635 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14636
14637         * cs-parser.jay: Add cleanup call.
14638
14639 2003-01-13  Duncan Mak  <duncan@ximian.com>
14640
14641         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14642         consistent with other methods.
14643
14644 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14645
14646         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14647
14648 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14649
14650         * attribute.cs: only set GuidAttr to true when we have a
14651         GuidAttribute.
14652
14653 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14654
14655         * ecore.cs:
14656         * expression.cs:
14657         * typemanager.cs: fixes to allow mcs compile corlib with the new
14658         Type.IsSubclassOf fix.
14659
14660 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * expression.cs (LocalVariableReference.DoResolve): Classify a
14663         constant as a value, not as a variable.   Also, set the type for
14664         the variable.
14665
14666         * cs-parser.jay (fixed_statement): take a type instead of a
14667         pointer_type, so we can produce a better error message later.
14668
14669         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14670         as an error.  
14671
14672         (For.DoEmit): Make inifinite loops have a
14673         non-conditional branch back.
14674
14675         (Fixed.DoEmit): First populate the pinned variables, then emit the
14676         statement, then clear the variables.  Before I was emitting the
14677         code once for each fixed piece.
14678
14679
14680 2003-01-08  Martin Baulig  <martin@ximian.com>
14681
14682         * statement.cs (FlowBranching.MergeChild): A break in a
14683         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14684
14685 2003-01-08  Martin Baulig  <martin@ximian.com>
14686
14687         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14688         lives in the same number space than `param_map'.  Fixes #36154.
14689
14690 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14691
14692         * cs-parser.jay (constructor_declaration): Set the
14693         Constructor.ModFlags before probing for it.  This makes the
14694         compiler report 514, 515 and 132 (the code was there, but got
14695         broken). 
14696
14697         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14698         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14699         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14700
14701 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14702
14703         * enum.cs: create the enum static fields using the enum type.
14704
14705 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14706
14707         * class.cs: don't try to create the ParamBuilder for the return
14708         type if it's not needed (and handle it breaking for the ms runtime
14709         anyway).
14710
14711 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14712
14713         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14714
14715 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14718         the command.   This showed up while compiling the JANET source
14719         code, which used \r as its only newline separator.
14720
14721 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * class.cs (Method.Define): If we are an operator (because it
14724         reuses our code), then set the SpecialName and HideBySig.  #36128
14725
14726 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14727
14728         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14729         exception, report error 120 `object reference required'.
14730
14731         * driver.cs: Add --pause option, used during to measure the size
14732         of the process as it goes with --timestamp.
14733
14734         * expression.cs (Invocation.DoResolve): Do not allow methods with
14735         SpecialName to be invoked.
14736
14737 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14738
14739         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14740         number before adding it.
14741
14742 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14743
14744         * ecore.cs (StandardImplicitConversion): When in an unsafe
14745         context, we allow conversion between void * to any other pointer
14746         type. This fixes bug #35973.
14747
14748 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14749
14750         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14751         is not thrown when extensionless outputs are used 
14752
14753 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14754
14755         * rootcontext.cs: fixed compilation of corlib.
14756
14757 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * attribute.cs (Attributes.Contains): Add new method.
14760
14761         * class.cs (MethodCore.LabelParameters): if the parameter is an
14762         `out' parameter, check that no attribute `[In]' has been passed.
14763
14764         * enum.cs: Handle the `value__' name in an enumeration.
14765
14766 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14767
14768         * decl.cs: Added special case to allow overrides on "protected
14769         internal" methods
14770
14771 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14772
14773         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14774         since it makes much more sense.
14775
14776         (Attributes.ctor): Don't require a Location parameter.
14777
14778         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14779
14780         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14781         since we already have that information per attribute.
14782
14783         * everywhere : make appropriate changes.
14784
14785         * class.cs (LabelParameters): Write the code which actually
14786         applies attributes to the return type. We can't do this on the MS
14787         .NET runtime so we flag a warning in the case an exception is
14788         thrown.
14789
14790 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * const.cs: Handle implicit null conversions here too.
14793
14794 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14795
14796         * class.cs (MethodCore.LabelParameters): Remove the extra
14797         Type [] parameter since it is completely unnecessary. Instead
14798         pass in the method's attributes so that we can extract
14799         the "return" attribute.
14800
14801 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14802
14803         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14804         of ignoring it and letting the compile continue.
14805
14806         * typemanager.cs (ChangeType): use an extra argument to return an
14807         error condition instead of throwing an exception.
14808
14809 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14810
14811         * expression.cs (Unary.TryReduce): mimic the code for the regular
14812         code path.  Perform an implicit cast in the cases where we can
14813         implicitly convert to one of the integral types, and then reduce
14814         based on that constant.   This fixes bug #35483.
14815
14816 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14817
14818         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14819
14820 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14821
14822         * namespace.cs: fixed bug #35489.
14823
14824 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14825
14826         * class.cs: Remove some dead code.
14827
14828         * cs-parser.jay: Estimate the number of methods needed
14829         (RootContext.MethodCount);
14830
14831         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14832         numbers instead of StringBuilders.
14833
14834         * support.cs (PtrHashtable): Add constructor with initial size;
14835         We can now reduce reallocations of the method table.
14836
14837 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14838
14839         * attribute.cs (ApplyAttributes): Keep track of the emitted
14840         attributes on a per-target basis. This fixes bug #35413.
14841
14842 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14843
14844         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14845         default to the Windows 1252 encoding.
14846
14847         (UnixParseOption): Support version, thanks to Alp for the missing
14848         pointer. 
14849
14850         * AssemblyInfo.cs: Add nice assembly information.
14851
14852         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14853         (bug 35169).
14854
14855         * cs-parser.jay: Allow a trailing comma before the close bracked
14856         in the attribute_section production.
14857
14858         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14859         address of the instance was being taken, I will take this out,
14860         because we take the address of the object immediately here.
14861
14862 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14863
14864         * typemanager.cs (AreMultipleAllowed): Take care of the most
14865         obvious case where attribute type is not in the current assembly -
14866         stupid me ;-)
14867
14868 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14871         definitions, instead of doing that afterwards.  
14872
14873         Also we use a nice little hack, depending on the constructor, we
14874         know if we are a "composed" name or a simple name.  Hence, we
14875         avoid the IndexOf test, and we avoid 
14876
14877         * codegen.cs: Add code to assist in a bug reporter to track down
14878         the source of a compiler crash. 
14879
14880 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14881
14882         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14883         types have been emitted for a given element and flag an error
14884         if something which does not have AllowMultiple set is used more
14885         than once.
14886
14887         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14888         attribute types and their corresponding AllowMultiple properties
14889
14890         (AreMultipleAllowed): Check the property for a given type.
14891
14892         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14893         property in the case we have a TypeContainer.
14894
14895         (Attributes.AddAttribute): Detect duplicates and just skip on
14896         adding them. This trivial fix catches a pretty gross error in our
14897         attribute emission - global attributes were being emitted twice!
14898
14899         Bugzilla bug #33187 is now fixed.
14900
14901 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14902
14903         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14904         instead of pp_and).
14905
14906         * expression.cs (Binary.ResolveOperator): I can only use the
14907         Concat (string, string, string) and Concat (string, string,
14908         string, string) if the child is actually a concatenation of
14909         strings. 
14910
14911 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14912
14913         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14914         context where we need a 2-character lookahead.
14915
14916         * pending.cs (PendingImplementation): Rework so we can keep track
14917         of interface types all the time, and flag those which were
14918         implemented by parents as optional.
14919
14920 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * expression.cs (Binary.ResolveOperator): Use
14923         String.Concat(string,string,string) or
14924         String.Concat(string,string,string,string) when possible. 
14925
14926         * typemanager: More helper methods.
14927
14928
14929 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14930
14931         * pending.cs: remove the bogus return from GetMissingInterfaces()
14932         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14933
14934 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14935
14936         * namespace.cs: avoid duplicated 'using xxx' being added to
14937         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14938         when we get more than one 'using' statement for the same namespace.
14939         Report a CS0105 warning for it.
14940
14941 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14942
14943         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14944         of calling getChar/putback, uses internal knowledge of it.    
14945
14946         (xtoken): Reorder tokenizer so most common patterns are checked
14947         first.  This reduces the compilation time in another 5% (from 8.11s
14948         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14949
14950         The parsing time is 22% of the compilation in mcs, and from that
14951         64% is spent on the tokenization process.  
14952
14953         I tried using a binary search for keywords, but this is slower
14954         than the hashtable.  Another option would be to do a couple of
14955         things:
14956
14957                 * Not use a StringBuilder, instead use an array of chars,
14958                   with a set value.  Notice that this way we could catch
14959                   the 645 error without having to do it *afterwards*.
14960
14961                 * We could write a hand-parser to avoid the hashtable
14962                   compares altogether.
14963
14964         The identifier consumption process takes 37% of the tokenization
14965         time.  Another 15% is spent on is_number.  56% of the time spent
14966         on is_number is spent on Int64.Parse:
14967
14968                 * We could probably choose based on the string length to
14969                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14970                   computations. 
14971
14972         Another 3% is spend on wrapping `xtoken' in the `token' function.
14973
14974         Handle 0xa0 as whitespace (#34752)
14975
14976 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14977
14978         * typemanager.cs (IsCLRType): New routine to tell whether a type
14979         is one of the builtin types.  
14980
14981         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14982         typecode in more places instead of doing pointer comparissions.
14983         We could leverage some knowledge about the way the typecodes are
14984         laid out.
14985
14986         New code to cache namespaces in assemblies, it is currently not
14987         invoked, to be used soon.
14988
14989         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14990
14991         * expression.cs (Binary.ResolveOperator): specially handle
14992         strings, and do not perform user-defined operator overloading for
14993         built-in types.
14994
14995 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14996
14997         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14998         internalcall as it is a pretty simple operation;  Avoid whenever
14999         possible to call Char.IsLetter.
15000
15001         (consume_identifier): Cut by half the number of
15002         hashtable calls by merging the is_keyword and GetKeyword behavior.
15003
15004         Do not short-circuit, because if we do, we
15005         report errors (ie, #if false && true would produce an invalid
15006         directive error);
15007
15008
15009 2002-11-24  Martin Baulig  <martin@ximian.com>
15010
15011         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15012         check constant ranges and report a CS0221.  Fixes #33186.
15013
15014 2002-11-24  Martin Baulig  <martin@ximian.com>
15015
15016         * cs-parser.jay: Make this work for uninitialized variable
15017         declarations in the `for' initializer.  Fixes #32416.
15018
15019 2002-11-24  Martin Baulig  <martin@ximian.com>
15020
15021         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15022         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15023
15024 2002-11-24  Martin Baulig  <martin@ximian.com>
15025
15026         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15027         argument; if true, we also check for user-defined conversions.
15028         This is only needed if both arguments are of a user-defined type.
15029         Fixes #30443, added test-175.cs.
15030         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15031
15032         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15033
15034 2002-11-24  Martin Baulig  <martin@ximian.com>
15035
15036         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15037         function to get the store opcode.
15038         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15039         only emit the Ldelema if the store opcode is Stobj.  You must run
15040         both test-34 and test-167 to test this.  Fixes #34529.
15041
15042 2002-11-23  Martin Baulig  <martin@ximian.com>
15043
15044         * ecore.cs (Expression.MemberLookup): Added additional
15045         `qualifier_type' argument which is used when we're being called
15046         from MemberAccess.DoResolve() and null if we're called from a
15047         SimpleName lookup.
15048         (Expression.MemberLookupFailed): New method to report errors; this
15049         does the CS1540 check and reports the correct error message.
15050
15051         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15052         argument for the CS1540 check and redone the way how we're dealing
15053         with private members.  See the comment in the source code for details.
15054         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15055         `closure_start_type' to `closure_qualifier_type' and check whether
15056         it's not null.  It was not this filter being broken, it was just
15057         being called with the wrong arguments.
15058
15059         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15060         and pass it the correct `qualifier_type'; this also does the error
15061         handling for us.
15062
15063 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * expression.cs (Invocation.EmitParams): If the we are dealing
15066         with a non-built-in value type, load its address as well.
15067
15068         (ArrayCreation): Use a a pretty constant instead
15069         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15070         static initializers.  
15071
15072         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15073         because they are not really value types, just glorified integers. 
15074
15075         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15076
15077         * ecore.cs: Remove redundant code for enumerations, make them use
15078         the same code path as everything else, fixes the casting issue
15079         with enumerations in Windows.Forms.
15080
15081         * attribute.cs: Do only cast to string if it is a string, the
15082         validation happens later.
15083
15084         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15085         people upgrade their corlibs.
15086
15087         * ecore.cs: Oops, enumerations were not following the entire code path
15088
15089 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15090
15091         * typemanager.cs (FilterWithClosure): Commented out the test for
15092         1540 in typemanager.cs, as it has problems when accessing
15093         protected methods from a parent class (see test-174.cs). 
15094
15095         * attribute.cs (Attribute.ValidateGuid): new method.
15096         (Attribute.Resolve): Use above.
15097
15098 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15099
15100         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15101
15102         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15103         handling for enumerations, as we only needed the TypeContainer
15104         functionality to begin with (this is required for the fix below to
15105         work for enums that reference constants in a container class for
15106         example). 
15107
15108         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15109
15110         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15111         a valid TypeBuilder to perform lookups on.o
15112
15113         * class.cs (InheritableMemberSignatureCompare): Use true in the
15114         call to GetGetMethod and GetSetMethod, because we are comparing
15115         the signature, and we need to get the methods *even* if they are
15116         private. 
15117
15118         (PropertyBase.CheckBase): ditto.
15119
15120         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15121         GotoCase.Resolve): Use Peel on EmpytCasts.
15122
15123         * ecore.cs (EmptyCast): drop child, add Peel method.
15124
15125 2002-11-17  Martin Baulig  <martin@ximian.com>
15126
15127         * ecore.cs (EmptyCast.Child): New public property.
15128
15129         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15130         label resolved to an EmptyCast.  Fixes #34162.
15131         (GotoCase.Resolve): Likewise.
15132         (Block.EmitMeta): Likewise.
15133
15134 2002-11-17  Martin Baulig  <martin@ximian.com>
15135
15136         * expression.cs (Invocation.BetterConversion): Prefer int over
15137         uint; short over ushort; long over ulong for integer literals.
15138         Use ImplicitConversionExists instead of StandardConversionExists
15139         since we also need to check for user-defined implicit conversions.
15140         Fixes #34165.  Added test-173.cs.
15141
15142 2002-11-16  Martin Baulig  <martin@ximian.com>
15143
15144         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15145         with the `true' and `false' literals.  Fixes #33151.
15146
15147 2002-11-16  Martin Baulig  <martin@ximian.com>
15148
15149         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15150         October 22nd; don't do the cs1540 check for static members.
15151
15152         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15153         now using our own filter here and doing the cs1540 check again.
15154
15155 2002-11-16  Martin Baulig  <martin@ximian.com>
15156
15157         * support.cs (InternalParameters): Don't crash if we don't have
15158         any fixed parameters.  Fixes #33532.
15159
15160 2002-11-16  Martin Baulig  <martin@ximian.com>
15161
15162         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15163         when looking up static methods to make this work on Windows.
15164         Fixes #33773.
15165
15166 2002-11-16  Martin Baulig  <martin@ximian.com>
15167
15168         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15169         a setter rather than using PropertyInfo.CanWrite.
15170
15171 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15172
15173         * class.cs: Allow acces to block member by subclasses. Fixes build
15174         breaker.
15175
15176 2002-11-14  Martin Baulig  <martin@ximian.com>
15177
15178         * class.cs (Constructor.Emit): Added the extern/block check.
15179         Fixes bug #33678.
15180
15181 2002-11-14  Martin Baulig  <martin@ximian.com>
15182
15183         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15184         iteration while looking for indexers, this is needed because the
15185         indexer may have a different name in our base classes.  Fixed the
15186         error reporting (no indexers at all, not get accessor, no
15187         overloaded match).  Fixes bug #33089.
15188         (IndexerAccess.DoResolveLValue): Likewise.
15189
15190 2002-11-14  Martin Baulig  <martin@ximian.com>
15191
15192         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15193         indexers.  Fixes the first part of bug #33089.
15194         (MethodSignature.InheritableMemberSignatureCompare): Added support
15195         for properties.
15196
15197 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15198
15199         * attribute.cs (Attribute.Resolve): Catch the
15200         NullReferenceException and report it since it isn't supposed to
15201         happen. 
15202
15203 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15204
15205         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15206         LogicalOr and LogicalAnd that can benefit from recursively
15207         handling EmitBranchable.  The code now should be nice for Paolo.
15208
15209 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15210
15211         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15212         the Type lookups, as we perform quite a number of lookups on
15213         non-Types.  This can be removed once we can deterministically tell
15214         whether we have a type or a namespace in advance.
15215
15216         But this might require special hacks from our corlib.
15217
15218         * TODO: updated.
15219
15220         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15221         and double which avoids a conversion from an integer to a double.
15222
15223         * expression.cs: tiny optimization, avoid calling IsConstant,
15224         because it effectively performs the lookup twice.
15225
15226 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15227
15228         But a bogus return here to keep the semantics of the old code
15229         until the Mono runtime is fixed.
15230
15231         * pending.cs (GetMissingInterfaces): New method used to remove all
15232         the interfaces that are already implemented by our parent
15233         classes from the list of pending methods. 
15234
15235         * interface.cs: Add checks for calls after ResolveTypeExpr.
15236
15237 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15238
15239         * class.cs (Class.Emit): Report warning 67: event not used if the
15240         warning level is beyond 3.
15241
15242         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15243         being a NullLiteral.
15244
15245         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15246         specifiers. 
15247
15248         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15249         path that might fail if a type can not be resolved.
15250
15251         * expression.cs (Binary.Emit): Emit unsigned versions of the
15252         operators. 
15253
15254         * driver.cs: use error 5.
15255
15256 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15257
15258         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15259
15260 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15261
15262         * cs-parser.jay (switch_section): A beautiful patch from Martin
15263         Baulig that fixed 33094.
15264
15265 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15266
15267         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15268         Check whether the base is abstract and report an error if so.
15269
15270         * expression.cs (IndexerAccess.DoResolveLValue,
15271         IndexerAccess.DoResolve): ditto. 
15272
15273         (Invocation.DoResolve): ditto.
15274
15275         (Invocation.FullMethodDesc): Improve the report string.
15276
15277         * statement.cs (Block): Eliminate IsVariableDefined as it is
15278         basically just a wrapper for GetVariableInfo.
15279
15280         * ecore.cs (SimpleName): Use new 
15281
15282         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15283         type, as we return the actual parameter ref/unref state on a
15284         different call.
15285
15286 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * support.cs: Return proper flags REF/OUT fixing the previous
15289         commit.  
15290
15291         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15292         not used to mean `ref' but `ref or out' in ParameterReference
15293
15294         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15295         full type signature instead of calling TypeManger.CSharpName
15296         ourselves. 
15297
15298         * support.cs (InternalParameters.ParameterDesc): Do not compare
15299         directly to the modflags, because REF/OUT will actually be bitsets
15300         if set. 
15301
15302         * delegate.cs (VerifyMethod): Check also the modifiers.
15303
15304         * cs-tokenizer.cs: Fix bug where floating point values with an
15305         exponent where a sign was missing was ignored.
15306
15307         * driver.cs: Allow multiple assemblies to be specified in a single
15308         /r: argument
15309
15310 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15311
15312         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15313         because identifiers after a parenthesis would end up in this kind
15314         of production, and we needed to desamiguate it for having casts
15315         like:
15316
15317                 (UserDefinedType *) xxx
15318
15319 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15320
15321         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15322         we should set on the Bindingflags.NonPublic, but not turn on
15323         private_ok.  private_ok controls whether a Private member is
15324         returned (this is chekced on the filter routine), while the
15325         BindingFlags.NonPublic just controls whether private/protected
15326         will be allowed.   This fixes the problem part of the problem of
15327         private properties being allowed to be used in derived classes.
15328
15329         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15330         so we can call the children DoResolveLValue method (this will
15331         properly signal errors on lvalue assignments to base properties)
15332
15333         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15334         getter are null, and we have a property info, we know that this
15335         happened because the lookup failed, so we report an error 122 for
15336         protection level violation.
15337
15338         We also silently return if setter and getter are null in the
15339         resolve functions, this condition only happens if we have flagged
15340         the error before.  This is the other half of the problem. 
15341
15342         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15343         not have accessibility information, that is why we were returning
15344         true in the filter function in typemanager.cs.
15345
15346         To properly report 122 (property is inaccessible because of its
15347         protection level) correctly, we report this error in ResolveAccess
15348         by failing if both the setter and the getter are lacking (ie, the
15349         lookup failed). 
15350
15351         DoResolve and DoLResolve have been modified to check for both
15352         setter/getter being null and returning silently, the reason being
15353         that I did not want to put the knowledge about this error in upper
15354         layers, like:
15355
15356         int old = Report.Errors;
15357         x = new PropertyExpr (...);
15358         if (old != Report.Errors)
15359                 return null;
15360         else
15361                 return x;
15362
15363         So the property expr is returned, but it is invalid, so the error
15364         will be flagged during the resolve process. 
15365
15366         * class.cs: Remove InheritablePropertySignatureCompare from the
15367         class, as we no longer depend on the property signature to compute
15368         whether it is possible to implement a method or not.
15369
15370         The reason is that calling PropertyInfo.GetGetMethod will return
15371         null (in .NET, in Mono it works, and we should change this), in
15372         cases where the Get Method does not exist in that particular
15373         class.
15374
15375         So this code:
15376
15377         class X { public virtual int A { get { return 1; } } }
15378         class Y : X { }
15379         class Z : Y { public override int A { get { return 2; } } }
15380
15381         Would fail in Z because the parent (Y) would not have the property
15382         defined.  So we avoid this completely now (because the alternative
15383         fix was ugly and slow), and we now depend exclusively on the
15384         method names.
15385
15386         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15387         reference method, instead of using the property.
15388
15389         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15390         routines are gone now.
15391
15392         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15393         names, they were incorrectly named.
15394
15395         * cs-tokenizer.cs: Return are more gentle token on failure. 
15396
15397         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15398         had an out-of-sync index variable, which caused it to remove from
15399         the list of pending methods the wrong method sometimes.
15400
15401 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15402
15403         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15404         CanWrite, because those refer to this particular instance of the
15405         property, and do not take into account the fact that we can
15406         override single members of a property.
15407
15408         Constructor requires an EmitContext.  The resolution process does
15409         not happen here, but we need to compute the accessors before,
15410         because the resolution does not always happen for properties.
15411
15412         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15413         subclass, before we did not update this flag, but we did update
15414         bindingflags. 
15415
15416         (GetAccessors): Drop this routine, as it did not work in the
15417         presence of partially overwritten set/get methods. 
15418
15419         Notice that this broke the cs1540 detection, but that will require
15420         more thinking. 
15421
15422 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15423
15424         * class.cs:
15425         * codegen.cs:
15426         * driver.cs: issue a warning instead of an error if we don't support
15427         debugging for the platform. Also ignore a couple of errors that may
15428         arise when trying to write the symbols. Undo my previous patch.
15429
15430 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15431
15432         * driver.cs: ignore /debug switch except for Unix platforms.
15433
15434 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15435
15436         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15437
15438 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15439
15440         * driver.cs: Do not make mcs-debug conditional, so we do not break
15441         builds that use it.
15442
15443         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15444         review this patch.  But basically after all the children variables
15445         have been merged, the value of "Breaks" was not being set to
15446         new_breaks for Switch blocks.  I think that it should be set after
15447         it has executed.  Currently I set this to the value of new_breaks,
15448         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15449         conservative, but I do not understand this code very well.
15450
15451         I did not break anything in the build, so that is good ;-)
15452
15453         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15454
15455 2002-10-20  Mark Crichton  <crichton@gimp.org>
15456
15457         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15458
15459 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15460
15461         * cfold.cs: Fixed compile blocker.
15462
15463 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15464
15465         * driver.cs: I was chekcing the key, not the file.
15466
15467 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15468
15469         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15470         message that we were generating - we just need to silently return
15471         a null.
15472
15473 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15474
15475         * class.cs (Event.Define): Change my previous commit, as this
15476         breaks the debugger.  This is a temporary hack, as it seems like
15477         the compiler is generating events incorrectly to begin with.
15478
15479         * expression.cs (Binary.ResolveOperator): Added support for 
15480         "U operator - (E x, E y)"
15481
15482         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15483         y)".
15484
15485         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15486         init-only variables, but this path did not take into account that
15487         there might be also instance readonly variables.  Correct this
15488         problem. 
15489
15490         This fixes bug 32253
15491
15492         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15493         delegates as well.
15494
15495         * driver.cs: Change the extension for modules to `netmodule'
15496
15497         * cs-parser.jay: Improved slightly the location tracking for
15498         the debugger symbols.
15499
15500         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15501         modifiers that were specified instead of the hardcoded value
15502         (FamAndAssem).  This was basically ignoring the static modifier,
15503         and others.  Fixes 32429.
15504
15505         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15506         fixed a bug in the process (32476)
15507
15508         * expression.cs (ArrayAccess.EmitAssign): Patch from
15509         hwang_rob@yahoo.ca that fixes bug 31834.3
15510
15511 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * driver.cs: Make the module extension .netmodule.
15514
15515 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * driver.cs: Report an error if the resource file is not found
15518         instead of crashing.
15519
15520         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15521         false, like Emit does.
15522
15523 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15524
15525         * typemanager.cs: Remove unused private member.  Also reported mcs
15526         bug to report this as a warning like csc.
15527
15528 2002-10-15  Martin Baulig  <martin@gnome.org>
15529
15530         * statement.cs (Statement.Emit): Made this a virtual method; emits
15531         the line number info and calls DoEmit().
15532         (Statement.DoEmit): New protected abstract method, formerly knows
15533         as Statement.Emit().
15534
15535         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15536
15537 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15538
15539         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15540         have fixed a remaining problem: not every AddXXXX was adding a
15541         fully qualified name.  
15542
15543         Now everyone registers a fully qualified name in the DeclSpace as
15544         being defined instead of the partial name.  
15545
15546         Downsides: we are slower than we need to be due to the excess
15547         copies and the names being registered this way.  
15548
15549         The reason for this is that we currently depend (on the corlib
15550         bootstrap for instance) that types are fully qualified, because
15551         we dump all the types in the namespace, and we should really have
15552         types inserted into the proper namespace, so we can only store the
15553         basenames in the defined_names array.
15554
15555 2002-10-10  Martin Baulig  <martin@gnome.org>
15556
15557         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15558         from bug #31834, see the bug report for a testcase which is
15559         miscompiled.
15560
15561 2002-10-10  Martin Baulig  <martin@gnome.org>
15562
15563         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15564         flow analysis code for this.
15565
15566         * statement.cs (Do, While, For): Tell the flow analysis code about
15567         infinite loops.
15568         (FlowBranching.UsageVector): Added support for infinite loops.
15569         (Block.Resolve): Moved the dead code elimination here and use flow
15570         analysis to do it.
15571
15572 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * class.cs (Field.Define): Catch cycles on struct type
15575         definitions. 
15576
15577         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15578         fields if the fields are static.  We only need to check instance
15579         fields. 
15580
15581         * expression.cs (As.DoResolve): Test for reference type.
15582
15583         * statement.cs (Using.ResolveExpression): Use
15584         ConvertImplicitRequired, not ConvertImplicit which reports an
15585         error on failture
15586         (Using.ResolveLocalVariableDecls): ditto.
15587
15588         * expression.cs (Binary.ResolveOperator): Report errors in a few
15589         places where we had to.
15590
15591         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15592
15593 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15594
15595         * expression.cs: Use StoreFromPtr instead of extracting the type
15596         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15597
15598         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15599         an enumeration value to a System.Enum, but System.Enum is not a
15600         value type, but an class type, so we need to box.
15601
15602         (Expression.ConvertExplicit): One codepath could return
15603         errors but not flag them.  Fix this.  Fixes #31853
15604
15605         * parameter.cs (Resolve): Do not allow void as a parameter type.
15606
15607 2002-10-06  Martin Baulig  <martin@gnome.org>
15608
15609         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15610         if it's a class type and not a struct.  Fixes #31815.
15611
15612 2002-10-06  Martin Baulig  <martin@gnome.org>
15613
15614         * statement.cs: Reworked the flow analysis code a bit to make it
15615         usable for dead code elimination.
15616
15617 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15618
15619         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15620
15621 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15622
15623         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15624         to fix the test 165, will investigate deeper.
15625
15626 2002-10-04  Martin Baulig  <martin@gnome.org>
15627
15628         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15629         finally blocks actually work.
15630         (Try.Resolve): We don't need to create a sibling for `finally' if
15631         there is no finally block.
15632
15633 2002-10-04  Martin Baulig  <martin@gnome.org>
15634
15635         * class.cs (Constructor.Define): The default accessibility for a
15636         non-default constructor is private, not public.
15637
15638 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15639
15640         * class.cs (Constructor): Make AllowedModifiers public, add
15641         EXTERN.
15642
15643         * cs-parser.jay: Perform the modifiers test here, as the
15644         constructor for the Constructor class usually receives a zero
15645         because of the way we create it (first we create, later we
15646         customize, and we were never checking the modifiers).
15647
15648         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15649         is a version of LookupTypeReflection that includes the type-name
15650         cache.  This can be used as a fast path for functions that know
15651         the fully qualified name and are only calling into *.GetType() to
15652         obtain a composed type.
15653
15654         This is also used by TypeManager.LookupType during its type
15655         composition.
15656
15657         (LookupType): We now also track the real type name, as sometimes
15658         we can get a quey for the real type name from things like
15659         ComposedCast.  This fixes bug 31422.
15660
15661         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15662         complete type fullname, it does not have to go through the type
15663         resolution system to obtain the composed version of the type (for
15664         obtaining arrays or pointers).
15665
15666         (Conditional.Emit): Use the EmitBoolExpression to
15667         generate nicer code, as requested by Paolo.
15668
15669         (ArrayCreation.CheckIndices): Use the patch from
15670         hwang_rob@yahoo.ca to validate the array initializers. 
15671
15672 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15673
15674         * class.cs (ConstructorInitializer.Emit): simplify code by using
15675         Invocation.EmitCall, and at the same time, fix the bugs in calling
15676         parent constructors that took variable arguments. 
15677
15678         * ecore.cs (Expression.ConvertNumericExplicit,
15679         Expression.ImplicitNumericConversion): Remove the code that
15680         manually wrapped decimal (InternalTypeConstructor call is now gone
15681         as well).
15682
15683         * expression.cs (Cast.TryReduce): Also handle decimal types when
15684         trying to perform a constant fold on the type.
15685
15686         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15687
15688         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15689         that only turned off an error report, and did nothing else. 
15690
15691 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * driver.cs: Handle and ignore /fullpaths
15694
15695 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15696
15697         * expression.cs (Binary.ResolveOperator): Catch the case where
15698         DoNumericPromotions returns true, 
15699
15700         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15701
15702 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15705         report error 70.
15706
15707 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15708
15709         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15710         conversion exists, but it is also required that the conversion be
15711         performed.  This manifested in "(Type64Enum) 2".  
15712
15713         * class.cs (TypeManager.AddMethod): The fix is not to change
15714         AddEnum, because that one was using a fully qualified name (every
15715         DeclSpace derivative does), but to change the AddMethod routine
15716         that was using an un-namespaced name.  This now correctly reports
15717         the duplicated name.
15718
15719         Revert patch until I can properly fix it.  The issue
15720         is that we have a shared Type space across all namespaces
15721         currently, which is wrong.
15722
15723         Options include making the Namespace a DeclSpace, and merge
15724         current_namespace/current_container in the parser.
15725
15726 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15727
15728         * cs-parser.jay: Improve error reporting when we get a different
15729         kind of expression in local_variable_type and
15730         local_variable_pointer_type. 
15731
15732         Propagate this to avoid missleading errors being reported.
15733
15734         * ecore.cs (ImplicitReferenceConversion): treat
15735         TypeManager.value_type as a target just like object_type.   As
15736         code like this:
15737
15738         ValueType v = 1;
15739
15740         Is valid, and needs to result in the int 1 being boxed before it
15741         is assigned to the value type v.
15742
15743         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15744         to validate the enumeration name.
15745
15746         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15747         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15748         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15749
15750         * ecore.cs (TryImplicitIntConversion): When doing an
15751         implicit-enumeration-conversion, check if the type is 64-bits and
15752         perform a conversion before passing to EnumConstant.
15753
15754 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15755
15756         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15757         report ambiguous type references.  Unlike the MS version, we
15758         report what the ambiguity is.   Innovation at work ;-)
15759
15760         (DeclSpace.FindType): Require a location argument to
15761         display when we display an ambiguous error.
15762
15763         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15764
15765         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15766
15767         * expression.cs (EmitDynamicInitializers): Apply patch from
15768         hwang_rob@yahoo.ca that fixes the order in which we emit our
15769         initializers. 
15770
15771 2002-09-21  Martin Baulig  <martin@gnome.org>
15772
15773         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15774         delegate takes no arguments.
15775
15776 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15777
15778         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15779         from integers.
15780
15781         * expression.cs: Extract the underlying type.
15782
15783         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15784
15785         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15786
15787 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15788
15789         * class.cs (TypeContainer.DefineType): We can not use the nice
15790         PackingSize with the size set to 1 DefineType method, because it
15791         will not allow us to define the interfaces that the struct
15792         implements.
15793
15794         This completes the fixing of bug 27287
15795
15796         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15797         means also structs.  This fixes part of the problem. 
15798         (Expresion.ImplicitReferenceConversionExists): ditto.
15799
15800         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15801         error if there were no errors reported during the type lookup
15802         process, to avoid duplicates or redundant errors.  Without this
15803         you would get an ambiguous errors plus a type not found.  We have
15804         beaten the user enough with the first error.  
15805
15806         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15807         reference. 
15808
15809         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15810         during the resolution process, stop the lookup, this avoids
15811         repeated error reports (same error twice).
15812
15813         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15814
15815         * typemanager.cs (LookupType): Redo the type lookup code to match
15816         the needs of System.Reflection.  
15817
15818         The issue is that System.Reflection requires references to nested
15819         types to begin with a "+" sign instead of a dot.  So toplevel
15820         types look like: "NameSpace.TopLevelClass", and nested ones look
15821         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15822         levels. 
15823
15824 2002-09-19  Martin Baulig  <martin@gnome.org>
15825
15826         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15827         says that a method always returns or always throws an exception,
15828         don't report the CS0161.
15829
15830         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15831         set `Returns = new_returns'.
15832
15833 2002-09-19  Martin Baulig  <martin@gnome.org>
15834
15835         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15836         to an enum constant, check for a CS0176.
15837
15838 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15841         for operators that must be in pairs and report errors.
15842
15843         * ecore.cs (SimpleName.DoResolveType): During the initial type
15844         resolution process, when we define types recursively, we must
15845         check first for types in our current scope before we perform
15846         lookups in the enclosing scopes.
15847
15848         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15849
15850         (Invocation.VerifyArgumentsCompat): Call
15851         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15852         I thought we were supposed to always call this, but there are a
15853         few places in the code where we dont do it.
15854
15855 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * driver.cs: Add support in -linkres and -resource to specify the
15858         name of the identifier.
15859
15860 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * ecore.cs (StandardConversionExists): Sync with the conversion
15863         code: allow anything-* to void* conversions.
15864
15865         (FindMostSpecificSource): Use an Expression argument
15866         instead of a Type, because we might be handed over a Literal which
15867         gets a few more implicit conversions that plain types do not.  So
15868         this information was being lost.
15869
15870         Also, we drop the temporary type-holder expression when not
15871         required.
15872
15873 2002-09-17  Martin Baulig  <martin@gnome.org>
15874
15875         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15876         this is an explicit interface implementation.
15877
15878 2002-09-17  Martin Baulig  <martin@gnome.org>
15879
15880         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15881         different `IndexerName' attributes.
15882
15883         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15884         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15885         virtual CommonResolve().
15886
15887 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15888
15889         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15890         and convert that to the UnderlyingType.
15891
15892         * statement.cs (Foreach.Resolve): Indexers are just like variables
15893         or PropertyAccesses.
15894
15895         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15896         inside quoted strings, we were not doing this before.
15897
15898 2002-09-16  Martin Baulig  <martin@gnome.org>
15899
15900         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15901         resolve it.  This is needed for the definite assignment check of the
15902         instance expression, fixes bug #29846.
15903         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15904
15905 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15906
15907         * parameter.cs: Fix compile error.  Cannot reference static member
15908         from an instance object.  Is this an mcs bug?
15909
15910 2002-09-14  Martin Baulig  <martin@gnome.org>
15911
15912         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15913         multiple times.  Fixes bug #30295, added test-166.cs.
15914
15915 2002-09-14  Martin Baulig  <martin@gnome.org>
15916
15917         * statement.cs (Block.Emit): Don't emit unreachable code.
15918         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15919         `break' statements.
15920         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15921
15922 2002-09-14  Martin Baulig  <martin@gnome.org>
15923
15924         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15925         is set.
15926
15927 2002-09-14  Martin Baulig  <martin@gnome.org>
15928
15929         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15930         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15931         be false on the ms runtime.
15932
15933 2002-09-13  Martin Baulig  <martin@gnome.org>
15934
15935         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15936         the CS0038 error message.
15937
15938 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15939
15940         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15941         constant inside, return it.
15942
15943 2002-09-12  Martin Baulig  <martin@gnome.org>
15944
15945         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15946         implicit conversion can be done between enum types.
15947
15948         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15949         check whether an implicit conversion to the current enum's UnderlyingType
15950         exists and report an error if not.
15951
15952         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15953         without debugging support.
15954
15955         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15956         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15957
15958 2002-09-12  Martin Baulig  <martin@gnome.org>
15959
15960         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15961
15962         * ecore.cs (IMemberExpr.DeclaringType): New property.
15963         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15964         nonstatic member of an outer type (CS0038).
15965
15966 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * driver.cs: Activate the using-error detector at warning level
15969         4 (at least for MS-compatible APIs).
15970
15971         * namespace.cs (VerifyUsing): Small buglett fix.
15972
15973         * pending.cs (PendingImplementation): pass the container pointer. 
15974
15975         * interface.cs (GetMethods): Allow for recursive definition.  Long
15976         term, I would like to move every type to support recursive
15977         definitions, not the current ordering mechanism that we have right
15978         now.
15979
15980         The situation is this: Attributes are handled before interfaces,
15981         so we can apply attributes to interfaces.  But some attributes
15982         implement interfaces, we will now handle the simple cases
15983         (recursive definitions will just get an error).  
15984
15985         * parameter.cs: Only invalidate types at the end if we fail to
15986         lookup all types.  
15987
15988 2002-09-09  Martin Baulig  <martin@gnome.org>
15989
15990         * ecore.cs (PropertyExpr.Emit): Also check for
15991         TypeManager.system_int_array_get_length so this'll also work when
15992         compiling corlib.  Fixes #30003.
15993
15994 2002-09-09  Martin Baulig  <martin@gnome.org>
15995
15996         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15997         and throw an exception if we can't get the type's size.  Fixed #30040,
15998         added test-165.cs.
15999
16000 2002-09-09  Martin Baulig  <martin@gnome.org>
16001
16002         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16003
16004         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16005         context.  Fixes bug #30027.
16006
16007         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16008         virtual functions.  Fixes bug #30043, added test-164.cs.
16009
16010 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16011
16012         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16013
16014 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16015
16016         * driver.cs: Use an object to get the windows codepage since it's not a
16017         static property.
16018
16019 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * statement.cs (For.Emit): for infinite loops (test == null)
16022         return whether there is a break inside, not always "true".
16023
16024         * namespace.cs (UsingEntry): New struct to hold the name of the
16025         using definition, the location where it is defined, and whether it
16026         has been used in a successful type lookup.
16027
16028         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16029         strings.
16030
16031         * decl.cs: ditto.
16032
16033 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16034
16035         * attribute.cs : Fix incorrect code which relied on catching
16036         a NullReferenceException to detect a null being passed in
16037         where an object was expected.
16038
16039 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * statement.cs (Try): flag the catch variable as assigned
16042
16043         * expression.cs (Cast): Simplified by using ResolveType instead of
16044         manually resolving.
16045
16046         * statement.cs (Catch): Fix bug by using ResolveType.
16047
16048 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16049
16050         * expression.cs (BetterConversion): Special case for when we have
16051         a NullLiteral as the argument and we have to choose between string
16052         and object types - we choose string the way csc does.
16053
16054         * attribute.cs (Attribute.Resolve): Catch the
16055         NullReferenceException and report error #182 since the Mono
16056         runtime no more has the bug and having this exception raised means
16057         we tried to select a constructor which takes an object and is
16058         passed a null.
16059
16060 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16061
16062         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16063         message (1502, 1503) when we can't locate a method after overload
16064         resolution. This is much more informative and closes the bug
16065         Miguel reported.
16066
16067         * interface.cs (PopulateMethod): Return if there are no argument
16068         types. Fixes a NullReferenceException bug.
16069
16070         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16071         expressions too. Previously we were checking only in one place for
16072         positional arguments leaving out named arguments.
16073
16074         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16075         type to the enum type is not allowed. Remove code corresponding to
16076         that.
16077
16078         (ConvertNumericExplicit): Allow explicit conversions from
16079         the underlying type to enum type. This precisely follows the spec
16080         and closes a bug filed by Gonzalo.
16081
16082 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16083
16084         * compiler.csproj:
16085         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16086
16087 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16088
16089         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16090         it was important that we stored the right value after the
16091         reduction in `converted'.
16092
16093 2002-09-04  Martin Baulig  <martin@gnome.org>
16094
16095         * location.cs (Location.SymbolDocument): Use full pathnames for the
16096         source files.
16097
16098 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16099
16100         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16101         of the expression resolve mechanism, because that will catch the
16102         SimpleName error failures.
16103
16104         (Conditional): If we can not resolve the
16105         expression, return, do not crash.
16106
16107 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16108
16109         * cs-tokenizer.cs:
16110         (location): display token name instead of its number.
16111
16112 2002-08-28  Martin Baulig  <martin@gnome.org>
16113
16114         * expression.cs (Binary.ResolveOperator): Don't silently return
16115         but return an error if an operator cannot be applied between two
16116         enum types.
16117
16118 2002-08-28  Martin Baulig  <martin@gnome.org>
16119
16120         * class.cs (Constructor.Define): Set the permission attributes
16121         correctly instead of making all constructors public.
16122
16123 2002-08-28  Martin Baulig  <martin@gnome.org>
16124
16125         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16126         for private members before reporting a CS0103; if we find anything,
16127         it's a CS0122.
16128
16129 2002-08-28  Martin Baulig  <martin@gnome.org>
16130
16131         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16132         to check whether `closure_start_type == closure_invocation_type',
16133         we also need to check whether `m.DeclaringType == closure_invocation_type'
16134         before bypassing the permission checks.  We might be accessing
16135         protected/private members from the base class.
16136         (TypeManager.RealMemberLookup): Only set private_ok if private
16137         members were requested via BindingFlags.NonPublic.
16138
16139         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16140
16141         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16142         MethodGroupExpr.IsExplicitImpl if appropriate.
16143         (Invocation.DoResolve): Don't report the CS0120 for explicit
16144         interface implementations.
16145
16146 2002-08-27  Martin Baulig  <martin@gnome.org>
16147
16148         * expression.cs (Invocation.DoResolve): If this is a static
16149         method and we don't have an InstanceExpression, we must report
16150         a CS0120.
16151
16152 2002-08-25  Martin Baulig  <martin@gnome.org>
16153
16154         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16155         `==' between a valuetype and an object.
16156
16157 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16158
16159         * ecore.cs (TypeExpr): Provide a ToString method.
16160
16161 2002-08-24  Martin Baulig  <martin@gnome.org>
16162
16163         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16164         now called proggie.dbg and it's a binary file.
16165
16166 2002-08-23  Martin Baulig  <martin@gnome.org>
16167
16168         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16169
16170 2002-08-23  Martin Baulig  <martin@gnome.org>
16171
16172         * struct.cs (MyStructInfo.ctor): Make this work with empty
16173         structs; it's not allowed to use foreach() on null.
16174
16175 2002-08-23  Martin Baulig  <martin@gnome.org>
16176
16177         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16178         writer the full pathname of the generated assembly.
16179
16180 2002-08-23  Martin Baulig  <martin@gnome.org>
16181
16182         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16183         A `finally' block never returns or breaks; improved handling of
16184         unreachable code.
16185
16186 2002-08-23  Martin Baulig  <martin@gnome.org>
16187
16188         * statement.cs (Throw.Resolve): Allow `throw null'.
16189
16190 2002-08-23  Martin Baulig  <martin@gnome.org>
16191
16192         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16193         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16194         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16195         MemberLookup would return a wrong event if this is an explicit
16196         interface implementation and the class has an event with the same
16197         name.
16198
16199 2002-08-23  Martin Baulig  <martin@gnome.org>
16200
16201         * statement.cs (Block.AddChildVariableNames): New public method.
16202         (Block.AddChildVariableName): Likewise.
16203         (Block.IsVariableNameUsedInChildBlock): Likewise.
16204         (Block.AddVariable): Check whether a variable name has already
16205         been used in a child block.
16206
16207         * cs-parser.jay (declare_local_variables): Mark all variable names
16208         from the current block as being used in a child block in the
16209         implicit block.
16210
16211 2002-08-23  Martin Baulig  <martin@gnome.org>
16212
16213         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16214         find the symbol writer.
16215
16216         * driver.cs: csc also allows the arguments to /define being
16217         separated by commas, not only by semicolons.
16218
16219 2002-08-23  Martin Baulig  <martin@gnome.org>
16220
16221         * interface.cs (Interface.GetMembers): Added static check for events.
16222
16223 2002-08-15  Martin Baulig  <martin@gnome.org>
16224
16225         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16226         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16227
16228         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16229         why the MethodData.EmitDestructor() change was necessary.
16230
16231 2002-08-20  Martin Baulig  <martin@gnome.org>
16232
16233         * class.cs (TypeContainer.FindMembers): Added static check for events.
16234
16235         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16236
16237         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16238         use Type.GetEvents(), not Type.FindMembers().
16239
16240 2002-08-20  Martin Baulig  <martin@gnome.org>
16241
16242         * decl.cs (MemberCache): Added a special method cache which will
16243         be used for method-only searched.  This ensures that a method
16244         search will return a MethodInfo with the correct ReflectedType for
16245         inherited methods.      
16246
16247 2002-08-20  Martin Baulig  <martin@gnome.org>
16248
16249         * decl.cs (DeclSpace.FindMembers): Made this public.
16250
16251 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16252
16253         * delegate.cs: fixed build on windows.
16254         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16255
16256 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16257
16258         * ecore.cs (StandardConversionExists): Return a false
16259         if we are trying to convert the void type to anything else
16260         since that is not allowed.
16261
16262         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16263         we flag error 70 in the event an event is trying to be accessed
16264         directly from outside the declaring type.
16265
16266 2002-08-20  Martin Baulig  <martin@gnome.org>
16267
16268         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16269         MemberCache from typemanager.cs to decl.cs.
16270
16271 2002-08-19  Martin Baulig  <martin@gnome.org>
16272
16273         * class.cs (TypeContainer): Implement IMemberContainer.
16274         (TypeContainer.DefineMembers): Create the MemberCache.
16275         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16276         return public members if BindingFlags.Public was given, check
16277         whether members are static.
16278
16279 2002-08-16  Martin Baulig  <martin@gnome.org>
16280
16281         * decl.cs (DeclSpace.Define): Splitted this in Define and
16282         DefineMembers.  DefineMembers is called first and initializes the
16283         MemberCache.
16284
16285         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16286         DefineMembers() on all our DeclSpaces.
16287
16288         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16289         but call DefineMembers() on all nested interfaces.  We call their
16290         Define() in our new Define() function.
16291
16292         * interface.cs (Interface): Implement IMemberContainer.
16293         (Interface.Define): Moved all code except the attribute stuf to
16294         DefineMembers().
16295         (Interface.DefineMembers): Initialize the member cache.
16296
16297         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16298         need this anymore since we can use MemberCache.FindMembers directly.
16299
16300 2002-08-19  Martin Baulig  <martin@gnome.org>
16301
16302         * typemanager.cs (MemberCache): When creating the cache for an
16303         interface type, add all inherited members.
16304         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16305         to `out bool used_cache' and documented it.
16306         (TypeManager.MemberLookup): If we already used the cache in the first
16307         iteration, we don't need to do the interfaces check.
16308
16309 2002-08-19  Martin Baulig  <martin@gnome.org>
16310
16311         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16312         here from IMemberFinder and don't implement this interface anymore.
16313         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16314
16315         * typemanager.cs (IMemberFinder): This interface is now only used by
16316         classes which actually support the member cache.
16317         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16318         since we only put DeclSpaces into this Hashtable.
16319         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16320         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16321
16322 2002-08-16  Martin Baulig  <martin@gnome.org>
16323
16324         * typemanager.cs (ICachingMemberFinder): Removed.
16325         (IMemberFinder.MemberCache): New property.
16326         (TypeManager.FindMembers): Merged this with RealFindMembers().
16327         This function will never be called from TypeManager.MemberLookup()
16328         so we can't use the cache here, just the IMemberFinder.
16329         (TypeManager.MemberLookup_FindMembers): Check whether the
16330         IMemberFinder has a MemberCache and call the cache's FindMembers
16331         function.
16332         (MemberCache): Rewrote larger parts of this yet another time and
16333         cleaned it up a bit.
16334
16335 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16336
16337         * driver.cs (LoadArgs): Support quoting.
16338
16339         (Usage): Show the CSC-like command line arguments.
16340
16341         Improved a few error messages.
16342
16343 2002-08-15  Martin Baulig  <martin@gnome.org>
16344
16345         * typemanager.cs (IMemberContainer.Type): New property.
16346         (IMemberContainer.IsInterface): New property.
16347
16348         The following changes are conditional to BROKEN_RUNTIME, which is
16349         defined at the top of the file.
16350
16351         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16352         class'es members, but add all members from TypeHandle.ObjectType
16353         if we're an interface.
16354         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16355         is the current type.
16356         (MemberCache.CacheEntry.Container): Removed this field.
16357         (TypeHandle.GetMembers): Include inherited members.
16358
16359 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16360
16361         * typemanager.cs: fixed compilation and added a comment on a field that
16362         is never used.
16363
16364 2002-08-15  Martin Baulig  <martin@gnome.org>
16365
16366         * class.cs (ConstructorInitializer.Resolve): In the
16367         Expression.MemberLookup call, use the queried_type as
16368         invocation_type.
16369
16370         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16371         declared' attribute, it's always true.
16372         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16373         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16374         temporary wrapper for FindMembers which tells MemberLookup whether
16375         members from the base classes are included in the return value.
16376         This will go away soon.
16377         (TypeManager.MemberLookup): Use this temporary hack here; once the
16378         new MemberCache is completed, we don't need to do the DeclaredOnly
16379         looping here anymore since the MemberCache will take care of this.
16380         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16381         (MemberCache): When creating the MemberCache for a class, get
16382         members from the current class and all its base classes.
16383         (MemberCache.CacheEntry.Container): New field.  This is a
16384         temporary hack until the Mono runtime is fixed to distinguish
16385         between ReflectedType and DeclaringType.  It allows us to use MCS
16386         with both the MS runtime and the unfixed Mono runtime without
16387         problems and without accecting performance.
16388         (MemberCache.SearchMembers): The DeclaredOnly looping from
16389         TypeManager.MemberLookup is now done here.      
16390
16391 2002-08-14  Martin Baulig  <martin@gnome.org>
16392
16393         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16394         Type.GetFields on dynamic types but get the fields from the
16395         corresponding TypeContainer.
16396         (MyStructInfo.GetStructInfo): Added check for enum types.
16397
16398         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16399         (MemberList.SyncRoot): Implemented.
16400         (TypeManager.FilterWithClosure): No need to check permissions if
16401         closure_start_type == closure_invocation_type, don't crash if
16402         closure_invocation_type is null.
16403
16404 2002-08-13  Martin Baulig  <martin@gnome.org>
16405
16406         Rewrote TypeContainer.FindMembers to use a member cache.  This
16407         gives us a speed increase of about 35% for the self-hosting MCS
16408         build and of about 15-20% for the class libs (both on GNU/Linux).
16409
16410         * report.cs (Timer): New class to get enhanced profiling.  This
16411         whole class is "TIMER" conditional since it remarkably slows down
16412         compilation speed.
16413
16414         * class.cs (MemberList): New class.  This is an IList wrapper
16415         which we're now using instead of passing MemberInfo[]'s around to
16416         avoid copying this array unnecessarily.
16417         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16418         (ICachingMemberFinder, IMemberContainer): New interface.
16419         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16420         has already been checked, otherwise use it for the name comparision.
16421         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16422         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16423         if possible.  Returns a MemberList, not a MemberInfo [].
16424         (TypeHandle): New class, implements IMemberContainer.  We create
16425         one instance of this class per type, it contains a MemberCache
16426         which is used to do the member lookups.
16427         (MemberCache): New class.  Each instance of this class contains
16428         all members of a type and a name-based hash table.
16429         (MemberCache.FindMembers): This is our new member lookup
16430         function.  First, it looks up all members of the requested name in
16431         the hash table.  Then, it walks this list and sorts out all
16432         applicable members and returns them.
16433
16434 2002-08-13  Martin Baulig  <martin@gnome.org>
16435
16436         In addition to a nice code cleanup, this gives us a performance
16437         increase of about 1.4% on GNU/Linux - not much, but it's already
16438         half a second for the self-hosting MCS compilation.
16439
16440         * typemanager.cs (IMemberFinder): New interface.  It is used by
16441         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16442         Enum, Delegate or Interface.
16443         (TypeManager.finder_to_member_finder): New PtrHashtable.
16444         (TypeManager.finder_to_container): Removed.
16445         (TypeManager.finder_to_delegate): Removed.
16446         (TypeManager.finder_to_interface): Removed.
16447         (TypeManager.finder_to_enum): Removed.
16448
16449         * interface.cs (Interface): Implement IMemberFinder.
16450
16451         * delegate.cs (Delegate): Implement IMemberFinder.
16452
16453         * enum.cs (Enum): Implement IMemberFinder.
16454
16455         * class.cs (TypeContainer): Implement IMemberFinder.
16456
16457 2002-08-12  Martin Baulig  <martin@gnome.org>
16458
16459         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16460
16461 2002-08-12  Martin Baulig  <martin@gnome.org>
16462
16463         * ecore.cs (ITypeExpression): New interface for expressions which
16464         resolve to a type.
16465         (TypeExpression): Renamed to TypeLookupExpression.
16466         (Expression.DoResolve): If we're doing a types-only lookup, the
16467         expression must implement the ITypeExpression interface and we
16468         call DoResolveType() on it.
16469         (SimpleName): Implement the new ITypeExpression interface.
16470         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16471         hack, the situation that we're only looking up types can't happen
16472         anymore when this method is called.  Moved the type lookup code to
16473         DoResolveType() and call it.
16474         (SimpleName.DoResolveType): This ITypeExpression interface method
16475         is now doing the types-only lookup.
16476         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16477         (ResolveFlags): Added MaskExprClass.
16478
16479         * expression.cs (MemberAccess): Implement the ITypeExpression
16480         interface.
16481         (MemberAccess.DoResolve): Added support for a types-only lookup
16482         when we're called via ITypeExpression.DoResolveType().
16483         (ComposedCast): Implement the ITypeExpression interface.
16484
16485         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16486         Expression.Resolve() with ResolveFlags.Type instead.
16487
16488 2002-08-12  Martin Baulig  <martin@gnome.org>
16489
16490         * interface.cs (Interface.Define): Apply attributes.
16491
16492         * attribute.cs (Attribute.ApplyAttributes): Added support for
16493         interface attributes.
16494
16495 2002-08-11  Martin Baulig  <martin@gnome.org>
16496
16497         * statement.cs (Block.Emit): Only check the "this" variable if we
16498         do not always throw an exception.
16499
16500         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16501         whether the property has a set accessor.
16502
16503 2002-08-11  Martin Baulig  <martin@gnome.org>
16504
16505         Added control flow analysis support for structs.
16506
16507         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16508         with control flow analysis turned off.
16509         (IVariable): New interface.
16510         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16511         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16512         (FieldExpr.DoResolve): Resolve the instance expression with flow
16513         analysis turned off and do the definite assignment check after the
16514         resolving when we know what the expression will resolve to.
16515
16516         * expression.cs (LocalVariableReference, ParameterReference):
16517         Implement the new IVariable interface, only call the flow analysis
16518         code if ec.DoFlowAnalysis is true.
16519         (This): Added constructor which takes a Block argument.  Implement
16520         the new IVariable interface.
16521         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16522         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16523         This does the definite assignment checks for struct members.
16524
16525         * class.cs (Constructor.Emit): If this is a non-static `struct'
16526         constructor which doesn't have any initializer, call
16527         Block.AddThisVariable() to tell the flow analysis code that all
16528         struct elements must be initialized before control returns from
16529         the constructor.
16530
16531         * statement.cs (MyStructInfo): New public class.
16532         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16533         argument to this indexer.  If non-zero, check an individual struct
16534         member, not the whole struct.
16535         (FlowBranching.CheckOutParameters): Check struct members.
16536         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16537         overloaded versions of these methods which take an additional
16538         `int field_idx' argument to check struct members.
16539         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16540         overloaded versions of these methods which take an additional
16541         `string field_name' argument to check struct member.s
16542         (VariableInfo): Implement the IVariable interface.
16543         (VariableInfo.StructInfo): New public property.  Returns the
16544         MyStructInfo instance of the variable if it's a struct or null.
16545         (Block.AddThisVariable): New public method.  This is called from
16546         Constructor.Emit() for non-static `struct' constructor which do
16547         not have any initializer.  It creates a special variable for the
16548         "this" instance variable which will be checked by the flow
16549         analysis code to ensure that all of the struct's fields are
16550         initialized before control returns from the constructor.
16551         (UsageVector): Added support for struct members.  If a
16552         variable/parameter is a struct with N members, we reserve a slot
16553         in the usage vector for each member.  A struct is considered fully
16554         initialized if either the struct itself (slot 0) or all its
16555         members are initialized.
16556
16557 2002-08-08  Martin Baulig  <martin@gnome.org>
16558
16559         * driver.cs (Driver.MainDriver): Only report an error CS5001
16560         if there were no compilation errors.
16561
16562         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16563         `UnsafeContext' property to determine whether the parent is in
16564         unsafe context rather than checking the parent's ModFlags:
16565         classes nested in an unsafe class are unsafe as well.
16566
16567 2002-08-08  Martin Baulig  <martin@gnome.org>
16568
16569         * statement.cs (UsageVector.MergeChildren): Distinguish between
16570         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16571         we return.  Added test17() and test18() to test-154.cs.
16572
16573 2002-08-08  Martin Baulig  <martin@gnome.org>
16574
16575         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16576         Family access, make sure the invoking type isn't a subclass of the
16577         queried type (that'd be a CS1540).
16578
16579         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16580         this method which takes an additional `Type invocation_type'.
16581
16582         * expression.cs (BaseAccess.DoResolve): Use the base type as
16583         invocation and query type.
16584         (MemberAccess.DoResolve): If the lookup failed and we're about to
16585         report a CS0122, try a lookup with the ec.ContainerType - if this
16586         succeeds, we must report a CS1540.
16587
16588 2002-08-08  Martin Baulig  <martin@gnome.org>
16589
16590         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16591         (MethodGroupExpr): Implement the IMemberExpr interface.
16592
16593         * expression (MemberAccess.ResolveMemberAccess): No need to have
16594         any special code for MethodGroupExprs anymore, they're now
16595         IMemberExprs.   
16596
16597 2002-08-08  Martin Baulig  <martin@gnome.org>
16598
16599         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16600         Family, FamANDAssem and FamORAssem permissions.
16601         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16602
16603 2002-08-08  Martin Baulig  <martin@gnome.org>
16604
16605         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16606         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16607         or loop block.
16608
16609 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16610
16611         * driver.cs: implemented /resource option to embed managed resources.
16612
16613 2002-08-07  Martin Baulig  <martin@gnome.org>
16614
16615         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16616         (FieldBase.HasFieldInitializer): New public property.
16617         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16618         returns the field initializer and makes sure it is only resolved once.
16619         (TypeContainer.EmitFieldInitializers): Call
16620         FieldBase.GetInitializerExpression to get the initializer, this ensures
16621         that it isn't resolved multiple times.
16622
16623         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16624         the resolving process (SimpleName/MemberLookup) that we're currently
16625         emitting a field initializer (which must not access any instance members,
16626         this is an error CS0236).
16627
16628         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16629         argument, if the `IsFieldInitializer' flag is set, we must report and
16630         error CS0236 and not an error CS0120.   
16631
16632 2002-08-07  Martin Baulig  <martin@gnome.org>
16633
16634         * ecore.cs (IMemberExpr): New public interface.
16635         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16636         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16637         if the expression is an IMemberExpr.
16638
16639         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16640         to be null, implicitly default to `this' if we're non-static in
16641         this case.  Simplified the code a lot by using the new IMemberExpr
16642         interface.  Also fixed bug #28176 here.
16643
16644 2002-08-06  Martin Baulig  <martin@gnome.org>
16645
16646         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16647         ParameterReferences during semantic analysis so that we can do a
16648         type-only search when resolving Cast, TypeOf and SizeOf.
16649         (block): Pass the `current_local_parameters' to the Block's
16650         constructor.
16651
16652         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16653         argument to the constructor.
16654         (ConstructorInitializer.Resolve): Create a temporary implicit
16655         block with the parameters.
16656
16657         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16658         references here if we aren't doing a type-only search.
16659
16660         * statement.cs (Block): Added constructor which takes a
16661         `Parameters parameters' argument.
16662         (Block.Parameters): New public property.
16663
16664         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16665         to `Parameters' and made it public readonly.
16666
16667 2002-08-06  Martin Baulig  <martin@gnome.org>
16668
16669         * ecore.cs (Expression.Warning): Made this public as well.
16670
16671         * report.cs (Report.Debug): Print the contents of collections.
16672
16673 2002-08-06  Martin Baulig  <martin@gnome.org>
16674
16675         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16676         used to tell Resolve() which kinds of expressions it may return.
16677         (Expression.Resolve): Added overloaded version of this method which
16678         takes a `ResolveFlags flags' argument.  This can be used to tell
16679         Resolve() which kinds of expressions it may return.  Reports a
16680         CS0118 on error.
16681         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16682         ResolveFlags.SimpleName.
16683         (Expression.Error118): Added overloaded version of this method which
16684         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16685         which kinds of expressions are allowed.
16686
16687         * expression.cs (Argument.ResolveMethodGroup): New public method.
16688         Resolves an argument, but allows a MethodGroup to be returned.
16689         This is used when invoking a delegate.
16690
16691         * TODO: Updated a bit.
16692
16693 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16694
16695         Fixed compilation with csc.
16696
16697         * ecore.cs: Expression.Error made public. Is this correct? Should
16698         Warning be made public too?
16699
16700         * expression.cs: use ea.Location instead of ea.loc.
16701         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16702
16703 2002-08-06  Martin Baulig  <martin@gnome.org>
16704
16705         * ecore.cs (Expression.loc): Moved the location here instead of
16706         duplicating it in all derived classes.
16707         (Expression.Location): New public property.
16708         (Expression.Error, Expression.Warning): Made them non-static and
16709         removed the location argument.
16710         (Expression.Warning): Added overloaded version which takes an
16711         `int level' argument.
16712         (Expression.Error118): Make this non-static and removed the
16713         expression and location arguments.
16714         (TypeExpr): Added location argument to the constructor.
16715
16716         * expression.cs (StaticCallExpr): Added location argument to
16717         the constructor.
16718         (Indirection, PointerArithmetic): Likewise.
16719         (CheckedExpr, UnCheckedExpr): Likewise.
16720         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16721         (StringPtr): Likewise.
16722
16723
16724 2002-08-05  Martin Baulig  <martin@gnome.org>
16725
16726         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16727
16728         * assign.cs (Assign.DoResolve): Check whether the source
16729         expression is a value or variable.
16730
16731         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16732         while resolving the corresponding blocks.
16733
16734         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16735         an error, don't silently return null.
16736
16737         * statement.cs (Block.AddVariable): Do the error reporting here
16738         and distinguish between CS0128 and CS0136.
16739         (Block.DoResolve): Report all unused labels (warning CS0164).
16740         (LabeledStatement): Pass the location to the constructor.
16741         (LabeledStatement.HasBeenReferenced): New property.
16742         (LabeledStatement.Resolve): Set it to true here.
16743
16744         * statement.cs (Return.Emit): Return success even after reporting
16745         a type mismatch error (CS0126 or CS0127), this is what csc does and
16746         it avoids confusing the users with any consecutive errors.
16747
16748 2002-08-05  Martin Baulig  <martin@gnome.org>
16749
16750         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16751
16752         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16753
16754         * expression.cs (MemberAccess.DoResolve): Silently return if an
16755         error has already been reported.
16756
16757         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16758         error has already been reported.
16759
16760 2002-08-05  Martin Baulig  <martin@gnome.org>
16761
16762         * statement.cs (UsageVector): Only initialize the `parameters'
16763         vector if we actually have any "out" parameters.
16764
16765 2002-08-05  Martin Baulig  <martin@gnome.org>
16766
16767         * expression.cs (Binary.ResolveOperator): When combining delegates,
16768         they must have the same type.
16769
16770 2002-08-05  Martin Baulig  <martin@gnome.org>
16771
16772         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16773         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16774         work with the ms runtime and we also don't need it: if we're a
16775         PropertyBuilder and not in the `indexer_arguments' hash, then we
16776         are a property and not an indexer.
16777
16778         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16779         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16780         since the latter one doesn't work with the ms runtime.
16781
16782 2002-08-03  Martin Baulig  <martin@gnome.org>
16783
16784         Fixed bugs #27998 and #22735.
16785
16786         * class.cs (Method.IsOperator): New public field.
16787         (Method.CheckBase): Report CS0111 if there's already a method
16788         with the same parameters in the current class.  Report CS0508 when
16789         attempting to change the return type of an inherited method.
16790         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16791         and it's not marked abstract or extern.
16792         (PropertyBase): New abstract base class for Property and Indexer.
16793         (PropertyBase.CheckBase): Moved here from Property and made it work
16794         for indexers.
16795         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16796         the same so we can reuse it there.
16797         (Property, Indexer): Derive from PropertyBase.
16798         (MethodSignature.inheritable_property_signature_filter): New delegate
16799         to find properties and indexers.
16800
16801         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16802         argument and improved error reporting.
16803
16804         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16805         EmptyReadOnlyParameters and made it a property.
16806
16807         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16808         version of this method which takes a `PropertyInfo indexer'.
16809         (TypeManager.RegisterIndexer): New method.
16810
16811         * class.cs: Added myself as author of this file :-)
16812
16813 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16814
16815         * class.cs: fixed compilation on windoze.
16816
16817 2002-08-03  Martin Baulig  <martin@gnome.org>
16818
16819         * interface.cs (Interface.GetInterfaceBases): Check whether all
16820         base interfaces are at least as accessible than the current one.
16821
16822         * class.cs (TypeContainer.GetClassBases): Check whether base types
16823         are at least as accessible than the current type.
16824         (TypeContainer.AsAccessible): Implemented and made non-static.
16825         (MemberBase.CheckParameters): Report errors if the accessibility
16826         checks fail.
16827
16828         * delegate.cs (Delegate.Delegate): The default visibility is
16829         internal for top-level types and private for nested types.
16830         (Delegate.Define): Report errors if the accessibility checks fail.
16831
16832         * enum.cs (Enum.Enum): The default visibility is internal for
16833         top-level types and private for nested types.
16834         (Enum.DefineType): Compute the correct visibility.
16835
16836         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16837         function which takes a `bool is_toplevel' instead of a TypeContainer.
16838
16839         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16840         builtin type.
16841
16842 2002-08-02  Martin Baulig  <martin@gnome.org>
16843
16844         * expression.cs (LocalVariableReferenc): Added constructor which
16845         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16846         (LocalVariableReference.IsReadOnly): New property.
16847         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16848         variable is readonly, use our own readonly flag to do this; you can
16849         use the new constructor to get a writable reference to a read-only
16850         variable.
16851
16852         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16853         reference to the local variable.
16854
16855 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16856
16857         * rootcontext.cs (ResolveCore): Also include System.Exception
16858
16859         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16860         we reach an EmptyStatement.
16861
16862         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16863         is also fine.
16864
16865         * expression.cs (Binary.ResolveOperator): Check error result in
16866         two places.
16867
16868         use brtrue/brfalse directly and avoid compares to null.
16869
16870 2002-08-02  Martin Baulig  <martin@gnome.org>
16871
16872         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16873         Fixes bug #28407, added test-155.cs.
16874
16875 2002-08-01  Martin Baulig  <martin@gnome.org>
16876
16877         * class.cs (Event.EmitDefaultMethod): Make this work with static
16878         events.  Fixes #28311, added verify-3.cs.
16879
16880 2002-08-01  Martin Baulig  <martin@gnome.org>
16881
16882         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16883         `is_disposable' fields.
16884         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16885         `hm.is_disposable' if we're using the collection pattern.
16886         (Foreach.EmitCollectionForeach): Use the correct type for the
16887         enumerator's local variable, only emit the try/finally block if
16888         necessary (fixes #27713).
16889
16890 2002-08-01  Martin Baulig  <martin@gnome.org>
16891
16892         * ecore.cs (Expression.report118): Renamed to Error118 and made
16893         it public static.
16894
16895         * statement.cs (Throw.Resolve): Check whether the expression is of
16896         the correct type (CS0118) and whether the type derives from
16897         System.Exception (CS0155).
16898         (Catch.Resolve): New method.  Do the type lookup here and check
16899         whether it derives from System.Exception (CS0155).
16900         (Catch.CatchType, Catch.IsGeneral): New public properties.
16901
16902         * typemanager.cs (TypeManager.exception_type): Added.
16903
16904 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16905
16906         * driver.cs: Updated About function.
16907
16908 2002-07-31  Martin Baulig  <martin@gnome.org>
16909
16910         Implemented Control Flow Analysis.
16911
16912         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16913         (EmitContext.CurrentBranching): Added.
16914         (EmitContext.StartFlowBranching): Added.
16915         (EmitContext.EndFlowBranching): Added.
16916         (EmitContext.KillFlowBranching): Added.
16917         (EmitContext.IsVariableAssigned): Added.
16918         (EmitContext.SetVariableAssigned): Added.
16919         (EmitContext.IsParameterAssigned): Added.
16920         (EmitContext.SetParameterAssigned): Added.
16921         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16922         Added control flow analysis stuff here.
16923
16924         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16925         resolve the expression as lvalue.
16926         (LocalVariableReference.DoResolve): Check whether the variable has
16927         already been assigned.
16928         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16929         the parameter as assigned here.
16930         (ParameterReference.DoResolve): Check whether the parameter has already
16931         been assigned.
16932         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16933         expression as lvalue.
16934
16935         * statement.cs (FlowBranching): New class for the flow analysis code.
16936         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16937         (LabeledStatement.IsDefined): New public property.
16938         (LabeledStatement.AddUsageVector): New public method to tell flow
16939         analyis that the label may be reached via a forward jump.
16940         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16941         flow analysis.
16942         (VariableInfo.Number): New public field.  This is used by flow analysis
16943         to number all locals of a block.
16944         (Block.CountVariables): New public property.  This is the number of
16945         local variables in this block (including the locals from all parent
16946         blocks).
16947         (Block.EmitMeta): Number all the variables.
16948
16949         * statement.cs: Added flow analysis support to all classes.
16950
16951 2002-07-31  Martin Baulig  <martin@gnome.org>
16952
16953         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16954         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16955         then use this argument.
16956
16957         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16958
16959         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16960         use this to specify /define options.
16961
16962 2002-07-29  Martin Baulig  <martin@gnome.org>
16963
16964         * statement.cs (Fixed): Moved all code that does variable lookups
16965         and resolvings from Emit to Resolve.
16966
16967         * statement.cs (For): Moved all code that does variable lookups
16968         and resolvings from Emit to Resolve.
16969
16970         * statement.cs (Using): Moved all code that does variable lookups
16971         and resolvings from Emit to Resolve.
16972
16973 2002-07-29  Martin Baulig  <martin@gnome.org>
16974
16975         * attribute.cs (Attribute.Resolve): Explicitly catch a
16976         System.NullReferenceException when creating the
16977         CustromAttributeBuilder and report a different warning message.
16978
16979 2002-07-29  Martin Baulig  <martin@gnome.org>
16980
16981         * support.cs (ParameterData.ParameterName): Added method to
16982         get the name of a parameter.
16983
16984         * typemanager.cs (TypeManager.IsValueType): New public method.
16985
16986 2002-07-29  Martin Baulig  <martin@gnome.org>
16987
16988         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16989         is a flag which specifies that it's either ref or out.
16990         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16991         the out parameter to `out Parameter.Modifier mod', also set the
16992         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16993
16994         * support.cs (InternalParameters.ParameterModifier): Distinguish
16995         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16996         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16997
16998         * expression.cs (Argument.GetParameterModifier): Distinguish
16999         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17000         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17001
17002 2002-07-29  Martin Baulig  <martin@gnome.org>
17003
17004         * expression.cs (ParameterReference.ParameterReference): Added
17005         `Location loc' argument to the constructor.
17006
17007         * cs-parser.jay: Pass location to ParameterReference.
17008
17009 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17010
17011         * statement.cs (Try): Initialize the location.
17012
17013         * cs-parser.jay: pass location to Try.
17014
17015         * expression.cs (Unary.Reduce): Change the prototype to return
17016         whether a constant fold could be performed or not.  The result is
17017         returned in an out parameters.  In the case of Indirection and
17018         AddressOf, we want to perform the full tests.
17019
17020 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * statement.cs (Statement.Emit): Flag dead code.
17023
17024 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17025
17026         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17027
17028 2002-07-27  Martin Baulig  <martin@gnome.org>
17029
17030         * class.cs (MethodData.Define): Put back call to
17031         TypeManager.AddMethod(), accidentally commented this out.
17032
17033         * report.cs (Debug): New public method to print debugging information,
17034         this is `[Conditional ("DEBUG")]'.
17035
17036 2002-07-26  Martin Baulig  <martin@gnome.org>
17037
17038         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17039         (switch_statement): Push the current_block to the switch_stack and
17040         pop it again when we're done with the switch.
17041         (switch_section): The new block is a child of the current_block.
17042         Fixes bug #24007, added test-152.cs.
17043
17044 2002-07-27  Martin Baulig  <martin@gnome.org>
17045
17046         * expression.cs (Invocation.EmitArguments): When calling a varargs
17047         function with only its fixed arguments, we need to pass an empty
17048         array.
17049
17050 2002-07-27  Martin Baulig  <martin@gnome.org>
17051
17052         Mono 0.13 has been released.
17053
17054 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * driver.cs: Rename --resource to --linkres, because that is what
17057         we do currently, we dont support --resource yet.
17058
17059         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17060
17061 2002-07-25  Martin Baulig  <martin@gnome.org>
17062
17063         * class.cs (MethodData): New public class.  This is a `method builder'
17064         class for a method or one accessor of a Property/Indexer/Event.
17065         (MethodData.GetMethodFlags): Moved here from MemberBase.
17066         (MethodData.ApplyAttributes): Likewise.
17067         (MethodData.ApplyObsoleteAttribute): Likewise.
17068         (MethodData.ApplyConditionalAttribute): Likewise.
17069         (MethodData.ApplyDllImportAttribute): Likewise.
17070         (MethodData.CheckAbstractAndExternal): Likewise.
17071         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17072         (MethodData.Emit): Formerly known as Method.Emit().
17073         (MemberBase): Moved everything which was specific to a single
17074         accessor/method to MethodData.
17075         (Method): Create a new MethodData and call Define() and Emit() on it.
17076         (Property, Indexer, Event): Create a new MethodData objects for each
17077         accessor and call Define() and Emit() on them.
17078
17079 2002-07-25  Martin Baulig  <martin@gnome.org>
17080
17081         Made MethodCore derive from MemberBase to reuse the code from there.
17082         MemberBase now also checks for attributes.
17083
17084         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17085         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17086         as virtual.
17087         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17088         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17089         (MemberBase.ApplyAttributes): New virtual method; applies the
17090         attributes to a method or accessor.
17091         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17092         (MemberBase.ApplyConditionalAttribute): Likewise.
17093         (MemberBase.ApplyDllImportAttribute): Likewise.
17094         (MemberBase.CheckAbstractAndExternal): Likewise.
17095         (MethodCore.ParameterTypes): This is now a property instead of a
17096         method, it's initialized from DoDefineParameters().
17097         (MethodCore.ParameterInfo): Removed the set accessor.
17098         (MethodCore.DoDefineParameters): New protected virtual method to
17099         initialize ParameterTypes and ParameterInfo.
17100         (Method.GetReturnType): We can now simply return the MemberType.
17101         (Method.GetMethodFlags): Override the MemberBase version and add
17102         the conditional flags.
17103         (Method.CheckBase): Moved some code from Define() here, call
17104         DoDefineParameters() here.
17105         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17106         here to avoid some larger code duplication.
17107         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17108         ensure that abstract and external accessors don't declare a body.
17109
17110         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17111         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17112         lookup in the attribute's parent classes, so we need to abort as soon
17113         as we found the first match.
17114         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17115         the attribute has no arguments.
17116
17117         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17118         of a Method.
17119
17120 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17121
17122         * cs-parser.jay: reverted previous patch.
17123
17124 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17125
17126         * cs-parser.jay: fixed bug #22119.
17127
17128 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17129
17130         * attribute.cs: fixed compilation. The error was:
17131         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17132         be assigned to before control leaves the current method."
17133         [FIXME:  Filed as bug #28186: MCS must report this error.]
17134
17135 2002-07-25  Martin Baulig  <martin@gnome.org>
17136
17137         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17138         method to pull the condition name ouf of a Conditional attribute.
17139         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17140         the obsolete message and error flag out of an Obsolete attribute.
17141
17142         * class.cs (Method.GetMethodFlags): New public method to get the
17143         TypeManager.MethodFlags for this method.
17144         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17145         private methods.
17146         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17147         if we're overriding a virtual function, set the new private variable
17148         `parent_method'; call the new TypeManager.AddMethod().
17149
17150         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17151         the MethodBuilder and the Method in a PtrHashtable.
17152         (TypeManager.builder_to_method): Added for this purpose.
17153         (TypeManager.MethodFlags): Added IsObsoleteError.
17154         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17155         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17156         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17157         the message from the attribute.
17158
17159 2002-07-24  Martin Baulig  <martin@gnome.org>
17160
17161         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17162         preprocessor directives, ensure that the argument to #define/#undef is
17163         exactly one identifier and that it's actually an identifier.
17164
17165         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17166         did not work ....
17167
17168 2002-07-24  Martin Baulig  <martin@gnome.org>
17169
17170         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17171         initialize it to TypeManager.object_type in the constructor.
17172         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17173         of the `hm.get_current' method if we're using the collection pattern.
17174         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17175         for the explicit conversion to make it work when we're using the collection
17176         pattern and the `Current' property has a different return type than `object'.
17177         Fixes #27713.
17178
17179 2002-07-24  Martin Baulig  <martin@gnome.org>
17180
17181         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17182         does not match, but don't report any errors.  This method is called in
17183         order for all methods in a MethodGroupExpr until a matching method is
17184         found, so we don't want to bail out if the first method doesn't match.
17185         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17186         matches, report the 123.  Fixes #28070.
17187
17188 2002-07-24  Martin Baulig  <martin@gnome.org>
17189
17190         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17191         TypeManager.TypeToCoreType() to the top of the method so the
17192         following equality checks will work.  Fixes #28107.
17193
17194 2002-07-24  Martin Baulig  <martin@gnome.org>
17195
17196         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17197         operand is of type uint, and the other operand is of type sbyte,
17198         short or int, the operands are converted to type long." -
17199         Actually do what this comment already told us.  Fixes bug #28106,
17200         added test-150.cs.
17201
17202 2002-07-24  Martin Baulig  <martin@gnome.org>
17203
17204         * class.cs (MethodBase): New abstract class.  This is now a base
17205         class for Property, Indexer and Event to avoid some code duplication
17206         in their Define() and DefineMethods() methods.
17207         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17208         generic methods for Define() and DefineMethods().
17209         (FieldBase): Derive from MemberBase, not MemberCore.
17210         (Property): Derive from MemberBase, not MemberCore.
17211         (Property.DefineMethod): Moved all the code from this method to the
17212         new MethodBase.DefineAccessor(), just call it with appropriate
17213         argumetnts.
17214         (Property.Define): Call the new Property.DoDefine(), this does some
17215         sanity checks and we don't need to duplicate the code everywhere.
17216         (Event): Derive from MemberBase, not MemberCore.
17217         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17218         accessors, this will also make them work with interface events.
17219         (Indexer): Derive from MemberBase, not MemberCore.
17220         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17221         (Indexer.Define): Use the new MethodBase functions.
17222
17223         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17224         argument to the constructor.
17225         (Interface.FindMembers): Added support for interface events.
17226         (Interface.PopluateEvent): Implemented.
17227
17228         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17229
17230 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17233         but this is required to check for a method name being the same as
17234         the containing class.  
17235
17236         Handle this now.
17237
17238 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17239
17240         * interface.cs: initialize variable.
17241
17242 2002-07-23  Martin Baulig  <martin@gnome.org>
17243
17244         Implemented the IndexerName attribute in interfaces.
17245
17246         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17247         name if this is an explicit interface implementation.
17248         (Indexer.InterfaceIndexerName): New public variable.  If we're
17249         implementing an interface indexer, this is the IndexerName in that
17250         interface.  Otherwise, it's the IndexerName.
17251         (Indexer.DefineMethod): If we're implementing interface indexer,
17252         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17253         and Pending.ImplementIndexer methods.
17254         (Indexer.Define): Also define the PropertyBuilder if we're
17255         implementing an interface indexer and this is neither an explicit
17256         interface implementation nor do the IndexerName match the one in
17257         the interface.
17258
17259         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17260         If a method is defined here, then we always need to create a proxy
17261         for it.  This is used when implementing interface indexers.
17262         (Pending.IsInterfaceIndexer): New public method.
17263         (Pending.ImplementIndexer): New public method.
17264         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17265         This is used when implementing interface indexers to define a proxy
17266         if necessary.
17267         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17268         define a proxy if necessary.
17269
17270         * interface.cs (Interface.IndexerName): New public variable.
17271         (Interface.PopulateIndexer): Set the IndexerName.
17272         (Interface.DefineIndexers): New private method.  Populate all the
17273         indexers and make sure their IndexerNames match.
17274
17275         * typemanager.cs (IndexerPropertyName): Added support for interface
17276         indexers.
17277
17278 2002-07-22  Martin Baulig  <martin@gnome.org>
17279
17280         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17281         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17282         ret if HasReturnLabel.
17283         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17284         variables.
17285
17286         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17287         and set the ec.LoopBeginTryCatchLevel.
17288         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17289         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17290         the current ec.TryCatchLevel, the branch goes out of an exception
17291         block.  In this case, we need to use Leave and not Br.
17292
17293 2002-07-22  Martin Baulig  <martin@gnome.org>
17294
17295         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17296         block unless the block does not always return or it is contained in
17297         another try { ... } catch { ... } block.  Fixes bug #26506.
17298         Added verify-1.cs to the test suite.
17299
17300 2002-07-22  Martin Baulig  <martin@gnome.org>
17301
17302         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17303         then we do not always return.  Fixes bug #24985.
17304
17305 2002-07-22  Martin Baulig  <martin@gnome.org>
17306
17307         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17308         lookup on a per-class level; ie. walk up the class hierarchy until we
17309         found at least one applicable method, then choose the best among them.
17310         Fixes bug #24463 and test-29.cs.
17311
17312 2002-07-22  Martin Baulig  <martin@gnome.org>
17313
17314         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17315         return types of the methods.  The return type is not part of the
17316         signature and we must not check it to make the `new' modifier work.
17317         Fixes bug #27999, also added test-147.cs.
17318         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17319
17320         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17321         on the method's return type.
17322
17323 2002-07-21  Martin Baulig  <martin@gnome.org>
17324
17325         * assign.cs: Make this work if the rightmost source is a constant and
17326         we need to do an implicit type conversion.  Also adding a few more tests
17327         to test-38.cs which should have caught this.
17328
17329         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17330         target in the makefile for this.  The makefile.gnu is primarily intended
17331         for end-users who don't want to debug the compiler.
17332
17333 2002-07-21  Martin Baulig  <martin@gnome.org>
17334
17335         * assign.cs: Improved the Assign class so it can now handle embedded
17336         assignments (X = Y = Z = something).  As a side-effect this'll now also
17337         consume less local variables.  test-38.cs now passes with MCS, added
17338         a few new test cases to that test.
17339
17340 2002-07-20  Martin Baulig  <martin@gnome.org>
17341
17342         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17343         instructions.  Fixes bug #27977, also added test-146.cs.
17344
17345 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17346
17347         * cs-tokenizer.cs: fixed getHex ().
17348
17349 2002-07-19  Martin Baulig  <martin@gnome.org>
17350
17351         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17352         not Type.GetType() to lookup the array type.  This is needed when
17353         we're constructing an array of a user-defined type.
17354         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17355         single-dimensional arrays, but also for single-dimensial arrays of
17356         type decimal.
17357
17358 2002-07-19  Martin Baulig  <martin@gnome.org>
17359
17360         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17361         this function is called, it's not allowed to share LocalBuilders
17362         among ILGenerators.
17363
17364 2002-07-19  Martin Baulig  <martin@gnome.org>
17365
17366         * expression.cs (Argument.Resolve): Report an error 118 when trying
17367         to pass a type as argument.
17368
17369 2002-07-18  Martin Baulig  <martin@gnome.org>
17370
17371         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17372         Conv_R_Un for the signed `long' type.
17373
17374 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17375
17376         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17377         `expr' for the temporary result, as that will fail if we do
17378         multiple resolves on the same expression.
17379
17380 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17381
17382         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17383         ec.TypeContainer for looking up aliases. 
17384
17385         * class.cs (TypeContainer): Remove LookupAlias from here.
17386
17387         * decl.cs (DeclSpace); Move here.
17388
17389 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17390
17391         * class.cs (FindMembers): Only call filter if the constructor
17392         bulider is not null.
17393
17394         Also handle delegates in `NestedTypes' now.  Now we will perform
17395         type lookups using the standard resolution process.  This also
17396         fixes a bug.
17397
17398         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17399         This uses Expressions (the limited kind that can be parsed by the
17400         tree) instead of strings.
17401
17402         * expression.cs (ComposedCast.ToString): Implement, used to flag
17403         errors since now we have to render expressions.
17404
17405         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17406         FormArrayType. 
17407
17408         * ecore.cs (SimpleName.ToString): ditto.
17409
17410         * cs-parser.jay: Instead of using strings to assemble types, use
17411         Expressions to assemble the type (using SimpleName, ComposedCast,
17412         MemberAccess).  This should fix the type lookups in declarations,
17413         because we were using a different code path for this.
17414
17415         * statement.cs (Block.Resolve): Continue processing statements
17416         even when there is an error.
17417
17418 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * class.cs (Event.Define): Also remove the `remove' method from
17421         the list of pending items.
17422
17423         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17424         generate more compact code. 
17425
17426 2002-07-17  Martin Baulig  <martin@gnome.org>
17427
17428         * const.cs (Const.LookupConstantValue): Add support for constant
17429         `unchecked' and `checked' expressions.
17430         Also adding test case test-140.cs for this.
17431
17432 2002-07-17  Martin Baulig  <martin@gnome.org>
17433
17434         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17435         check whether mi.ReturnType implements the IEnumerator interface; the
17436         `==' and the IsAssignableFrom() will fail in this situation.
17437
17438 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17439
17440         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17441         here too.
17442
17443 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17444
17445         * expression.cs: fixed bug #27811.
17446
17447 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17448
17449         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17450         Molaro: when we are a ref, the value already contains a pointer
17451         value, do not take the address of it.
17452
17453 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17454         * removed mb-parser.jay and mb-tokenizer.cs
17455
17456 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17457
17458         * expression.cs: check against the building corlib void type.
17459
17460 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17461
17462         * ecore.cs: fix for valuetype static readonly fields: when 
17463         initializing them, we need their address, not the address of a copy.
17464
17465 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17466
17467         * typemanager.cs: register also enum_type in corlib.
17468
17469 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17470
17471         * class.cs: allow calling this (but not base) initializers in structs.
17472
17473 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17474
17475         * ecore.cs: make sure we compare against the building base types
17476         in GetTypeSize ().
17477
17478 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17479
17480         * typemanager.cs: fix TypeToCoreType() to handle void and object
17481         (corlib gets no more typerefs after this change).
17482
17483 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17484
17485         * expression.cs (ArrayCreation.EmitArrayArguments): use
17486         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17487
17488         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17489         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17490         array indexes, the runtime actually forbids them.
17491
17492         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17493         for array arguments here.
17494
17495         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17496         instead of the default for ValueTypes.
17497
17498         (New.DoEmit): Use IsValueType instead of
17499         IsSubclassOf (value_type)
17500         (New.DoResolve): ditto.
17501         (Invocation.EmitCall): ditto.
17502
17503         * assign.cs (Assign): ditto.
17504
17505         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17506         Statements *are* currently doing part of their resolution during
17507         Emit.  
17508
17509         Expressions do always resolve during resolve, but statements are
17510         only required to propagate resolution to their children.
17511
17512 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17513
17514         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17515
17516         (LoadAssembly): Do not add the dll if it is already specified
17517
17518         (MainDriver): Add the System directory to the link path at the end,
17519         after all the other -L arguments. 
17520
17521         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17522         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17523         ldelem.u1) and using the opposite for sbytes.
17524
17525         This fixes Digger, and we can finally run it.
17526
17527         * driver.cs (UnixParseOption): Move the option parsing here.  
17528         (CSCParseOption): Implement CSC-like parsing of options.
17529
17530         We now support both modes of operation, the old Unix way, and the
17531         new CSC-like way.  This should help those who wanted to make cross
17532         platform makefiles.
17533
17534         The only thing broken is that /r:, /reference: and /lib: are not
17535         implemented, because I want to make those have the same semantics
17536         as the CSC compiler has, and kill once and for all the confussion
17537         around this.   Will be doing this tomorrow.
17538
17539         * statement.cs (Unsafe.Resolve): The state is checked during
17540         resolve, not emit, so we have to set the flags for IsUnsfe here.
17541
17542 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17543
17544         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17545         not catch the Error_ObjectRefRequired in SimpleName (as it is
17546         possible to have a class/instance variable name that later gets
17547         deambiguated), we have to check this here.      
17548
17549 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17550
17551         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17552         make static and put into Expression.
17553
17554         (Event.Define): Register the private field of the event with the 
17555         TypeManager so that GetFieldFromEvent can get at it.
17556
17557         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17558         keep track of the private field associated with an event which
17559         has no accessors.
17560
17561         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17562         private field.
17563
17564         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17565
17566 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17567
17568         * expression.cs (Binary.EmitBranchable): this routine emits the
17569         Binary expression in a branchable context.  This basically means:
17570         we need to branch somewhere, not just get the value on the stack.
17571
17572         This works together with Statement.EmitBoolExpression.
17573
17574         * statement.cs (Statement.EmitBoolExpression): Use
17575         EmitBranchable. 
17576
17577 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17578
17579         * statement.cs (For): Reduce the number of jumps in loops.
17580
17581         (For): Implement loop inversion for the For statement.
17582
17583         (Break): We can be breaking out of a Try/Catch controlled section
17584         (foreach might have an implicit try/catch clause), so we need to
17585         use Leave instead of Br.
17586
17587         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17588         now).  If the instace expression supports IMemoryLocation, we use
17589         the AddressOf method from the IMemoryLocation to extract the
17590         address instead of emitting the instance.
17591
17592         This showed up with `This', as we were emitting the instance
17593         always (Emit) instead of the Address of This.  Particularly
17594         interesting when This is a value type, as we dont want the Emit
17595         effect (which was to load the object).
17596
17597 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17598
17599         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17600
17601         * statement.cs (Checked): Set the CheckedState during the resolve
17602         process too, as the ConvCast operations track the checked state on
17603         the resolve process, and not emit.
17604
17605         * cs-parser.jay (namespace_member_declaration): Flag that we have
17606         found a declaration when we do.  This is used to flag error 1529
17607
17608         * driver.cs: Report ok when we display the help only.
17609
17610 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17611
17612         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17613
17614 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17615
17616         * cs-tokenizer.cs (define): We also have to track locally the
17617         defines.  AllDefines is just used for the Conditional Attribute,
17618         but we also need the local defines for the current source code. 
17619
17620 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17621
17622         * statement.cs (While, For, Do): These loops can exit through a
17623         Break statement, use this information to tell whether the
17624         statement is the last piece of code.
17625
17626         (Break): Flag that we break.
17627
17628         * codegen.cs (EmitContexts): New `Breaks' state variable.
17629
17630 2002-07-03  Martin Baulig  <martin@gnome.org>
17631
17632         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17633         modifiers in method declarations in structs.  Otherwise, you won't
17634         be able to override things like Object.Equals().
17635
17636 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17637
17638         * class.cs (Method, Property, Indexer): Do not allow the public
17639         modifier to be used in explicit interface implementations.
17640
17641         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17642         override modifiers in method declarations in structs
17643
17644 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17645
17646         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17647         integer or real overflow, report an error
17648
17649 2002-07-02  Martin Baulig  <martin@gnome.org>
17650
17651         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17652         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17653         to tell the runtime about our newly created System.Object and
17654         System.ValueType types.
17655
17656 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17657
17658         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17659         struct instead of Ldarg/Starg.
17660
17661 2002-07-02  Martin Baulig  <martin@gnome.org>
17662
17663         * expression.cs (Indirection.Indirection): Call
17664         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17665
17666 2002-07-02  Martin Baulig  <martin@gnome.org>
17667
17668         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17669         ValueType, call TypeManager.TypeToCoreType() on it.
17670         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17671         the OpCodes.Newarr argument.
17672
17673 2002-07-02  Martin Baulig  <martin@gnome.org>
17674
17675         * expression.cs (Invocation.EmitCall): When compiling corlib,
17676         replace all calls to the system's System.Array type to calls to
17677         the newly created one.
17678
17679         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17680         System.Array methods.
17681         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17682         from the system's System.Array type which must be replaced.
17683
17684 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17685
17686         * typemanager.cs: load unverifiable_code_ctor so we can build
17687         corlib using the correct type. Avoid using GetTypeCode() with
17688         TypeBuilders.
17689         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17690         TypeManager.object_type to allow building corlib.
17691
17692 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17693
17694         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17695
17696 2002-07-01  Martin Baulig  <martin@gnome.org>
17697
17698         * class.cs: Make the last change actually work, we need to check
17699         whether `ifaces != null' to avoid a crash.
17700
17701 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17702
17703         * class.cs: when we build structs without fields that implement
17704         interfaces, we need to add the interfaces separately, since there is
17705         no API to both set the size and add the interfaces at type creation
17706         time.
17707
17708 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17709
17710         * expression.cs: the dimension arguments to the array constructors
17711         need to be converted if they are a long.
17712
17713 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17714
17715         * class.cs: don't emit ldarg.0 if there is no parent constructor
17716         (fixes showstopper for corlib).
17717
17718 2002-06-29  Martin Baulig  <martin@gnome.org>
17719
17720         MCS now compiles corlib on GNU/Linux :-)
17721
17722         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17723         ie. check for MethodImplOptions.InternalCall.
17724
17725         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17726         and TypeManager.attribute_type are null, so we must explicitly check
17727         whether parent is not null to find out whether it's an attribute type.
17728         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17729         and SetBuilder, not only if the property is neither abstract nor external.
17730         This is necessary to set the MethodImplOptions on the accessor methods.
17731         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17732         SetBuilder, see Property.Emit().
17733
17734         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17735         populate "System.Object", "System.ValueType" and "System.Attribute" since
17736         they've already been populated from BootCorlib_PopulateCoreTypes().
17737
17738 2002-06-29  Martin Baulig  <martin@gnome.org>
17739
17740         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17741         is the NullLiteral, we also need to make sure that target_type is not
17742         an enum type.   
17743
17744 2002-06-29  Martin Baulig  <martin@gnome.org>
17745
17746         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17747         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17748         before calling BootstrapCorlib_ResolveDelegate ().
17749
17750 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17751
17752         * statement.cs: fixed build-breaker. All tests passed ok.
17753
17754 2002-06-27  Martin Baulig  <martin@gnome.org>
17755
17756         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17757         for System.Decimal when compiling corlib.
17758
17759 2002-06-27  Martin Baulig  <martin@gnome.org>
17760
17761         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17762         switch blocks which contain nothing but a default clause.
17763
17764 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17765
17766        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17767
17768 2002-06-27  Martin Baulig  <martin@gnome.org>
17769
17770         * ecore.cs (PropertyExpr.PropertyExpr): Call
17771         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17772
17773         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17774         is already a TypeBuilder.
17775
17776 2002-06-27  Martin Baulig  <martin@gnome.org>
17777
17778         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17779         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17780         the "from an array-type to System.Array" case.  This makes it work
17781         when compiling corlib.
17782
17783 2002-06-27  Martin Baulig  <martin@gnome.org>
17784
17785         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17786         non-static PropertyExpr, set its InstanceExpression.  This makes
17787         the `ICollection.Count' property work in System/Array.cs.
17788
17789 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17790
17791         * driver.cs: Made error handling more consistent.  Errors now
17792         tracked by Report class, so many methods which used to return int
17793         now return void.  Main() now prints success/failure and 
17794         errors/warnings message.
17795
17796         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17797         the magic number return values (123 and 124).  Now, if the
17798         expected error occurs, the compiler exits with success (exit value
17799         0).  If the compilation completes without seeing that particular
17800         error, the compiler exits with failure (exit value 1).  The
17801         makefile in mcs/errors has been changed to handle the new behaviour.
17802
17803         * report.cs: Made 'expected error' number a property and renamed
17804         it from 'Probe' to 'ExpectedError'.
17805
17806         * genericparser.cs: Removed error handling support, since it is
17807         now all done by Report class.
17808
17809         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17810         class, so parse() no longer returns an int.
17811
17812         * namespace.cs: Use Report.Error instead of GenericParser.error
17813
17814 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17817         TypeContainer.AddOperator): At the front of the list put the
17818         explicit implementations, so they get resolved/defined first. 
17819
17820 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17821
17822         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17823         interface type is implemented by this TypeContainer.  Used during
17824         explicit interface implementation.
17825
17826         (Property.Define, Indexer.Define, Method.Define): Validate that
17827         the given interface in the explicit implementation is one of the
17828         base classes for the containing type.
17829
17830         Also if we are explicitly implementing an interface, but there is
17831         no match in the pending implementation table, report an error.
17832
17833         (Property.Define): Only define the property if we are
17834         not explicitly implementing a property from an interface.  Use the
17835         correct name also for those properties (the same CSC uses,
17836         although that is really not needed).
17837
17838         (Property.Emit): Do not emit attributes for explicitly implemented
17839         properties, as there is no TypeBuilder.
17840
17841         (Indexer.Emit): ditto.
17842
17843         Hiding then means that we do not really *implement* a pending
17844         implementation, which makes code fail.
17845
17846 2002-06-22  Martin Baulig  <martin@gnome.org>
17847
17848         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17849         the return value of Object.GetType().  [FIXME: we need to do this whenever
17850         we get a type back from the reflection library].
17851
17852 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17853
17854         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17855
17856 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17857
17858         * attribute.cs: Return null if we can not look up the type.
17859
17860         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17861         the interface types found.
17862
17863         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17864         interface types found.
17865
17866         * typemanager.cs (GetInterfaces): Make this routine returns alll
17867         the interfaces and work around the lame differences between
17868         System.Type and System.Reflection.Emit.TypeBuilder in the results
17869         result for GetInterfaces.
17870
17871         (ExpandInterfaces): Given an array of interface types, expand and
17872         eliminate repeated ocurrences of an interface.  This expands in
17873         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17874         be IA, IB, IC.
17875
17876 2002-06-21  Martin Baulig  <martin@gnome.org>
17877
17878         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17879         on System.Enum.
17880
17881 2002-06-21  Martin Baulig  <martin@gnome.org>
17882
17883         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17884         and called with one of the core types, return the corresponding typebuilder for
17885         that type.
17886
17887         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17888         element type.
17889
17890 2002-06-21  Martin Baulig  <martin@gnome.org>
17891
17892         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17893         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17894         (Expression.ConvertReferenceExplicit): Likewise.
17895
17896         * expression.cs (ElementAccess.DoResolve): Likewise.
17897         (ElementAccess.DoResolveLValue): Likewise.
17898
17899 2002-06-10  Martin Baulig  <martin@gnome.org>
17900
17901         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17902         add the "value" parameter to the parameter list.
17903
17904         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17905         to our caller.
17906
17907 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17908
17909         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17910         the argument to an int, uint, long or ulong, per the spec.  Also
17911         catch negative constants in array creation.
17912
17913 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17914
17915         * class.cs: do not allow the same interface to appear twice in
17916         the definition list.
17917
17918 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17919
17920         * ecore.cs: don't use ldlen with System.Array.
17921
17922 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17923
17924         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17925
17926 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17927
17928         * modifiers.cs: produce correct field attributes for protected
17929         internal. Easy fix so miguel can work on ther harder stuff:-)
17930
17931 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * pending.cs: New file.  Move the code from class.cs here.
17934         Support clearning the pending flag for all methods (when not doing
17935         explicit interface implementation).
17936
17937 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17938
17939         * rootcontext.cs: added a couple more types needed to bootstrap.
17940
17941 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17942
17943         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17944         constructor in the type, instead of any constructor in the type
17945         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17946         a bug in the Mono runtime when applying the params attribute). 
17947
17948 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17949         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17950
17951 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17952
17953         * expression.cs (Unary.ResolveOperator): Use TypeManager
17954         to resolve the type.
17955
17956 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17957
17958         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17959         attached.
17960
17961         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17962         with each member too.
17963
17964         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17965         field builders too - this takes care of the enum member case.
17966
17967 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17968
17969         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17970         address-of operator on both value types and pointers.
17971
17972 2002-06-10  Martin Baulig  <martin@gnome.org>
17973
17974         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17975         PropertyBuilder to the `property_builders' list.
17976
17977         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17978         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17979         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17980         find any indexers which are inherited from an interface.
17981
17982 2002-06-09  Martin Baulig  <martin@gnome.org>
17983
17984         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17985         the same type as the constant if necessary.  There's also a test-130.cs
17986         for this.
17987
17988         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17989
17990         * typemanager.cs (TypeManager.ChangeType): Previously known as
17991         Enum.ChangeEnumType().
17992
17993 2002-06-09  Martin Baulig  <martin@gnome.org>
17994
17995         * expression.cs (Cast.TryReduce): Added support for consts.
17996
17997 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17998
17999         * class.cs (Accessor): Hold attributes information so we can pass
18000         it along.
18001
18002         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18003         Modify to pass in attributes attached to the methods.
18004
18005         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18006
18007         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18008         to handle the Accessor kind :-)
18009
18010         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18011
18012 2002-06-08  Martin Baulig  <martin@gnome.org>
18013
18014         * expression.cs (Unary.TryReduceNegative): Added support for
18015         ULongConstants.
18016
18017 2002-06-08  Martin Baulig  <martin@gnome.org>
18018
18019         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18020         name can't be found in the `defined_names' - the caller will do a
18021         MemberLookup in this case and thus find methods in System.Enum
18022         such as Enum.IsDefined().
18023
18024 2002-06-08  Martin Baulig  <martin@gnome.org>
18025
18026         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18027         Convert.ChangeType() which works with TypeBuilder created types.
18028         (Enum.LookupEnumValue, Enum.Define): Use it here.
18029
18030         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18031         `TypeBuilder.BaseType != null' check.
18032         (TypeContainer.FindMembers): Only lookup parent members if we
18033         actually have a parent.
18034         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18035         (ConstructorInitializer.Resolve): Likewise.
18036
18037         * interface.cs (Interface.FindMembers): Added
18038         `TypeBuilder.BaseType != null' check.
18039
18040         * rootcontext.cs (RootContext.ResolveCore): Added
18041         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18042         classes_second_stage.
18043
18044         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18045         debug_type and trace_type when compiling with --nostdlib.       
18046
18047 2002-06-07  Martin Baulig  <martin@gnome.org>
18048
18049         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18050         (AddField): Set it to true when adding a non-static field.
18051         (DefineType): Use `have_nonstatic_fields' to find out whether we
18052         have non-static fields, not `Fields != null'.
18053
18054 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18057         dereferencing a null on the static-field code path)
18058
18059 2002-05-30  Martin Baulig  <martin@gnome.org>
18060
18061         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18062         to take command line arguments.  Use reflection to call the new
18063         custom `Initialize' function on the symbol writer and pass it the
18064         command line arguments.
18065
18066         * driver.cs (--debug-args): New command line argument to pass command
18067         line arguments to the symbol writer.
18068
18069 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18070
18071         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18072         the target type for indexers and properties.  Thanks to Joe for
18073         catching this.
18074
18075 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18076
18077         * typemanager.cs (MethodFlags): returns the method flags
18078         (Obsolete/ShouldIgnore) that control warning emission and whether
18079         the invocation should be made, or ignored. 
18080
18081         * expression.cs (Invocation.Emit): Remove previous hack, we should
18082         not do this on matching a base type, we should do this based on an attribute
18083
18084         Only emit calls to System.Diagnostics.Debug and
18085         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18086         on the command line.
18087
18088         * rootcontext.cs: Global settings for tracing and debugging.
18089
18090         * cs-tokenizer.cs (define): New utility function to track
18091         defines.   Set the global settings for TRACE and DEBUG if found.
18092
18093 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18094
18095         * interface.cs (Populate*): Pass in the TypeContainer as well as
18096         the DeclSpace as parameters so that we can create EmitContexts and
18097         then use that to apply attributes etc.
18098
18099         (PopulateMethod, PopulateEvent, PopulateProperty)
18100         (PopulateIndexer): Apply attributes everywhere.
18101
18102         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18103         etc.
18104
18105         (ApplyAttributes): Update accordingly.
18106
18107         We now apply interface attributes for all members too.
18108
18109 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * class.cs (Indexer.Define); Correctly check if we are explicit
18112         implementation (instead of checking the Name for a ".", we
18113         directly look up if the InterfaceType was specified).
18114
18115         Delay the creation of the PropertyBuilder.
18116
18117         Only create the PropertyBuilder if we are not an explicit
18118         interface implementation.   This means that explicit interface
18119         implementation members do not participate in regular function
18120         lookups, and hence fixes another major ambiguity problem in
18121         overload resolution (that was the visible effect).
18122
18123         (DefineMethod): Return whether we are doing an interface
18124         implementation. 
18125
18126         * typemanager.cs: Temporary hack until we get attributes in
18127         interfaces (Ravi is working on that) and we get IndexerName
18128         support in interfaces.
18129
18130         * interface.cs: Register the indexers as properties.
18131
18132         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18133         warning, I have verified that this is a bug in the .NET runtime
18134         (JavaScript suffers of the same problem).
18135
18136         * typemanager.cs (MemberLookup): When looking up members for
18137         interfaces, the parent of an interface is the implicit
18138         System.Object (so we succeed in searches of Object methods in an
18139         interface method invocation.  Example:  IEnumerable x;  x.ToString
18140         ()) 
18141
18142 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18143
18144         * class.cs (Event): Events should also register if they do
18145         implement the methods that an interface requires.
18146
18147         * typemanager.cs (MemberLookup); use the new GetInterfaces
18148         method. 
18149
18150         (GetInterfaces): The code used to lookup interfaces for a type is
18151         used in more than one place, factor it here. 
18152
18153         * driver.cs: Track the errors at the bottom of the file, we kept
18154         on going.
18155
18156         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18157         instance if the method we are calling is static!
18158
18159 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18160
18161         * attribute.cs (ApplyAttributes): Make this function filter out
18162         the IndexerName attribute (as that attribute in reality is never
18163         applied) and return the string constant for the IndexerName
18164         attribute. 
18165
18166         * class.cs (TypeContainer.Emit): Validate that all the indexers
18167         have the same IndexerName attribute, and if so, set the
18168         DefaultName attribute on the class. 
18169
18170         * typemanager.cs: The return value might contain other stuff (not
18171         only methods).  For instance, consider a method with an "Item"
18172         property and an Item method.
18173
18174         * class.cs: If there is a problem with the parameter types,
18175         return. 
18176
18177 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18178
18179         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18180         looks at user defined conversion after making a call to 
18181         StandardConversionExists - we need this for overload resolution.
18182
18183         * expression.cs : Update accordingly the various method calls.
18184
18185         This fixes 2 bugs filed against implicit user defined conversions 
18186
18187 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18188
18189         * statement.cs: Track the result of the assignment.
18190
18191 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18192
18193         * expression.cs (MemberAccess): Improved error reporting for
18194         inaccessible members.
18195
18196 2002-05-22  Martin Baulig  <martin@gnome.org>
18197
18198         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18199         itself with debugging support.
18200
18201 2002-05-22  Martin Baulig  <martin@gnome.org>
18202
18203         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18204         Removed, this isn't needed anymore.
18205
18206 2002-05-20  Martin Baulig  <martin@gnome.org>
18207
18208         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18209         be underlying type for an enum.
18210
18211 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18212
18213         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18214         that splits out the loading of just the core types.
18215
18216         * rootcontext.cs (ResolveCore): Split the struct resolution in
18217         two, so we can load the enumeration underlying types before any
18218         enums are used.
18219
18220         * expression.cs (Is): Bandaid until we fix properly Switch (see
18221         bug #24985 for details).
18222
18223         * typemanager.cs (ImplementsInterface): The hashtable will contain
18224         a null if there are no interfaces implemented.
18225
18226 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18227
18228         * cs-parser.jay (indexer_declarator): It is fine to have array
18229         parameters
18230
18231 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18232
18233         * typemanager.cs: (RegisterBuilder): New function used to register
18234         TypeBuilders that implement interfaces.  Since
18235         TypeBuilder.GetInterfaces (as usual) does not work with lame
18236         Reflection.Emit. 
18237         (AddUserType): register interfaces.
18238
18239         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18240         dealing with TypeBuilder.  Also, arrays are showing up as
18241         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18242         methods can not be invoked on them!
18243
18244         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18245         (ImplicitReferenceConversionExists): Split out from
18246         StandardConversionExists. 
18247
18248         * expression.cs (As): We were only implementing one of the three
18249         cases for the as operator.  We now implement them all.
18250         (Is): Implement the various other cases for Is as well.
18251
18252         * typemanager.cs (CACHE): New define used to control if we want or
18253         not the FindMembers cache.  Seems to have a negative impact on
18254         performance currently
18255
18256         (MemberLookup): Nested types have full acess to
18257         enclosing type members
18258
18259         Remove code that coped with instance/static returns for events, we
18260         now catch this in RealFindMembers.
18261
18262         (RealFindMembers): only perform static lookup if the instance
18263         lookup did not return a type or an event.  
18264
18265 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * assign.cs (CompoundAssign): We pass more semantic information
18268         now to Compound Assignments than we did before: now we have all
18269         the information at hand, and now we resolve the target *before* we
18270         do the expression expansion, which allows the "CacheValue" method
18271         to have the effect we intended (before, a [x] += 1 would generate
18272         two differen ArrayAccess expressions from the ElementAccess,
18273         during the resolution process).
18274
18275         (CompoundAssign.DoResolve): Resolve target and original_source here.
18276
18277 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18278
18279         * expression.cs (ArrayAccess): dropped debugging information. 
18280
18281         * typemanager.cs: Small bug fix: I was always returning i_members,
18282         instead of one of i_members or s_members (depending on which had
18283         the content).
18284
18285         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18286         method is invoked before any code generation takes place, and it
18287         is a mechanism to inform that the expression will be invoked more
18288         than once, and that the method should use temporary values to
18289         avoid having side effects
18290
18291         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18292
18293         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18294         implementation.
18295
18296         * expression.cs (Indirection, ArrayAccess): Add support for
18297         CacheTemporaries in these two bad boys. 
18298
18299         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18300         ldobj or ldind_ref.  
18301         (StoreFromPtr): Handle stobj as well.
18302
18303         * expression.cs (UnaryMutator): Share more code.
18304
18305         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18306         down: I was not tracking the Filter function as well, which
18307         was affecting the results of the cache.
18308
18309 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18310
18311         * attribute.cs: Remove the hack to handle the CharSet property on
18312         StructLayouts. 
18313
18314 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18315
18316         * attribute.cs (DoResolve): More uglyness, we now only try to
18317         resolve the attribute partially, to extract the CharSet
18318         information (only if we are a StructLayout attribute).  Otherwise 
18319
18320         (GetExtraTypeInfo): Add some code to conditionally kill in the
18321         future this.   I am more and more convinced that the .NET
18322         framework has special code to handle the attribute setting on
18323         certain elements.
18324
18325         * expression.cs (IsParamsMethodApplicable): Revert my previous
18326         foreach change here, it was wrong.
18327
18328 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18329
18330         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18331         (pp_expr): do not abort on unknown input, just return.
18332         (eval): abort if there are pending chars.
18333
18334         * attribute.cs (Attribute.Resolve): Positional parameters are
18335         optional.  Deal with that case.
18336
18337         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18338         the Ansi/Unicode/Auto information for the type.
18339
18340         (TypeContainer.DefineType): instantiate the EmitContext here, as
18341         we will be using it during the type definition (to resolve
18342         attributes) and during the emit phase.
18343
18344         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18345         to pull type information out of the attributes
18346
18347         (Attribute.Resolve): track the constructor builder, and allow for
18348         multiple invocations (structs and classes will use this).
18349
18350         * ecore.cs (MemberLookupFinal): new version with all the
18351         parameters customizable.
18352
18353         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18354         constructors.  Return if the result value is null (as the error
18355         would have been flagged already by MemberLookupFinal)
18356
18357         Do not allow instances of abstract classes or interfaces to be
18358         created.
18359
18360         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18361         We have to compare the assembly property here when dealing with
18362         FamANDAssem and Assembly access modifiers, because we might be
18363         creating an assembly from *modules* (that means that we are not
18364         getting TypeBuilders for types defined in other modules that are
18365         part of this assembly).
18366
18367         (Method.Emit): If the method is marked abstract and has a body,
18368         emit an error. 
18369
18370         (TypeContainer.DefineMembers): If both the defined member and the
18371         parent name match are methods, then do not emit any warnings: let
18372         the Method.Define routine take care of flagging warnings.  But if
18373         there is a mismatch (method overrides something else, or method is
18374         overriwritten by something, then emit warning).
18375
18376         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18377         set to null, this means `do not check for the return type on the
18378         signature'. 
18379
18380         (Method.Define): set the return type for the method signature to
18381         null, so that we get methods with the same name and parameters and
18382         different return types.  This is used to flag warning 114 (you are
18383         hiding a method, and you probably want to use the new/override
18384         keywords instead).
18385
18386         * typemanager.cs (MemberLookup): Implemented proper access
18387         control, closing a long standing set of bug reports.  The problem
18388         was that the Framework only has two bits: Public and NonPublic,
18389         and NonPublic includes private and protected methods, but we need
18390         to enforce the FamANDAssem, FamOrAssem and Family. 
18391
18392 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18393
18394         * statement.cs (GotoCase): Return true: Ammounts to giving up
18395         knowledge on whether we return or not, and letting the other case
18396         be responsible for it.
18397
18398 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18399
18400         * driver.cs: Do not load directories for each file processed, only
18401         do it if there is a pattern.
18402
18403         * ecore.cs: Report readonly assigns here as well, as we might have
18404         been resolved only by MemberAccess.
18405
18406         (SimpleName.SimpleNameResolve): Also be useful for LValue
18407         resolution.   We need this to propagate assign to local readonly variables
18408
18409         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18410         do not want to reuse potential criteria memory.
18411
18412         * class.cs (MyEventBuilder): Set reflected_type;
18413
18414         * ecore.cs (Constantify): Added support for constifying bools.
18415
18416         (RootContext.LookupType): Added a cache for values looked up in
18417         the declaration space.
18418
18419         * typemanager.cs (FindMembers): Now is a front-end to
18420         RealFindMembers, and provides a two-level hashtable-based cache to
18421         the request.  
18422
18423         15% performance improvement: from 22.5 to 19.2 seconds.
18424
18425         * expression.cs (IsParamsMethodApplicable): use foreach.
18426         (Invocation.DoResolve): ditto.
18427         (New.DoResolve): ditto.
18428         (ArrayCreation.DoResolve): ditto.
18429
18430         * ecore.cs (FindMostEncompassingType): use foreach.
18431
18432         * delegate.cs (NewDelegate.DoResolve): Use foreach
18433
18434         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18435         (RemoveMethods): use foreach.
18436
18437         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18438         nested foreach statements instead of for, and also break out of
18439         the inner loop once a match is found.
18440
18441         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18442
18443 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18446         we actually unwrap the expression to allow for extra information
18447         to be extracted. 
18448
18449         * expression.cs: Use Shr_Un on unsigned operations. 
18450
18451 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18452
18453         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18454         applicable operators was not being considered correctly. This closes
18455         the bug Miguel reported.
18456
18457 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18458
18459         * attribute.cs: check that the type derives from System.Attribute
18460         and report the correct error in that case (moved the duplicate code to
18461         its own method, too).
18462
18463 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18464
18465         * attribute.cs: lookup attribute type name as the spec says: first the
18466         bare attribute name and then name + "Attribute" (nant compiles with
18467         mcs after this fix).
18468
18469 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18470
18471         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18472         Because of the way we parse things, we should try to see if a
18473         UIntConstant can fit in an integer.
18474
18475 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18476
18477         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18478         when we are in an explicit context.
18479
18480         (ConvertReferenceExplicit): When converting from Iface type S to Class
18481         T make sure the rules are implemented as an OR.
18482
18483         * parameter.cs (ParameterType): Make it a property for now although the
18484         purpose really isn't anything immediate.
18485
18486         * expression.cs (Is*Applicable): Do better checking on the parameter type
18487         of a ref/out parameter. The ones from the system assemblies are already 
18488         marked with the correct type so we don't need to do any correction.
18489
18490         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18491         the object type is standard too so include that.
18492
18493 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18494
18495         * ecore.cs (StandardConversionExists): Augment with missing code:
18496         deal with IntConstant, LongConstants and Enumerations.
18497
18498         * assign.cs: Report the error, instead of failing silently
18499
18500         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18501         typecontainer that they are declared, because the
18502         typecontainer/namespace will have the list of using clauses that
18503         need to be applied.
18504
18505         Assembly Attributes were escaping the normal registration
18506         mechanism. 
18507
18508         (EmitCode): Apply attributes within an EmitContext that represents
18509         the container they were declared on.
18510
18511         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18512
18513 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18514
18515         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18516         Revamp completely - make much cleaner as we now operate only
18517         on a set of Types.
18518
18519         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18520         to implement the logic detailed in the spec more correctly.
18521
18522         (UserDefinedConversion): Update accordingly.
18523
18524 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18525
18526         * statement.cs: Return flow analysis information up.
18527
18528         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18529         and the default.
18530
18531         (token): Do not consume an extra character before calling
18532         decimal_digits.
18533
18534 2002-05-06  Piers Haken <piersh@friskit.com>
18535
18536         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18537
18538 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18541         EmitContext during the instance constructor initializer
18542         resolution, to stop access to instance variables.
18543
18544         This is mandated by the spec, last paragraph of the `constructor
18545         initializers' section. 
18546
18547 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * cs-parser.jay, class.cs (Accessor): new class used to represent
18550         an accessor (get or set).  In the past we used `null' to represent
18551         a missing accessor.  But this is ambiguous because there was no
18552         way to tell in abstract indexers/properties if one of them was
18553         specified.
18554
18555         Now there is a way of addressing that.
18556
18557         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18558         instead of FindMembers.
18559
18560         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18561         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18562
18563         * attribute.cs: Treat indexers and properties as the same in terms
18564         of applying attributes
18565
18566         * ecore.cs (FindMostEncompassedType): Use statically initialized
18567         EmptyExpressions()s like we do elsewhere to avoid creating useless
18568         objects (and we take this out of the tight loop).
18569
18570         (GetConversionOperators): Move the code to extract the actual
18571         operators to a separate routine to clean things up.
18572
18573 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18574
18575         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18576         events are always registered FieldBuilders.
18577
18578         * class.cs (FieldBase): New class shared by Fields 
18579
18580         * delegate.cs: If we are a toplevel delegate, use our full name.
18581         If we are a nested delegate, then only use our tail name.
18582
18583 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18584
18585         * expression.cs (IsApplicable): Ensure that we add the "&" to
18586         ref/out types before comparing it with the type of the argument.
18587
18588         (IsParamsMethodApplicable): Ditto.
18589
18590         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18591         silly me ;-)
18592
18593         * delegate.cs : Handle the case when we have more than one applicable
18594         method. Flag an error only when we finish checking all.
18595
18596 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * expression.cs: Add support for boolean static initializers.
18599
18600 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18601
18602         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18603
18604         * parameter.cs (ComputeParameterTypes,
18605         ComputeAndDefineParameterTypes): Better error handling: now we
18606         clear the `types' cache if we fail during any of the type lookups.
18607         We also return the status code correctly to our caller
18608
18609         * delegate.cs: If we fail to define a delegate, abort the extra
18610         steps. 
18611
18612         * expression.cs (Binary.ResolveOperator): for
18613         operator==(object,object) and operator !=(object, object) we also
18614         have to verify that there is an implicit conversion from one to
18615         the other.
18616
18617         (ArrayAccess.DoResolve): Array Access can operate on
18618         non-variables. 
18619
18620 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18621
18622         * assign.cs (CompoundAssign): A new class used as a "flag" that
18623         the assignment actually is happening as part of a compound
18624         assignment operator.
18625
18626         During compound assignment, a few new rules exist to enable things
18627         like:
18628
18629         byte b |= 1 + 2
18630
18631         From the spec:
18632
18633         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18634         to the type of x) if y is implicitly convertible to the type of x,
18635         and the operator is a builtin operator and the return type of the
18636         operator is explicitly convertible to the type of x. 
18637
18638         * rootcontext.cs: Reset warning level to 2.  4 catches various
18639         "interesting" features in mcs, we must clean this up at some
18640         point, but currently am trying to kill other bugs ;-)
18641
18642         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18643         in container classes as well.  
18644
18645         * expression.cs (Binary.ResolveOperator): Handle string case
18646         before anything else (as operator overloading does emit an error
18647         before doing anything else).
18648
18649         This code could go away when we move to a table driven model, but
18650         i could not come up with a good plan last night.
18651
18652 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18653
18654         * typemanager.cs (CSharpName): reimplementation using regex.
18655         * class.cs: added null check for fields in Emit
18656         * rootcontext.cs: set warninglevel to 4
18657
18658 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18659
18660         * typemanager.cs (CSharpName): reimplemented with Lupus
18661         suggestion.
18662
18663 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * statement.cs (If): correclty implement Resolve, because we were
18666         not catching sem errors in there.  The same process is needed
18667         everywhere else. 
18668         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18669
18670
18671         (Statement.Warning_DeadCodeFound): Factorize code.
18672         (While): Report dead code here too.
18673
18674         (Statement): Added Resolve virtual method to allow
18675         for resolution split from the emit code.
18676
18677 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * statement.cs (EmitBoolExpression): No longer try to resolve the
18680         expression here.    
18681         (MakeBoolean): New utility function that resolve, implicitly
18682         converts to boolean and tags the expression. 
18683
18684
18685         (If, Do): Implement dead code elimination.
18686         (While): Implement loop inversion
18687
18688         (Do, While, For, If): Resolve the expression prior to calling our
18689         code generation.
18690
18691 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18692
18693         * class.cs:
18694           - added method Report28 (warning: program has more than one entry point)
18695           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18696           - modified method Method.Define, the part at the end of the method
18697
18698         * rootcontext.cs: added static public Location EntryPointLocation;
18699           
18700         * ../errors/cs0028.cs : Add test case for the above warning.              
18701
18702         * typemanager.cs:
18703           - modified method CSharpName to allow arrays of primitive type to
18704             be printed nicely (e.g. instead of System.Int32[][] it now prints
18705             int[][])
18706           - added method CSharpSignature: returns the signature of a method
18707             in string format to be used in reporting errors, warnings, etc.
18708
18709         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18710         with String.Empty.
18711
18712 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18713
18714         * delegate.cs (Define): Fix extremely silly bug where I was
18715         setting the type of the 'object' parameter of the BeginInvoke
18716         method to System.IAsyncResult instead of System.Object ;-)
18717
18718 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18719
18720         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18721         here. 
18722
18723         (Constructor.Emit): return if we fail to initialize the
18724         constructor.  Another door closed!  
18725
18726         * expression.cs (New.DoResolve): Improve error message (from -6 to
18727         1501).  Use DeclaredOnly lookup to find the exact constructor.
18728
18729         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18730         loop.  This is useful.
18731
18732         * cs-parser.jay: Adjust the default parameters so that destructors
18733         have the proper signature.
18734
18735 2002-04-26  Martin Baulig  <martin@gnome.org>
18736
18737         * driver.cs (LoadAssembly): If `assembly' contains any characters
18738         which are only valid in path names and not in assembly names
18739         (currently slash, backslash and point), use Assembly.LoadFrom ()
18740         instead of Assembly.Load () on the `assembly' (before iteration
18741         over the link_paths).
18742
18743 2002-04-26  Martin Baulig  <martin@gnome.org>
18744
18745         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18746
18747 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * class.cs (Property): use the new typemanager.MemberLookup
18750
18751         (TypeContainer.MemberLookup): Implement using the
18752         TypeManager.MemberLookup now. 
18753
18754         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18755         and return MemberInfos, so that these can be used without an
18756         EmitContext (what we had before).
18757
18758 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18759
18760         * expression.cs: Fix the case where the argument to params if the
18761         type of the params.  I omitted handling this before.   Fixed
18762
18763 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18764
18765         * driver.cs: Call BootCorlib_PopulateCoreType
18766
18767         * class.cs (Property.CheckBase): Check for properties only, not
18768         for all members. 
18769
18770         * interface.cs: Temporary hack: try/catch around the
18771         CustomAttributeBuilder, because I am getting an exception that I
18772         do not understand.
18773
18774         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18775         types whose definitions are required to be there (attributes are
18776         defined before standard types).
18777
18778         Compute definitions as we boot the various types, as they are used
18779         immediately (value_type class will need object_type, but if we do
18780         not initialize object_type, we will pass a null, which will let
18781         the runtime pick the System.Object from the existing corlib, which
18782         is not what we want).
18783
18784 2002-04-22  Patrik Torstensson <totte@labs2.com>
18785
18786         * cs-tokenizer.cs: fixed a number of trim() issues.
18787
18788 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18789
18790         * expression.cs (Argument.Type): Ensure that we return the correct
18791         type when we have out or ref parameters [in which case we 
18792         append a "&"].
18793
18794 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * class.cs (Property, Indexer): Allow extern modifier in there. 
18797
18798         * typemanager.cs (InitBaseTypes): Initializes object_type and
18799         value_type, since those will be used early on during the bootstrap
18800         process to compile corlib.
18801
18802         (InitCoreTypes): Move code from here to InitBaseTypes.
18803
18804 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18805
18806         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18807         single-dimension arrays as using the ldlen opcode.  
18808
18809         Daniel Lewis discovered this optimization.  
18810
18811         * typemanager.cs: Add signature for System.Array::get_Length
18812
18813 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18814
18815         * statement.cs: report the error when the foreach does not apply to an
18816         array nor a collection.
18817
18818 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * expression.cs: Add implicit conversions to the operator ~.
18821
18822         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18823
18824         * typemanager.cs: Locate the decimal constructor.
18825
18826 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18827
18828         * attribute.cs: use the new property of TypeOf.
18829         * expression.cs: added 'get' property around typearg.
18830
18831         These changes fix a build breaker reported by NickD. Is this the
18832         correct way to fix?  If not, please, revert my changes and make it
18833         work :-).
18834
18835 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * attribute.cs: Add support for typeof in attribute invocations.
18838         I am not sure that this is right though.
18839
18840 2002-04-14  Duncan Mak  <duncan@ximian.com>
18841
18842         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18843         Binary.Operator.Division case.
18844
18845 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18846
18847         * class.cs (DefineType): Ensure that we do a proper check on
18848         attribute types and also register it with the TypeManager.
18849
18850         (TypeContainer.Targets): The default for attribute types is
18851         AttributeTargets.All.
18852
18853         * attribute.cs (ApplyAttributes): Registering the attribute type
18854         is done elsewhere, not when we discover we have a Usage attribute.
18855
18856 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18857
18858         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18859         and get rid of is_delegate parameter.
18860
18861         * everywhere : update.
18862
18863 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18864
18865         * cs-parser.jay (compilation_unit): Revamp completely to use
18866         some new ideas that I got from Rhys' grammar to solve the problems
18867         with assembly level attributes.
18868
18869         (outer_declaration): New grammar production.
18870
18871         (attribute_sections): Add.
18872
18873         (opt_attributes): Base on attribute_sections
18874
18875         (namespace_declaration): Allow opt_attributes to tackle the case
18876         when we have assembly level attributes - we are clever in this
18877         regard now ;-)
18878
18879         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18880         attributes in the non-global context.
18881
18882         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18883         instead of SetGlobalAttributes.
18884
18885         * class.cs, rootcontext.cs : Ensure we define and generate 
18886         attribute types before anything else.
18887
18888         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18889         and flag the new error -20 for the case when the attribute type
18890         does not have valid targets specified. csc does not catch this.
18891
18892         * ../errors/errors.txt : update for error # -20
18893
18894 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18895
18896         * support.cs (InternalParameters.ParameterModifier): Do some null
18897         checking and return sane values.
18898
18899         * class.cs (Method.Define): If we are a PInvoke method, ensure
18900         that we are static and extern. Report error # 601
18901
18902         * ../errors/cs0601.cs : Add test case for the above error.
18903
18904 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18905
18906         * rootcontext.cs (attribute_types): We need to keep type of
18907         all attribute types separately and emit code for them first.
18908
18909         (RegisterAttribute) : Implement.
18910
18911         * class.cs (DefineType): Check if the current Type is a custom
18912         attribute type and register it accordingly.
18913
18914         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18915         adding the first attribute twice and rename to
18916
18917         (SetGlobalAttributes): this.
18918
18919         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18920         lookups.
18921
18922         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18923         if we are processing global arguments. Hmm, I am unsure of this.
18924
18925 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18926
18927         * expression.cs: added static array of strings to avoid calling
18928         Enum.ToString () for Operator in Binary. Significant recover of
18929         performance.
18930
18931 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18932
18933         * class.cs (FindMembers): Allow the Builders of the various
18934         members to be null.  If they are skip them.  This only happens
18935         during the PInvoke declaration.
18936
18937 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18940         failure, so we do not keep going afterwards.
18941
18942         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18943         wanted to pass `false' as the `is_delegate' argument.  If this is
18944         the case, why not use delegate_type == null to mean `is_delegate =
18945         false' and anything else as is_delegate = true.
18946
18947 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18948
18949         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18950         code for the section, not the beginning of the tests.
18951
18952 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18953
18954         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18955
18956         * expression.cs (Binary): same.  Warn about errors where we have
18957         Enum/Enum in operator + as well.
18958
18959 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18960
18961         * statement.cs:
18962                 - added support for switch(bool)
18963                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18964                 - add TableSwitchEmit() to handle table-based switch statements
18965
18966 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18967
18968         * expression.cs (Invocation.OverloadResolve): Factor out code which
18969         does parameter compatibility checking with arguments so that we can 
18970         re-use the code even from Delegate.VerifyApplicability
18971
18972         (VerifyArgumentsCompat): Move above code here.
18973
18974         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18975         and instead make a call to the above method.
18976
18977 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18978
18979         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18980         We use it to keep track of classes which are attribute types.
18981
18982 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18983
18984         * delegate.cs (Delegate.Define): Correctly define the types in the
18985         presence of fixed and array parameters.
18986
18987         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18988         doing FindMembers.
18989
18990         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18991         include NonPublic after the first iteration.
18992
18993         * class.cs (Indexer.CheckBase): Only check if both parents are
18994         non-null. 
18995
18996         * cs-parser.jay (accessor_body): If empty, set to null.
18997
18998         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18999         same code path here to resolve constants names that we did have in
19000         MemberAccess.DoResolve.  There is too much code duplicated here.
19001
19002 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19003
19004         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19005
19006         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19007         to MakeUnionSet.
19008
19009         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19010         tokens, numbers and strings.
19011
19012         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19013         parenthesis.
19014
19015         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19016         asyncronous parameters and the regular parameters.  
19017
19018         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19019         specify the target directory.
19020
19021         * expression.cs: (This.DoResolve): Simplify
19022         (As.Emit): Optimize, do not generate IsInst if the expression is
19023         always of the given type.
19024
19025         (Is.DoResolve): Bug fix, we were reporting both always/never for
19026         the is expression.
19027
19028         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19029         creating too many unnecessary arrays.
19030
19031 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19032
19033         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19034         fields instead of rolling our own initializer.   Takes care of all
19035         implicit conversions, and drops unnecessary static checks/argument.
19036
19037 2002-03-31  Dick Porter  <dick@ximian.com>
19038
19039         * driver.cs: use the GetDirectories() return values properly, and
19040         use "/" as path separator.
19041
19042 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * expression.cs (Unary): Optimize - - expr into expr.
19045         (Binary): Optimize a + (-b) into a -b.
19046
19047         * codegen.cs (CodeGen): Made all methods static.
19048
19049 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19050
19051         * rootcontext.cs: 
19052
19053         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19054         TypeBuilder property.
19055
19056         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19057         instead. 
19058
19059         * tree.cs: Removed the various RecordXXXX, and replaced with a
19060         single RecordDecl.  Removed all the accessor methods, and just
19061         left a single access point Type 
19062
19063         * enum.cs: Rename DefineEnum to DefineType.
19064
19065         * decl.cs: New abstract method `DefineType' used to unify the
19066         Defines for Enumerations, Interfaces, TypeContainers and
19067         Delegates.
19068
19069         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19070         LookupBaseClasses method that used to live in class.cs and
19071         interface.cs here, and renamed to FindType.
19072
19073         * delegate.cs: Implement DefineType.  Take advantage of the
19074         refactored pattern for locating the parent builder without taking
19075         the parent_builder argument (which we know does not work if we are
19076         nested, and triggering a toplevel definition).
19077
19078 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19081         accessibility of a member has changed during override and report
19082         an error if so.
19083
19084         * class.cs (Method.Define, Property.Define): Only complain on
19085         overrides if the method is private, any other accessibility is
19086         fine (and since we just checked the permission is the same, we are
19087         good to go).
19088
19089         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19090         and elif are processed always.  The other pre-processing
19091         directives are only processed if we are "taking" the path
19092
19093 2002-03-29  Martin Baulig  <martin@gnome.org>
19094
19095         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19096         current location is not Null.
19097
19098         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19099         a separate method so we can profile it.
19100
19101         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19102         `span.Seconds' are just seconds, but no minutes or hours.
19103         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19104
19105 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19106
19107         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19108         Remove the gratuitous set of Final:
19109
19110                                 // If an interface implementation, then we can set Final.
19111                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19112                                     implementing.DeclaringType.IsInterface)
19113                                         flags |= MethodAttributes.Final;
19114
19115         I do not know what I was smoking when I used that.
19116
19117
19118         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19119         step into fixing the name resolution issues for delegates and
19120         unifying the toplevel name resolution.
19121
19122 2002-03-28  Martin Baulig  <martin@gnome.org>
19123
19124         * class.cs (Method.Emit): If we have a symbol writer, call its
19125         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19126         tell it about the current method.
19127
19128         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19129         writer that we're going to emit the first byte of IL code for a new
19130         statement (a new source line).
19131         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19132         EmitContext.Mark() before emitting any code.
19133
19134         * location.cs (SymbolDocument): Return null when we're Null.
19135
19136         * statement.cs (Statement): Moved the `Location loc' variable here.
19137         (Statement.EmitBoolExpression): If we have a symbol writer, call
19138         ec.Mark() before emitting any code to tell it that we're at the
19139         beginning of a new statement.
19140         (StatementExpression): Added `Location' argument to the constructor.
19141         (Block): Added public readonly variable `StartLocation' and public
19142         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19143         (Block): Added constructor which takes a start and end location.
19144         (Block.SetEndLocation): New method. This sets the end location.
19145         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19146         local variables we create.
19147         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19148         each statement and do also mark the begin and end of the block.
19149
19150         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19151         tell it the current lexer.Location, use Location.Null for the end of the
19152         block.
19153         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19154         current block, set its end location using SetEndLocation().
19155         (statement_expression): StatementExpression constructor now takes the
19156         lexer.Location as additional argument.
19157         (for_statement, declare_local_variables): Likewise.
19158         (declare_local_variables): When creating a new implicit block, use the
19159         new Block constructor and pass it the lexer.Location.
19160
19161 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19162
19163         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19164         members also on the parent interfaces recursively.
19165
19166 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19167
19168         * report.cs: Use new formats, since Gonzalo finished the missing
19169         bits. 
19170
19171         * expression.cs (Binary.ResolveOperator): added missing operator|
19172         operator& and operator^ for bool/bool.
19173
19174         * cs-parser.jay: CheckDef now takes a Location argument that is
19175         used to report errors more precisly (instead of reporting the end
19176         of a definition, we try to track something which is a lot closer
19177         to the source of the problem).
19178
19179         * cs-tokenizer.cs: Track global token use, so we can properly flag
19180         the use of #define/#undef after the first token has been seen.
19181
19182         Also, rename the reportXXXX to Error_DescriptiveName
19183
19184         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19185         TypeContainer, so that Enum and Interface can use this too.
19186
19187         * class.cs (TypeContainer.LookupInterfaceOrClass,
19188         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19189         `builder' argument.  Typically this was used to pass the parent
19190         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19191         the definition).  
19192
19193         The problem is that a nested class could trigger the definition of
19194         a toplevel class, and the builder would be obviously wrong in that
19195         case. 
19196
19197         So we drop this argument, and we compute dynamically the
19198         TypeBuilder/ModuleBuilder (the correct information was available
19199         to us anyways from DeclSpace.Parent)
19200
19201         * interface.cs (Interface.DefineInterface): Drop builder
19202         parameter cleanup like class.cs
19203
19204         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19205         like class.cs
19206
19207         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19208         values. 
19209
19210         (Try.Emit): Propagate the returns value from the statement.
19211
19212         (Return.Emit): Even if we are leavning 
19213
19214         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19215
19216         * modifiers.cs: Fix the computation of MethodAttributes flags.
19217
19218 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19219
19220         * driver.cs: allow compilation of files that start with '/'.
19221         Add a default case when checking the argument of --target.
19222
19223 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * interface.cs: Implement the same search algorithm for types in
19226         the interface code.
19227
19228         * delegate.cs: Do not allow multiple definition.
19229
19230         * Recovered ChangeLog that got accidentally amputated
19231
19232         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19233
19234         * rootcontext.cs: Load manually enum to allow core classes to
19235         contain enumerations.
19236
19237         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19238         Update to new static methods in TypeManager.
19239
19240         * typemanager.cs (GetMethod, GetConstructor): Use our
19241         implementation of FindMembers to find the members, since during
19242         corlib compilation, the types are TypeBuilders and GetMethod and
19243         GetConstructor do not work.
19244
19245         Make all methods in TypeManager static.
19246
19247         (InitCodeHelpers): Split the functionality from
19248         the InitCodeTypes function.
19249
19250         * driver.cs: Call InitCodeHelpers after we have populated the
19251         types. 
19252
19253         * cs-parser.jay (delegate_declaration): we did not used to compute
19254         the delegate name correctly for void delegates.
19255
19256 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19257
19258         * rootcontext.cs (RootContext): Init the interface_resolve_order
19259         and type_container_resolve_order always.
19260
19261         (ResolveCore, BootstrapCorlib_ResolveClass,
19262         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19263         compiler when compiling with --nostdlib
19264
19265         * class.cs (TypeContainer.DefineType): Check that our parent is
19266         not null.  This test is most important when we are bootstraping
19267         the core types.
19268
19269         * codegen.cs: Split out the symbol writing code.
19270
19271 2002-03-25  Martin Baulig  <martin@gnome.org>
19272
19273         * driver.cs (-g): Made -g an alias for --debug.
19274
19275 2002-03-24  Martin Baulig  <martin@gnome.org>
19276
19277         * codegen.cs (SymbolWriter): New public variable. Returns the
19278         current symbol writer.
19279         (CodeGen): Added `bool want_debugging_support' argument to the
19280          constructor. If true, tell the ModuleBuild that we want debugging
19281         support and ask it for the ISymbolWriter.
19282         (Save): If we have a symbol writer, call it's Close() method after
19283         saving the assembly.
19284
19285         * driver.c (--debug): New command line argument to create a
19286         debugger information file.
19287
19288         * location.cs (SymbolDocument): New public property. Returns an
19289         ISymbolDocumentWriter object for the current source file or null
19290         if we don't have a symbol writer.
19291
19292 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19293
19294         * driver.cs (LoadAssembly): Correctly return when all the paths
19295         have been tried and not before.
19296
19297         * statement.cs (Switch.Emit): return the actual coverage for this
19298         statement (returns/not-returns)
19299
19300         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19301         switch of the statement if we are the last switch section.  That
19302         kills two problems: try/catch problems (we used to emit an empty
19303         nop at the end) and switch statements where all branches would
19304         return. 
19305
19306 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * driver.cs: Add default assemblies (the equivalent to the
19309         Microsoft CSC.RSP file)
19310
19311         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19312         also update tokens_seen and set it to false.
19313
19314         * driver.cs: Implement --recurse for Mike.
19315
19316         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19317         correctly splitting out the paths.
19318
19319 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * interface.cs (Interface.PopulateProperty): Instead of using
19322         `parent' as the declaration space for the set parameters, use
19323         `this' 
19324
19325         * support.cs (InternalParameters): InternalParameters constructor
19326         takes a DeclSpace instead of a TypeContainer.
19327
19328         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19329         types are being initialized, load the address of it before calling
19330         the function.  
19331
19332         (New): Provide a mechanism to disable the generation of local
19333         value type temporaries when the caller will be providing us with
19334         an address to store it.
19335
19336         (ArrayCreation.EmitDynamicInitializers): Use it.
19337
19338 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19339
19340         * expression.cs (Invocation.EmitArguments): Only probe for array
19341         property if there is more than one argument.  Sorry about that.
19342
19343         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19344         empty param arrays.
19345
19346         * class.cs (Method.LabelParameters): Fix incorrect code path that
19347         prevented the `ParamArrayAttribute' from being applied to the
19348         params attribute.
19349
19350 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19351
19352         * support.cs (ReflectionParameters): Correctly compute whether the
19353         last argument is a params array.  Fixes the problem with
19354         string.Split ('a')
19355
19356         * typemanager.cs: Make the assemblies array always be non-null
19357         (empty, but non-null)
19358
19359         * tree.cs (RecordDecl): New function that abstracts the recording
19360         of names.  This reports error 101, and provides a pointer to the
19361         previous declaration.  Fixes a crash in the compiler.
19362
19363         * cs-parser.jay (constructor_declaration): Update to new grammar,
19364         and provide a constructor_body that can be empty.
19365
19366 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * driver.cs: Add support for --resources.
19369
19370         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19371         Make all types for the various array helper methods be integer.
19372
19373         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19374         CheckState to ConvCast.
19375
19376         (ConvCast): Now it takes a `checked' state argument, to avoid
19377         depending on the emit context for the conversion, and just using
19378         the resolve time setting.
19379
19380         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19381         instead of Invocation.EmitArguments.  We do not emit the original
19382         arguments, instead we emit those which have been converted to
19383         unsigned int expressions.
19384
19385         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19386
19387         * codegen.cs: ditto.
19388
19389         * expression.cs (LocalVariableReference): Drop the use of the
19390         Store function that depended on the variable index.
19391
19392         * statement.cs (VariableInfo): Drop the `Idx' property from this
19393         class, as this is not taking into account the indexes for
19394         temporaries tat we generate during the execution, getting the
19395         indexes wrong.
19396
19397         * class.cs: First emit class initializers, then call the parent
19398         constructor. 
19399
19400         * expression.cs (Binary): Fix opcode emision.
19401         (UnaryMutator.EmitCode): Support checked code generation
19402
19403         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19404         matches for events for both the Static and Instance scans,
19405         pointing to the same element.   Fix that.
19406
19407 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * rootcontext.cs (ResolveTree): Always set the
19410         interface_resolve_order, because nested interfaces will be calling
19411         into us.
19412
19413         * class.cs (GetInterfaceOrClass): Track the same resolution
19414         process used by TypeManager.LookupType.  This fixes the nested
19415         type lookups in class declarations (separate path from
19416         LookupType). 
19417
19418         (TypeContainer.DefineType): Also define nested interfaces.
19419         (TypeContainer.RegisterOrder): New public function used to
19420         register the order in which child interfaces need to be closed.
19421
19422         Nested interfaces need to be closed after their parents have been
19423         created. 
19424
19425         * interface.cs (InterfaceAttr): Put all the logic for computing
19426         the interface attribute here. 
19427
19428         (DefineInterface): Register our interface order with the
19429         RootContext or with the TypeContainer depending on the case.
19430
19431 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19432
19433         * cs-parser.jay: rework foreach statement to work with the new
19434         changes to the policy on SimpleNames.
19435
19436         * report.cs: support Stacktrace on warnings as well.
19437
19438         * makefile: drop --unsafe and /unsafe from the compile.
19439
19440 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19441
19442         * ecore.cs (StandardConversionExists): Modify to take an Expression
19443         as the first parameter. Ensure we do null -> reference type conversion
19444         checking.
19445
19446         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19447         temporary Expression objects.
19448
19449 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19450
19451         * interface.cs: workaround bug in method overloading resolution
19452         (there is already a bugzilla bug for it).
19453
19454 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19455
19456         We could also solve this problem by having a separate path for
19457         performing type lookups, instead of DoResolve, we could have a
19458         ResolveType entry point, and only participating pieces of the
19459         production (simplename, deref, array) would implement this. 
19460
19461         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19462         signal SimpleName to only resolve type names and not attempt to
19463         resolve anything else.
19464
19465         * expression.cs (Cast): Set the flag.
19466
19467         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19468
19469         * class.cs: Only report 108 if there is no `new' modifier.
19470
19471         * cs-parser.jay: rework foreach statement to work with the new
19472         changes to the policy on SimpleNames.
19473
19474         * report.cs: support Stacktrace on warnings as well.
19475
19476         * makefile: drop --unsafe and /unsafe from the compile.
19477
19478 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19479
19480         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19481         lookups here, instead of doing that at parse time.  This means
19482         that our grammar will not introduce `LocalVariableReferences' as
19483         expressions at this point.  That solves the problem of code like
19484         this:
19485
19486         class X {
19487            static void Main ()
19488            { int X = 1;
19489             { X x = null }}}
19490
19491         This is only half the fix.  The full fix requires parameters to
19492         also be handled in this way.
19493
19494         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19495         makes the use more obvious of the DeclSpace.  The
19496         ec.TypeContainer.TypeBuilder is now only used to pull the
19497         TypeBuilder for it.
19498
19499         My theory is that I can get rid of the TypeBuilder completely from
19500         the EmitContext, and have typecasts where it is used (from
19501         DeclSpace to where it matters).  
19502
19503         The only pending problem is that the code that implements Aliases
19504         is on TypeContainer, and probably should go in DeclSpace.
19505
19506         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19507         lookups here, instead of doing that at parse time.  This means
19508         that our grammar will not introduce `LocalVariableReferences' as
19509         expressions at this point.  That solves the problem of code like
19510         this:
19511
19512         class X {
19513            static void Main ()
19514            { int X = 1;
19515             { X x = null }}}
19516
19517         This is only half the fix.  The full fix requires parameters to
19518         also be handled in this way.
19519
19520         * class.cs (Property.DefineMethod): When implementing an interface
19521         method, set newslot, when implementing an abstract method, do not
19522         set the flag (before we tried never setting it, or always setting
19523         it, which is the difference).
19524         (Indexer.DefineMethod): same.
19525         (Method.DefineMethod): same.
19526
19527         * ecore.cs: Only set the status used flag if we get back a Field.
19528
19529         * attribute.cs: Temporary hack, so Paolo can keep working.
19530
19531 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19532
19533         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19534         the unmanaged type in the case we have a MarshalAs attribute.
19535
19536         (Resolve): Handle the case when we are parsing the special MarshalAs
19537         attribute [we need to store the unmanaged type to use later]
19538
19539         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19540         MarshalAs Attribute.
19541
19542         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19543         on parameters and accordingly set the marshalling info.
19544
19545 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19546
19547         * class.cs: Optimizing slightly by removing redundant code after
19548         we switched to the `NoTypes' return value.
19549         (Property.DefineMethod): use NoTypes here too.
19550
19551         This fixes the bug I introduced in my last batch of changes.
19552
19553 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19554
19555         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19556
19557         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19558         Enums since those are types too. 
19559
19560         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19561
19562         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19563         thanks to a call during the lookup process.
19564
19565 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19566
19567         * statement.cs (Foreach): Lots of work to accomodate a particular
19568         kind of foreach statement that I had not kept in mind.  It is
19569         possible to have foreachs on classes that provide a GetEnumerator
19570         method that return objects that implement the "pattern" for using
19571         a foreach, there is no need to support GetEnumerator
19572         specifically. 
19573
19574         This is needed to compile nant.
19575
19576         * decl.cs: Only report 114 if the member is not `Finalize' and if
19577         the warning level is at least 2.
19578
19579         * class.cs: Moved the compare function from Method to
19580         MethodSignature. 
19581
19582         (MethodSignature.InheritableMemberSignatureCompare): Add new
19583         filter function that is used to extract inheritable methods from a
19584         class. 
19585
19586         (Method.Define): Use the new `inheritable_method_signature_filter'
19587         delegate
19588
19589         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19590         command. 
19591
19592 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19595
19596         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19597
19598         * expression.cs: Pass location information to
19599         ConvertImplicitStandard. 
19600
19601         * class.cs: Added debugging code to track return values from
19602         interfaces. 
19603
19604 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * expression.cs (Is.DoResolve): If either side of the `is' is an
19607         interface, do not flag the warning.
19608
19609         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19610         for interfaces
19611
19612         * report.cs: Allow for --fatal to be used with --probe.
19613
19614         * typemanager.cs (NoTypes): Move the definition for the empty Type
19615         array here. 
19616
19617         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19618         properties. 
19619         (TypeContainer.DefineProxy): New function used to proxy to parent
19620         implementations when implementing interfaces.
19621         (TypeContainer.ParentImplements): used to lookup if our parent
19622         implements a public function that is required by an interface.
19623         (TypeContainer.VerifyPendingMethods): Hook this up.
19624
19625         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19626         `modules' and `assemblies' arraylists into arrays.  We only grow
19627         these are the very early start up of the program, so this improves
19628         the speedof LookupType (nicely measured).
19629
19630         * expression.cs (MakeByteBlob): Replaced unsafe code with
19631         BitConverter, as suggested by Paolo.
19632
19633         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19634         folding of string concatenation, but if either side is a string,
19635         and the other is not, then return null, and let the runtime use
19636         the concatenation on the string plus the object (using
19637         `Object.ToString'). 
19638
19639 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19640
19641         Constant Folding has been implemented now.
19642
19643         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19644         the error instead on types that are not supported in one's
19645         complement. 
19646
19647         * constant.cs (Constant and all children): New set of functions to
19648         perform implict and explicit conversions.
19649
19650         * ecore.cs (EnumConstant): Implement the new functions to perform
19651         conversion by proxying to the child expression.
19652
19653         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19654         own separate setting that can not be turned off from the command
19655         line using --unchecked or --checked and is only controlled using
19656         the checked/unchecked statements and expressions.  This setting is
19657         used by the constant folder to flag errors.
19658
19659         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19660         ConstantCheckState as well.   
19661
19662         During Resolve, they also have to flag the state, because the
19663         constant folder runs completely in the Resolve phase.
19664
19665         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19666         well.
19667
19668 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19669
19670         * cfold.cs: New file, this file contains the constant folder.
19671
19672         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19673         argument to track whether we are using the resulting address to
19674         load or store a value and provide better error messages. 
19675
19676         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19677         new AddressOf arguments.
19678
19679         * statement.cs (Foreach.EmitCollectionForeach): Update
19680
19681         * expression.cs (Argument.Emit): Call AddressOf with proper
19682         arguments to track usage.
19683
19684         (New.DoEmit): Call AddressOf with new arguments.
19685
19686         (Unary.Emit): Adjust AddressOf call.
19687
19688 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19689
19690         * cs-parser.jay (member_access): Change the case for pre-defined types
19691         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19692         this suggestion.
19693
19694         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19695         a method body.
19696
19697         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19698         essentially like methods and apply attributes like MethodImplOptions to them too.
19699
19700         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19701         not being null.
19702
19703         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19704         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19705         is the DeclSpace.
19706
19707         * Update code everywhere accordingly.
19708
19709         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19710
19711         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19712
19713 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19714
19715         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19716         try performing lookups against those instead of jumping straight into using
19717         the 'using' clauses.
19718
19719         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19720
19721         (LookupType): Perform lookups in implicit parents too.
19722
19723         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19724         sequence as RootContext.LookupType. 
19725
19726         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19727         the various cases of namespace lookups into this method.
19728
19729 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19730
19731         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19732         in positional arguments)
19733
19734         * class.cs (Operator): Update the AllowedModifiers to contain
19735         extern. 
19736
19737         * cs-parser.jay: Update operator declaration to allow for the
19738         operator body to be empty.
19739
19740         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19741         values. 
19742
19743 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19744
19745         * class.cs (Method.Emit): Label parameters.
19746
19747         * driver.cs: Return 1 or 0 as the program exit code.
19748
19749 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * expression.cs: Special case the `null' object when trying to
19752         auto-compute the type, as anything can be explicitly converted to
19753         that. 
19754
19755         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19756         spotting this Paolo.
19757
19758         (Expression.ImplicitNumericConversion): Perform comparissions of
19759         the type using the underlying type in the case of an enumeration
19760         rather than using the enumeration type for the compare.
19761
19762         Cope with the underlying == type case, which is not possible to
19763         catch before. 
19764
19765         (Expression.ConvertNumericExplicit): Perform comparissions of
19766         the type using the underlying type in the case of an enumeration
19767         rather than using the enumeration type for the compare.
19768
19769         * driver.cs: If the user does not supply an extension, assume .exe
19770
19771         * cs-parser.jay (if_statement): Rewrote so that we can track the
19772         location for the if statement.
19773
19774         * expression.cs (Binary.ConstantFold): Only concat strings when
19775         the operation is "+", not everything ;-)
19776
19777         * statement.cs (Statement.EmitBoolExpression): Take a location
19778         argument. 
19779         (If, While, Do): Track location.
19780
19781         * expression.cs (Binary.ResolveOperator): In the object + string
19782         case, I was missing a call to ConvertImplicit
19783
19784 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19785
19786         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19787         Location arguments. Ensure we use RootContext.LookupType to do our work
19788         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19789
19790         * interface.cs (PopulateMethod): Handle the type of the parameter being
19791         null gracefully.
19792
19793         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19794         have a params method with no fixed arguments and a call is made with no
19795         arguments.
19796
19797 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19800         the verbatim-string-literal
19801
19802         * support.cs (InternalParameters.ParameterModifier): handle null
19803         fixed parameters.
19804         (InternalParameters.ParameterType): ditto.
19805
19806         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19807         duplicating the name of the variable parameter.
19808         (GetParameterByName): Fix bug where we were not looking up array
19809         paramters if they were the only present (thanks Paolo!).
19810         (GetParameterInfo): We only have an empty set of types if both
19811         fixed and array are set to null.
19812         (GetParameterInfo-idx): Handle FixedParameter == null
19813
19814         * cs-parser.jay: Handle the case where there is no catch
19815         statements (missing null test).
19816
19817 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19818
19819         * driver.cs (MainDriver): Be conservative on our command line
19820         handling.
19821
19822         Catch DirectoryNotFoundException when calling GetFiles.
19823
19824         (SplitPathAndPattern): Used to split the input specification into
19825         a path and a pattern that we can feed to Directory.GetFiles.
19826
19827 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19828
19829         * statement.cs (Fixed): Implement the last case of the Fixed
19830         statement (string handling).
19831
19832         * expression.cs (StringPtr): New class used to return a char * to
19833         a string;  Used by the Fixed statement.
19834
19835         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19836
19837         * expression.cs (Binary.ResolveOperator): Remove redundant
19838         MemberLookup pn parent type.
19839         Optimize union call, we do not need a union if the types are the same.
19840         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19841         type.
19842
19843         Specialize the use of MemberLookup everywhere, instead of using
19844         the default settings. 
19845
19846         (StackAlloc): Implement stackalloc keyword.
19847
19848         * cs-parser.jay: Add rule to parse stackalloc.
19849
19850         * driver.cs: Handle /h, /help, /?
19851
19852         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19853         before we supported unsafe code.
19854
19855         * makefile: add --unsafe to the self compilation of mcs.
19856
19857 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * expression.cs (PointerArithmetic): New class that is used to
19860         perform pointer arithmetic.
19861         (Binary.Resolve): Handle pointer arithmetic
19862         Handle pointer comparission.
19863         (ArrayPtr): Utility expression class that is used to take the
19864         address of an array.
19865
19866         (ElementAccess): Implement array access for pointers
19867
19868         * statement.cs (Fixed): Implement fixed statement for arrays, we
19869         are missing one more case before we are done.
19870
19871         * expression.cs (Indirection): Implement EmitAssign and set the
19872         ExprClass to Variable.  This allows pointer dereferences to be
19873         treated as variables, and to have values assigned to them.
19874
19875         * ecore.cs (Expression.StoreFromPtr): New utility function to
19876         store values dereferencing.
19877
19878 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19879
19880         * expression.cs (Binary.ResolveOperator): Ensure that we are
19881         not trying to operate on a void type - this fixes the reported
19882         bug.
19883
19884         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19885         the parent implementation is sealed.
19886
19887         * ../errors/cs0239.cs : Add.
19888
19889         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19890
19891         * typemanager.cs (unverifiable_code_type): Corresponds to 
19892         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19893         which have unsafe code in them.
19894
19895         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19896         unsafe context.
19897
19898 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19899
19900         * cs-tokenizer.cs: Add support for @"litreal strings"
19901
19902         Make tokenizer accept pre-processor directives
19903         on any column (remove the old C-like limitation). 
19904
19905         * rootcontext.cs (EmitCode): Emit any global attributes.
19906         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19907
19908         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19909
19910         * cs-parser.jay: Add support for global attributes.  
19911
19912 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * expression.cs (Indirection): New helper class.  Unary will
19915         create Indirection classes to be able to implement the
19916         IMemoryLocation interface on it.
19917
19918 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19919
19920         * cs-parser.jay (fixed_statement): reference the right statement.
19921
19922         * statement.cs (Fixed.Emit): Finish implementing the fixed
19923         statement for the &x case.
19924
19925 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * class.cs (Property.Define, Method.Define): Remove newslot when
19928         `implementing'.  
19929
19930         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19931         wrong.  NewSlot should only be used if the `new' keyword is present.
19932
19933         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19934         locating our system dir.  Sorry about this.
19935
19936 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19937
19938         * driver.cs (GetSystemDir): Compute correctly the location of our
19939         system assemblies.  I was using the compiler directory instead of
19940         the library directory.
19941
19942 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19943
19944         * expression.cs (BetterFunction): Put back in what Miguel commented out
19945         since it is the correct fix. The problem is elsewhere ;-)
19946
19947         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19948         parameters of the parms method are themselves compatible or not !
19949
19950         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19951         to check that a class implements an interface before saying that an implicit
19952         conversion was allowed. Use ImplementsInterface to do the checking.
19953
19954 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * class.cs (Method.Define): Track whether we are an explicit
19957         implementation or not.  And only call DefineMethodOverride if we
19958         are an explicit implementation.
19959
19960         (Property.DefineMethod): Ditto.
19961
19962 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19963
19964         * expression.cs (BetterFunction): Catch hideous bug which was
19965          preventing us from detecting ambiguous calls due to implicit casts i.e
19966         cs0121.
19967
19968 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19969
19970         * support.cs (Pair): Remove un-needed method.  I figured why I was
19971         getting the error in cs-parser.jay, the variable in a foreach loop
19972         is readonly, and the compiler does not really treat this as a variable.
19973
19974         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19975         instead of EQUALS in grammar.  
19976
19977         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19978
19979         * expression.cs (Unary.DoResolve): Check whether the argument is
19980         managed or not.
19981
19982 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19983
19984         * support.cs: Api for Pair to set a value.  Despite the fact that
19985         the variables are public the MS C# compiler refuses to compile
19986         code that accesses the field if the variable is part of a foreach
19987         statement. 
19988
19989         * statement.cs (Fixed): Begin implementation of the fixed
19990         statement.
19991
19992         (Block.AddVariable): Return the VariableInfo on success and null
19993         on failure instead of true/false. 
19994
19995         * cs-parser.jay (foreach): Catch errors on variables already
19996         defined (we were ignoring this value before) and properly unwind
19997         the block hierarchy
19998
19999         (fixed_statement): grammar for the fixed statement.
20000
20001 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20004         pointer types to be incretemented.
20005
20006         (SizeOf): Implement.
20007
20008         * cs-parser.jay (pointer_member_access): Implement
20009         expr->IDENTIFIER production.
20010
20011         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20012         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20013         on safe contexts.
20014
20015         (Unary): Implement indirection.
20016
20017         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20018         use in non-unsafe context).
20019
20020         (SimpleName.DoResolve): Check for pointers in field access on safe
20021         contexts. 
20022
20023         (Expression.LoadFromPtr): Factor the load-indirect code in this
20024         function.  This was duplicated in UnboxCast and ParameterReference
20025
20026 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20027
20028         * expression.cs (ComposedCast): report an error if a pointer cast
20029         is used in a safe region.
20030
20031         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20032         pointer type casts in unsafe context.
20033
20034         * codegen.cs (EmitContext): Set up IsUnsafe.
20035
20036         * cs-parser.jay (non_expression_type): Add productions for pointer
20037         casts. 
20038
20039         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20040         code.  We should not use force into static mode if the method is
20041         not virtual.  Fixes bug in MIS
20042
20043         * statement.cs (Do.Emit, While.Emit, For.Emit,
20044         Statement.EmitBoolExpression): Add support to Do and While to
20045         propagate infinite loop as `I do return' semantics.
20046
20047         Improve the For case to also test for boolean constants.
20048
20049         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20050         to the list of attributes we can add.
20051
20052         Remove `EmitContext' argument.
20053
20054         * class.cs (Method.Define): Apply parameter attributes.
20055         (Constructor.Define): Apply parameter attributes.
20056         (MethodCore.LabelParameters): Move here the core of labeling
20057         parameters. 
20058
20059         * support.cs (ReflectionParameters.ParameterModifier,
20060         InternalParameters.ParameterModifier): Use IsByRef on the type and
20061         only return the OUT bit for these parameters instead of in/out/ref
20062         flags.
20063
20064         This is because I miss-understood things.  The ParameterInfo.IsIn
20065         and IsOut represent whether the parameter has the [In] and [Out]
20066         attributes set.  
20067
20068 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20069
20070         * ecore.cs (FieldExpr.Emit): Release temporaries.
20071
20072         * assign.cs (LocalTemporary.Release): new function.
20073
20074         * codegen.cs (EmitContext.GetTemporaryStorage,
20075         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20076         temporary storage.  Now we can "put back" localbuilders when we
20077         are done with them
20078
20079 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20080
20081         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20082         need to make a copy of the variable to generate verifiable code.
20083
20084 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20085
20086         * driver.cs: Compute dynamically the system directory.
20087
20088         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20089         Slower, but more generally useful.  Used by the abstract
20090         registering implementation. 
20091
20092         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20093         the rules for the special rule on Type/instances.  First check if
20094         we have the same name, and if so, try that special static path
20095         rather than the instance path.
20096
20097 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20098
20099         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20100         for, while and if.
20101
20102         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20103         Enum, ValueType, Delegate or Array for non-corlib compiles.
20104
20105         * cs-tokenizer.cs: Catch long identifiers (645)
20106
20107         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20108         piece of code.
20109
20110         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20111         fix, we were returning too early, so we were not registering
20112         pending methods from abstract classes.
20113
20114         Do not register pending methods if the class is abstract.
20115
20116         * expression.cs (Conditional.DoResolve): Report circular implicit
20117         conversions when we neecd to compute it for conditional
20118         expressions. 
20119
20120         (Is.DoResolve): If the expression is always of the provided type,
20121         flag warning 183.  If the expression can not ever be of the
20122         provided type flag warning 184.
20123
20124         * class.cs: Catch 169 as well.
20125
20126         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20127         read. 
20128
20129 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20130
20131         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20132
20133 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20134
20135         * interface.cs: (PopulateMethod): Check for pointers being defined
20136         only if the unsafe context is active.
20137         (PopulateProperty): ditto.
20138         (PopulateIndexer): ditto.
20139
20140         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20141         specified.  If pointers are present, make sure that they are
20142         present in an unsafe context.
20143         (Constructor, Constructor.Define): ditto.
20144         (Field, Field.Define): ditto.
20145         (Property, Property.Define): ditto.
20146         (Event, Event.Define): ditto.
20147
20148         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20149         hashtable if there are classes or structs defined.
20150
20151         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20152         code, as the constant resolution moved.
20153
20154         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20155         the metadata, so we can flag error 133. 
20156
20157         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20158         pointer is being declared in an unsafe context.
20159
20160 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20161
20162         * modifiers.cs (Modifiers.Check): Require a Location argument.
20163         Report error 227 for Unsafe use.
20164
20165         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20166
20167         * statement.cs (For.Emit): If the test is null, then report that
20168         we do `return', as we wont reach anything afterwards.
20169
20170         (Switch.SwitchGoverningType): Track the expression that matched
20171         the conversion.
20172
20173         * driver.cs: Allow negative numbers as an error code to flag.
20174
20175         * cs-parser.jay: Handle 1551.
20176
20177         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20178
20179 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20180
20181         * cs-parser.jay: Report 1518 (type declaration can only contain
20182         class, struct, interface, enum or delegate)
20183
20184         (switch_label): Report 1523 (keywords `case' or `default' must
20185         preced code)
20186
20187         (opt_switch_sections): Report 1522 (empty switch)
20188
20189         * driver.cs: Report 1515 (response file specified multiple times)
20190         Report 1516 (Source file specified multiple times).
20191
20192         * expression.cs (Argument.Resolve): Signal 1510
20193
20194         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20195         access not allowed in static code)
20196
20197 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20198
20199         * typemanager.cs (IsPointerType): Utility method which we are going
20200         to need a lot.
20201
20202         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20203         the object type, so we take care of that.
20204
20205         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20206
20207         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20208         added to non-params parameters :-)
20209
20210         * typemanager.cs (CSharpName): Include 'void' type too. 
20211
20212         (void_ptr_type): Include in the set of core types.
20213
20214         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20215         duplicating code.
20216
20217         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20218         an unsafe context.
20219
20220         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20221         completely forgotten about it.
20222
20223 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20224
20225         * cs-parser.jay (pointer_type): Add. This begins our implementation
20226         of parsing rules for unsafe code.
20227
20228         (unsafe_statement): Implement.
20229
20230         (embedded_statement): Modify to include the above.
20231
20232         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20233
20234         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20235         if the current context is an unsafe one.
20236
20237         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20238         are handled differently, we need separate rules for them.
20239
20240         (local_variable_declaration): Update to use local_variable_pointer_type
20241         to allow variable declarations of unmanaged pointer types.
20242
20243         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20244         in unsafe contexts.
20245
20246         * ../errors/cs0214.cs : Add.
20247
20248 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20249
20250         * makefile: remove 'response' file when cleaning.
20251
20252 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20253
20254         * cs-parser.jay: Report 1524.
20255
20256 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20257
20258         * typemanager.cs (RegisterMethod): drop checking if we have
20259         registered this from here
20260
20261 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20262
20263         * class.cs (Method.EmitDestructor): Implement calling our base
20264         destructor. 
20265
20266         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20267         value of InFinally.
20268
20269         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20270         this routine and will wrap the call in a try/catch block.  Deal
20271         with the case.
20272
20273 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20274
20275         * ecore.cs (Expression.MemberLookup): instead of taking a
20276         parameter `same_type' that was used to tell whether we could
20277         access private members we compute our containing type from the
20278         EmitContext.
20279
20280         (FieldExpr): Added partial support for volatile fields.  This does
20281         not work for volatile fields exposed from assemblies, as I can not
20282         figure out how to extract the modreq from it.
20283
20284         Updated all the source files to use this.
20285
20286         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20287         because it is referenced by MemberLookup very often. 
20288
20289 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20290
20291         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20292         TypeBuilder.GetCustomAttributes to retrieve what we need.
20293
20294         Get rid of redundant default_member_attr_type as this is the same as
20295         default_member_type which already exists.
20296
20297         * interface.cs, attribute.cs : Update accordingly.
20298
20299 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20300
20301         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20302         work for TYpeBuilders though.  Ravi, can you please fix this?
20303
20304         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20305
20306         * expression.cs (Argument.Emit): Handle the case of ref objects
20307         being passed to ref functions;  
20308
20309         (ParameterReference.EmitLoad): Loads the content of the pointer
20310         without dereferencing.
20311
20312 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20313
20314         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20315
20316 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20317
20318         * class.cs (Indexer.DefineMethod): Incorporate the interface
20319         type in the name of the method if we are doing explicit interface
20320         implementation.
20321
20322         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20323
20324         (BetterConversion): Fix extremely trivial bug where we were referring to
20325         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20326         again !
20327
20328         * ../errors/bug16.cs : Add although we have fixed it.
20329
20330 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20331
20332         * expression.cs (BaseIndexer): Begin implementation.
20333
20334         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20335
20336         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20337         production directly to remove a shift/reduce, and implement
20338         explicit interface implementation.
20339
20340         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20341         after a floating point suffix.
20342
20343         * expression.cs (DoNumericPromotions): Improved the conversion for
20344         uint/uint.  If we have a constant, we avoid doing a typecast to a
20345         larger type.
20346
20347         * class.cs (Indexer): Implement explicit interface implementation
20348         for indexers.
20349
20350 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20351
20352         * class.cs: make the default instance constructor public and hidebysig.
20353
20354 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20355
20356         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20357         so we can call it from elsewhere.
20358
20359         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20360         we emit it internally if the class has a defined indexer; otherwise the user
20361         emits it by decorating the class definition with the DefaultMemberAttribute.
20362
20363         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20364         attribute is not used on a type which defines an indexer.
20365
20366         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20367         character when we skip whitespace.
20368
20369         * ../errors/cs0646.cs : Add.
20370
20371 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20372
20373         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20374         again. 
20375
20376         * makefile: Add practical target `mcs3.exe' which builds the third
20377         generation compiler. 
20378
20379         * expression.cs (New): Fix structures constructor calling.
20380
20381         * class.cs (Property, Method, Indexer): Emit Final flag on the
20382         method if we are an interface implementation and we are not
20383         abstract. 
20384
20385         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20386         whether this property is referencing a `base' method.
20387
20388         * expression.cs (Invocation.EmitCall): take an extra argument:
20389         is_base, this is used to determine whether the `call' or
20390         `callvirt' opcode should be used.
20391
20392
20393         * delegate.cs: update EmitCall.
20394
20395         * class.cs (Method.Define): Set NewSlot for the cases where we are
20396         not implementing an interface method.
20397
20398         (Property.Define): ditto.
20399
20400 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20401
20402         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20403         'r'.  Allows mcs to parse itself fully.
20404
20405 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20406
20407         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20408         of the number of initializers that require the InitializeArray method.
20409
20410         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20411         update the above field where necessary.
20412
20413         (MakeByteBlob): Update accordingly.
20414
20415         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20416         greater than 2.
20417
20418         (EmitDynamicInitializers): Update in accordance with the new optimization.
20419
20420         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20421         same OpCode applies.
20422
20423         * cs-parser.jay : Fix some glaring errors I introduced.
20424
20425 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20426
20427         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20428         so that we can check for name clashes there too.
20429
20430         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20431         for interface indexers.
20432
20433         * interfaces.cs (Define): Emit the default member attribute.
20434
20435         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20436         variable was being referred to while setting the value ;-)
20437
20438 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20441         byte-by-byte information when we know the data is zero.
20442
20443         Make the block always a multiple of 4, because
20444         DefineInitializedData has a bug.
20445
20446         * assign.cs: Fix, we should assign from the temporary, not from
20447         the source. 
20448
20449         * expression.cs (MakeByteBlob): Fix my incorrect code.
20450
20451 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20452
20453         * typemanager.cs (EnumToUnderlying): This function is used to get
20454         the underlying type from an enumeration, because it does not
20455         always work. 
20456
20457         * constant.cs: Use the I4_S form for values between -128 and 127.
20458
20459         * statement.cs (Block.LookupLabel): Looks up a label.
20460         (Block): Drop support for labeled blocks.
20461
20462         (LabeledStatement): New kind of statement that represents a label
20463         only.
20464
20465         (Goto): Finally implement this bad boy.
20466
20467         * cs-parser.jay: Update to reflect new mechanism to implement
20468         labels.
20469
20470 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20471
20472         * codegen.cs (EmitContext.This): a codegen property that keeps the
20473         a single instance of this instead of creating many different this
20474         instances. 
20475
20476         * delegate.cs (Delegate.DoResolve): Update to use the property;
20477
20478         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20479
20480         * expression.cs (BaseAccess.DoResolve): Ditto.
20481
20482 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20483
20484         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20485         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20486
20487         (InitCoreTypes): Update accordingly.
20488
20489         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20490         so we can quickly store the state.
20491
20492         (ApplyAttributes): Set the correct implementation flags
20493         for InternalCall methods.
20494
20495 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * expression.cs (EmitCall): if a method is not virtual, then do
20498         not use callvirt on it.
20499
20500         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20501         user defined stuff) requires the use of stobj, which takes an
20502         address on the stack instead of an array and an index.  So emit
20503         the Ldelema operation for it.
20504
20505         (EmitStoreOpcode): Use stobj for valuetypes.
20506
20507         (UnaryMutator.EmitCode): Use the right 1 value depending on
20508         whether we are dealing with int64/uint64, float or doubles.
20509
20510         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20511         constructors that I implemented last night.
20512
20513         (Constructor.IsDefault): Fix to work properly for static
20514         constructors.
20515
20516         * cs-parser.jay (CheckDef): report method signature errors.
20517         Update error number 103 to be 132.
20518
20519         * decl.cs: New AdditionResult enumeration value: MethodExists.
20520         Although we do this check for methods later on in the semantic
20521         analysis, catching repeated default constructors is so easy that
20522         we catch these here. 
20523
20524         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20525         promotions code.
20526
20527         (ParameterReference.EmitAssign, Emit): handle
20528         bools as bytes.
20529
20530         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20531         (ArrayAccess.EmitStoreOpcode): ditto.
20532
20533         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20534
20535         * expression.cs (MakeByteBlob): Complete all the missing types
20536         (uint, short, ushort, byte, sbyte)
20537
20538         * class.cs: Only init instance field initializers on instance
20539         constructors. 
20540
20541         Rename `constructors' to instance_constructors. 
20542
20543         (TypeContainer.AddConstructor): Only add constructors to the list
20544         if it is not static.
20545
20546         Make sure that we handle default_static_constructor independently
20547         everywhere where we handle instance_constructors
20548
20549 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20550
20551         * class.cs: Do not lookup or create a base initializer for a
20552         static constructor.
20553
20554         (ConstructorInitializer.Resolve): use the proper type to lookup
20555         for constructors.
20556
20557         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20558
20559         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20560         in DeclSpace. 
20561
20562         * decl.cs: CloseType is now an virtual method, the default
20563         implementation just closes this type.
20564
20565 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20566
20567         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20568         to PreserveSig by default. Also emit HideBySig on such methods.
20569
20570         Basically, set the defaults to standard values.
20571
20572         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20573         argument, if candidate is better, it can't be worse than the best !
20574
20575         (Invocation): Re-write bits to differentiate between methods being
20576         applicable in their expanded form and their normal form - for params
20577         methods of course.
20578
20579         Get rid of use_standard everywhere as only standard conversions are allowed
20580         in overload resolution. 
20581
20582         More spec conformance.
20583
20584 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20585
20586         * driver.cs: Add --timestamp, to see where the compiler spends
20587         most of its time.
20588
20589         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20590         `this' in static code.
20591
20592         (SimpleName.DoResolve): Implement in terms of a helper function
20593         that allows static-references to be passed upstream to
20594         MemberAccess.
20595
20596         (Expression.ResolveWithSimpleName): Resolve specially simple
20597         names when called by MemberAccess to implement the special
20598         semantics. 
20599
20600         (Expression.ImplicitReferenceConversion): Handle conversions from
20601         Null to reference types before others, as Null's type is
20602         System.Object. 
20603
20604         * expression.cs (Invocation.EmitCall): Handle the special case of
20605         calling methods declared on a reference type from a ValueType
20606         (Base classes System.Object and System.Enum)
20607
20608         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20609         the left hand side is a TypeExpr, not on every enumeration. 
20610
20611         (Binary.Resolve): If types are reference types, then do a cast to
20612         object on operators != and == of both arguments.
20613
20614         * typemanager.cs (FindMembers): Extract instance and static
20615         members if requested.
20616
20617         * interface.cs (PopulateProperty): Use void_type instead of null
20618         as the return type for the setter method.
20619
20620         (PopulateIndexer): ditto.
20621
20622 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20623
20624         * support.cs (ReflectionParameters): Fix minor bug where we
20625         were examining the wrong parameter for the ParamArray attribute.
20626
20627         Cope with requests for the type of the parameter at position
20628         greater than the params parameter's. We now return the element
20629         type of the params array as that makes more sense.
20630
20631         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20632         accordingly as we no longer have to extract the element type
20633         ourselves.
20634
20635         (Invocation.OverloadResolve): Update.
20636
20637 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20638
20639         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20640         against IEnumerator, test whether the return value is a descendant
20641         of the IEnumerator interface.
20642
20643         * class.cs (Indexer.Define): Use an auxiliary method to implement
20644         the other bits of the method definition.  Begin support for
20645         explicit interface implementation.
20646
20647         (Property.DefineMethod): Use TypeManager.void_type instead of null
20648         for an empty return value.
20649
20650 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20651
20652         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20653         dealing with a FieldExpr which is composed of a FieldBuilder, in
20654         the code path we did extract the constant, but we should have
20655         obtained the underlying value to be able to cast it (otherwise we
20656         end up in an infinite loop, this is what Ravi was running into).
20657
20658         (ArrayCreation.UpdateIndices): Arrays might be empty.
20659
20660         (MemberAccess.ResolveMemberAccess): Add support for section
20661         14.5.4.1 that deals with the special case of E.I when E is a type
20662         and something else, that I can be a reference to a static member.
20663
20664         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20665         handle a particular array type to create byte blobs, it is just
20666         something we dont generate byteblobs for.
20667
20668         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20669         arguments. 
20670
20671         * location.cs (Push): remove the key from the hashtable that we
20672         are about to add.   This happens for empty files.
20673
20674         * driver.cs: Dispose files after we have parsed them.
20675
20676         (tokenize): new function that only runs the tokenizer on its
20677         input, for speed testing.
20678
20679 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20680
20681         * class.cs (Event.Define): Define the private field only if there
20682         are no accessors defined.
20683
20684         * expression.cs (ResolveMemberAccess): If there is no associated
20685         field with the event, that means we have an event defined with its
20686         own accessors and we should flag error cs0070 since transforming
20687         ourselves into a field is not valid in that case.
20688
20689         * ecore.cs (SimpleName.DoResolve): Same as above.
20690
20691         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20692         and charset to sane values.
20693
20694 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20695
20696         * assign.cs (DoResolve): Perform check on events only if they 
20697         are being accessed outside the declaring type.
20698
20699         * cs-parser.jay (event_declarations): Update rules to correctly
20700         set the type of the implicit parameter etc.
20701
20702         (add_accessor, remove_accessor): Set current local parameters.
20703
20704         * expression.cs (Binary): For delegate addition and subtraction,
20705         cast the return value from the method into the appropriate delegate
20706         type.
20707
20708 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20709
20710         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20711         of these as the workaround is unnecessary.
20712
20713         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20714         delegate data - none of that is needed at all.
20715
20716         Re-write bits to extract the instance expression and the delegate method
20717         correctly.
20718
20719         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20720         on delegates too.
20721
20722         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20723         of attaching attributes instead of duplicating code everywhere.
20724
20725         * everywhere : Update code to do attribute emission using the above method.
20726
20727 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20728
20729         * expression.cs (IsParamsMethodApplicable): if there are not
20730         parameters, return immediately.
20731
20732         * ecore.cs: The 0 literal can be implicity converted to an enum
20733         type. 
20734
20735         (SimpleName.DoResolve): First lookup the type, then lookup the
20736         members. 
20737
20738         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20739         want to get its address.  If the InstanceExpression is not
20740         addressable, store the result in a temporary variable, then get
20741         the address of it.
20742
20743         * codegen.cs: Only display 219 errors on warning level or above. 
20744
20745         * expression.cs (ArrayAccess): Make it implement the
20746         IMemoryLocation interface.
20747
20748         (Binary.DoResolve): handle the operator == (object a, object b)
20749         and operator != (object a, object b) without incurring into a
20750         BoxedCast (because 5 != o should never be performed).
20751
20752         Handle binary enumerator operators.
20753
20754         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20755         value type, otherwise use Ldelem_ref.
20756
20757         Use precomputed names;
20758
20759         (AddressOf): Implement address of
20760
20761         * cs-parser.jay (labeled_statement): Fix recursive block
20762         addition by reworking the production.
20763
20764         * expression.cs (New.DoEmit): New has a special case:
20765                 
20766                  If we are dealing with a ValueType, we have a few
20767                  situations to deal with:
20768                 
20769                     * The target of New is a ValueType variable, that is
20770                       easy, we just pass this as the variable reference
20771                 
20772                     * The target of New is being passed as an argument,
20773                       to a boxing operation or a function that takes a
20774                       ValueType.
20775                 
20776                       In this case, we need to create a temporary variable
20777                       that is the argument of New.
20778
20779
20780 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20781
20782         * rootcontext.cs (LookupType): Check that current_type is not null before
20783         going about looking at nested types.
20784
20785         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20786         not implement the IAssignMethod interface any more.
20787
20788         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20789         where we tranform them into FieldExprs if they are being resolved from within
20790         the declaring type.
20791
20792         * ecore.cs (SimpleName.DoResolve): Do the same here.
20793
20794         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20795
20796         * ../errors/bug10.cs : Add.
20797
20798         * ../errors/cs0070.cs : Add.
20799
20800         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20801
20802         * assign.cs : Get rid of EventIsLocal everywhere.
20803
20804 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20805
20806         * ecore.cs (ConvertIntLiteral): finished the implementation.
20807
20808         * statement.cs (SwitchLabel): Convert the value we are using as a
20809         key before looking up the table.
20810
20811 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20812
20813         * codegen.cs (EmitTopBlock): Require a Location argument now.
20814
20815         * cs-parser.jay (constructor_declarator): We need to setup
20816         current_local_parameters before we parse the
20817         opt_constructor_initializer, to allow the variables to be bound
20818         to the constructor arguments.
20819
20820         * rootcontext.cs (LookupType): First lookup nested classes in our
20821         class and our parents before we go looking outside our class.
20822
20823         * expression.cs (ConstantFold): Extract/debox the values at the
20824         beginnning. 
20825
20826         * rootcontext.cs (EmitCode): Resolve the constants first before we
20827         resolve the types.  This is not really needed, but it helps debugging.
20828
20829         * statement.cs: report location.
20830
20831         * cs-parser.jay: pass location to throw statement.
20832
20833         * driver.cs: Small bug fix.
20834
20835         * report.cs: Updated format to be 4-zero filled digits.
20836
20837 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20838
20839         * expression.cs (CheckIndices): Fix minor bug where the wrong
20840         variable was being referred to ;-)
20841
20842         (DoEmit): Do not call EmitStaticInitializers when the 
20843         underlying type is System.Object.
20844
20845 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20846
20847         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20848         and do the usual workaround for SRE.
20849
20850         * class.cs (MyEventBuilder.EventType): New member to get at the type
20851         of the event, quickly.
20852
20853         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20854
20855         * assign.cs (Assign.DoResolve): Handle the case when the target
20856         is an EventExpr and perform the necessary checks.
20857
20858         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20859         interface.
20860
20861         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20862
20863         (EventExpr): Set the type in the constructor itself since we 
20864         are meant to be born fully resolved.
20865
20866         (EventExpr.Define): Revert code I wrote earlier.
20867                 
20868         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20869         instance expression is null. The instance expression is a This in that case
20870         or a null, depending on whether it is a static method or not.
20871
20872         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20873         refers to more than one method.
20874
20875         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20876         and accordingly flag errors.
20877
20878 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20879
20880         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20881
20882 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20883
20884         * location.cs (ToString): Provide useful rutine.
20885
20886 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20887
20888         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20889         objects, return the actual integral boxed.
20890
20891         * statement.cs (SwitchLabel): define an ILLabel for each
20892         SwitchLabel. 
20893
20894         (Switch.CheckSwitch): If the value is a Literal, extract
20895         the underlying literal.
20896
20897         Also in the unused hashtable we had, add the SwitchLabel so we can
20898         quickly look this value up.
20899
20900         * constant.cs: Implement a bunch of new constants.  Rewrite
20901         Literal based on this.  Made changes everywhere to adapt to this.
20902
20903         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20904         dereferencing array only once, and also copes with enumrations.
20905
20906         bytes are two bytes wide, not one.
20907
20908         (Cast): Perform constant conversions.
20909
20910         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20911         wrappers to the literals here.
20912
20913         * expression.cs (DoNumericPromotions): long literals can converted
20914         to ulong implicity (this is taken care of elsewhere, but I was
20915         missing this spot).
20916
20917         * ecore.cs (Expression.Literalize): Make the return type Literal,
20918         to improve type checking.
20919
20920         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20921
20922 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20923
20924         * literal.cs: Revert code from ravi that checked the bounds.  The
20925         bounds are sane by the definition of the type itself. 
20926
20927         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20928         need to actually look up in our parent hierarchy for interfaces
20929         implemented. 
20930
20931         * const.cs: Use the underlying type for enumerations
20932
20933         * delegate.cs: Compute the basename for the delegate creation,
20934         that should fix the delegate test case, and restore the correct
20935         Type Lookup semantics in rootcontext
20936
20937         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20938         referencing a nested type with the Reflection API is using the "+"
20939         sign. 
20940
20941         * cs-parser.jay: Do not require EOF token at the end.
20942
20943 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20944
20945         * rootcontext.cs (LookupType): Concatenate type names with
20946         a '.' instead of a '+' The test suite passes again.
20947
20948         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20949         field of the enumeration.
20950
20951         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20952         the case when the member is an EventExpr.
20953
20954         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20955         static has an associated instance expression.
20956
20957         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20958
20959         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20960
20961         * class.cs (Event.Define): Register event and perform appropriate checks
20962         for error #111.
20963
20964         We define the Add and Remove methods even if the use provides none because
20965         in that case, we provide default implementations ourselves.
20966
20967         Define a private field of the type of the event. This is done by the CSC compiler
20968         and we should be doing it too ;-)
20969
20970         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20971         More methods we use in code we generate.
20972
20973         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20974         is important.
20975
20976         (InitCoreTypes): Update accordingly for the above.
20977
20978         * class.cs (Event.Emit): Generate code for default accessors that we provide
20979
20980         (EmitDefaultMethod): Do the job in the above.
20981
20982         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20983         appropriate place.
20984
20985 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20988         builders even if we were missing one.
20989
20990         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20991         pass the Basename as our class name instead of the Name.  The
20992         basename will be correctly composed for us.
20993
20994         * parameter.cs (Paramters): Now takes a Location argument.
20995
20996         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20997         make all the code call directly LookupType in RootContext and take
20998         this chance to pass the Location information everywhere.
20999
21000         * Everywhere: pass Location information.
21001
21002 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21003
21004         * class.cs (Constructor.Define): Updated way of detecting the
21005         length of the parameters.
21006
21007         (TypeContainer.DefineType): Use basename as the type name for
21008         nested types.
21009
21010         (TypeContainer.Define): Do not recursively define types here, as
21011         definition is taken care in order by the RootContext.
21012
21013         * tree.cs: Keep track of namespaces in a per-file basis.
21014
21015         * parameter.cs (Parameter.ComputeSignature): Update to use
21016         DeclSpace. 
21017
21018         (Parameters.GetSignature): ditto.
21019
21020         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21021         instead of a TypeContainer.
21022
21023         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21024         resolve names.  Because we need to be resolve in our context, not
21025         our parents.
21026
21027         * driver.cs: Implement response files.
21028
21029         * class.cs (TypeContainer.DefineType): If we are defined, do not
21030         redefine ourselves.
21031
21032         (Event.Emit): Emit the code for add/remove handlers.
21033         (Event.Define): Save the MethodBuilders for add/remove.
21034
21035         * typemanager.cs: Use pair here too.
21036
21037         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21038         DictionaryEntry requires the first argument to be non-null.  
21039
21040         (enum_declaration): Compute full name for registering the
21041         enumeration.
21042
21043         (delegate_declaration): Instead of using
21044         formal_parameter_list, use opt_formal_parameter_list as the list
21045         can be empty.
21046
21047         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21048         (EventParsing): New property that controls whether `add' and
21049         `remove' are returned as tokens or identifiers (for events);
21050
21051 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21052
21053         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21054         use MyEventBuilder only and let it wrap the real builder for us.
21055
21056         (MyEventBuilder): Revamp constructor etc.
21057
21058         Implement all operations that we perform on EventBuilder in precisely the same
21059         way here too.
21060
21061         (FindMembers): Update to use the EventBuilder member.
21062
21063         (Event.Emit): Update accordingly.
21064
21065 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21066
21067         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21068         by calling the appropriate methods.
21069
21070         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21071         useful.
21072
21073         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21074
21075 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21076
21077         * delegate.cs (Delegate.Populate): Check that the return type
21078         and various parameters types are indeed accessible.
21079
21080         * class.cs (Constructor.Define): Same here.
21081
21082         (Field.Define): Ditto.
21083
21084         (Event.Define): Ditto.
21085
21086         (Operator.Define): Check that the underlying Method defined itself
21087         correctly - so it's MethodBuilder should not be null.
21088
21089         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21090         expression happens to be null.
21091
21092         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21093         members but as of now we don't seem to be able to do anything really useful with it.
21094
21095         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21096         not the EventBuilder.
21097
21098 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21099
21100         * cs-tokenizer.cs: Add support for defines.
21101         Add support for #if, #elif, #else, #endif
21102
21103         (eval_var): evaluates a variable.
21104         (eval): stubbed for evaluating functions.
21105
21106         * cs-parser.jay: Pass the defines information
21107
21108         * driver.cs: Add --define command line option.
21109
21110         * decl.cs: Move MemberCore here.
21111
21112         Make it the base class for DeclSpace.  This allows us to catch and
21113         report 108 and 109 for everything now.
21114
21115         * class.cs (TypeContainer.Define): Extract all the members
21116         before populating and emit the warning 108 (new keyword required
21117         to override) instead of having each member implement this.
21118
21119         (MemberCore.Define): New abstract method, we will be using this in
21120         the warning reporting engine in Populate.
21121
21122         (Operator.Define): Adjust to new MemberCore protocol. 
21123
21124         * const.cs (Const): This does not derive from Expression, it is a
21125         temporary object we use to create fields, it is a MemberCore. 
21126
21127         * class.cs (Method.Define): Allow the entry point to be in a
21128         specific class.
21129
21130         * driver.cs: Rewrite the argument handler to clean it up a bit.
21131
21132         * rootcontext.cs: Made it just an auxiliary namespace feature by
21133         making everything static.
21134
21135         * driver.cs: Adapt code to use RootContext type name instead of
21136         instance variable.
21137
21138         * delegate.cs: Remove RootContext argument.
21139
21140         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21141         argument. 
21142
21143         * class.cs (Event.Define): The lookup can fail.
21144
21145         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21146
21147         * expression.cs: Resolve the this instance before invoking the code.
21148
21149 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21150
21151         * cs-parser.jay: Add a production in element_access that allows
21152         the thing to become a "type" reference.  This way we can parse
21153         things like "(string [])" as a type.
21154
21155         Note that this still does not handle the more complex rules of
21156         casts. 
21157
21158
21159         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21160
21161         * ecore.cs: (CopyNewMethods): new utility function used to
21162         assemble the list of methods from running FindMembers.
21163
21164         (MemberLookup): Rework FindMembers so that 
21165
21166 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21167
21168         * class.cs (TypeContainer): Remove Delegates who fail to be
21169         defined.
21170
21171         * delegate.cs (Populate): Verify that we dont get null return
21172         values.   TODO: Check for AsAccessible.
21173
21174         * cs-parser.jay: Use basename to emit error 574 (destructor should
21175         have the same name as container class), not the full name.
21176
21177         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21178         possible representation.  
21179
21180         Also implements integer type suffixes U and L.
21181
21182 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21183
21184         * expression.cs (ArrayCreation.DoResolve): We need to do the
21185         argument resolution *always*.
21186
21187         * decl.cs: Make this hold the namespace.  Hold the root context as
21188         well.
21189         (LookupType): Move here.
21190
21191         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21192
21193         * location.cs (Row, Name): Fixed the code, it was always returning
21194         references to the first file.
21195
21196         * interface.cs: Register properties defined through interfaces.
21197
21198         * driver.cs: Add support for globbing on the command line
21199
21200         * class.cs (Field): Make it derive from MemberCore as well.
21201         (Event): ditto.
21202
21203 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21204
21205         * class.cs (Event::Define): Check that the type of the event is a delegate
21206         type else flag error #66.
21207
21208         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21209         same.
21210
21211         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21212         values of EntryPoint, CharSet etc etc.
21213
21214         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21215
21216         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21217         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21218         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21219         which needs this to do its work.
21220
21221         * ../errors/cs0066.cs : Add.
21222
21223 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21224
21225         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21226         helper functions.
21227
21228         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21229         clears out the parameters field.
21230         (MemberSignatureCompare): Cleanup
21231
21232         (MemberCore): New base class used to share code between MethodCore
21233         and Property.
21234
21235         (RegisterRequiredImplementations) BindingFlags.Public requires
21236         either BindingFlags.Instace or Static.  Use instance here.
21237
21238         (Property): Refactored code to cope better with the full spec.
21239
21240         * parameter.cs (GetParameterInfo): Return an empty array instead
21241         of null on error.
21242
21243         * class.cs (Property): Abstract or extern properties have no bodies.
21244
21245         * parameter.cs (GetParameterInfo): return a zero-sized array.
21246
21247         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21248         method modifier validation to the typecontainer so we can reuse
21249         this on properties.
21250
21251         (MethodCore.ParameterTypes): return an empty sized array of types.
21252
21253         (Property.Define): Test property modifier validity.
21254
21255         Add tests for sealed/override too.
21256
21257         (Method.Emit): abstract or extern methods have no bodies.
21258
21259 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21260
21261         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21262         thing.
21263
21264         (Method::Define, ::Emit): Modify accordingly.
21265
21266         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21267
21268         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21269
21270         * makefile: Pass in /unsafe.
21271
21272 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21273
21274         * class.cs (MakeKey): Kill routine.
21275
21276         * class.cs (TypeContainer.Define): Correctly define explicit
21277         method implementations (they require the full interface name plus
21278         the method name).
21279
21280         * typemanager.cs: Deply the PtrHashtable here and stop using the
21281         lame keys.  Things work so much better.
21282
21283         This of course broke everyone who depended on `RegisterMethod' to
21284         do the `test for existance' test.  This has to be done elsewhere.
21285
21286         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21287         the object stupid Equals method (because, that like fails all over
21288         the place).  We still do not use it.
21289
21290         * class.cs (TypeContainer.SetRequiredInterface,
21291         TypeContainer.RequireMethods): Killed these two routines and moved
21292         all the functionality to RegisterRequiredImplementations.
21293
21294         (TypeContainer.RegisterRequiredImplementations): This routine now
21295         registers all the implementations required in an array for the
21296         interfaces and abstract methods.  We use an array of structures
21297         which can be computed ahead of time to reduce memory usage and we
21298         also assume that lookups are cheap as most classes will not
21299         implement too many interfaces.
21300
21301         We also avoid creating too many MethodSignatures.
21302
21303         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21304         clear the "pending" bit if we find that there are problems with
21305         the declaration.
21306
21307         (TypeContainer.VerifyPendingMethods): Update to report errors of
21308         methods that look like implementations but are not.
21309
21310         (TypeContainer.Define): Add support for explicit interface method
21311         implementation. 
21312
21313 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21314
21315         * typemanager.cs: Keep track of the parameters here instead of
21316         being a feature of the TypeContainer.
21317
21318         * class.cs: Drop the registration of parameters here, as
21319         InterfaceMethods are also interface declarations.
21320
21321         * delegate.cs: Register methods with the TypeManager not only with
21322         the TypeContainer.  This code was buggy.
21323
21324         * interface.cs: Full registation here.
21325
21326 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21327
21328         * expression.cs: Remove reducer for binary expressions, it can not
21329         be done this way.
21330
21331         * const.cs: Put here the code that used to go into constant.cs
21332
21333         * constant.cs: Put here the code for constants, this is a new base
21334         class for Literals.
21335
21336         * literal.cs: Make Literal derive from Constant.
21337
21338 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21339
21340         * statement.cs (Return.Emit): Report error 157 if the user
21341         attempts to return from a finally block.
21342
21343         (Return.Emit): Instead of emitting a return, jump to the end of
21344         the function.
21345
21346         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21347         LocalBuilder to store the result of the function.  ReturnLabel is
21348         the target where we jump.
21349
21350
21351 2001-12-09  Radek Doulik  <rodo@ximian.com>
21352
21353         * cs-parser.jay: remember alias in current namespace
21354
21355         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21356         namespaces
21357
21358         * class.cs (LookupAlias): lookup alias in my_namespace
21359
21360         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21361         aliases hashtable
21362         (LookupAlias): lookup alias in this and if needed in parent
21363         namespaces
21364
21365 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21366
21367         * support.cs: 
21368
21369         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21370         making things static.  I need this to avoid passing the
21371         TypeContainer when calling ParameterType.
21372
21373         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21374         that did string manipulation to compute the type and then call
21375         GetType.  Use Parameter.ParameterType instead.
21376
21377         * cs-tokenizer.cs: Consume the suffix for floating values.
21378
21379         * expression.cs (ParameterReference): figure out whether this is a
21380         reference parameter or not.  Kill an extra variable by computing
21381         the arg_idx during emission.
21382
21383         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21384         function that returns whether a parameter is an out/ref value or not.
21385
21386         (Parameter.ParameterType): The type of the parameter (base,
21387         without ref/out applied).
21388
21389         (Parameter.Resolve): Perform resolution here.
21390         (Parameter.ExternalType): The full type (with ref/out applied).
21391
21392         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21393         support for expressions on the using statement.
21394
21395 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21396
21397         * statement.cs (Using.EmitLocalVariableDecls): Split the
21398         localvariable handling of the using statement.
21399
21400         (Block.EmitMeta): Keep track of variable count across blocks.  We
21401         were reusing slots on separate branches of blocks.
21402
21403         (Try.Emit): Emit the general code block, we were not emitting it. 
21404
21405         Check the type of the declaration to be an IDisposable or
21406         something that can be implicity converted to it. 
21407
21408         Emit conversions if required.
21409
21410         * ecore.cs (EmptyExpression): New utility class.
21411         (Expression.ImplicitConversionExists): New utility function.
21412
21413 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21414
21415         * statement.cs (Using): Implement.
21416
21417         * expression.cs (LocalVariableReference): Support read only variables.
21418
21419         * statement.cs: Remove the explicit emit for the Leave opcode.
21420         (VariableInfo): Add a readonly field.
21421
21422 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21423
21424         * ecore.cs (ConvCast): new class used to encapsulate the various
21425         explicit integer conversions that works in both checked and
21426         unchecked contexts.
21427
21428         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21429         properly generate the overflow opcodes.
21430
21431 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21432
21433         * statement.cs: The correct type for the EmptyExpression is the
21434         element_type, not the variable type.  Ravi pointed this out.
21435
21436 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21437
21438         * class.cs (Method::Define): Handle PInvoke methods specially
21439         by using DefinePInvokeMethod instead of the usual one.
21440
21441         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21442         above to do the task of extracting information and defining the method.
21443
21444 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21445
21446         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21447         of the condition for string type.
21448
21449         (Emit): Move that here. 
21450
21451         (ArrayCreation::CheckIndices): Keep string literals in their expression
21452         form.
21453
21454         (EmitDynamicInitializers): Handle strings appropriately.
21455
21456 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21457
21458         * codegen.cs (EmitContext): Replace multiple variables with a
21459         single pointer to the current Switch statement.
21460
21461         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21462         EmitContext.
21463
21464 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21465
21466         * statement.cs 
21467
21468         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21469         default'.
21470
21471         (Foreach.Emit): Foreach on arrays was not setting
21472         up the loop variables (for break/continue).
21473
21474         (GotoCase): Semi-implented.
21475
21476 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21477
21478         * attribute.cs (CheckAttribute): Handle system attributes by using
21479         Attribute.GetAttributes to examine information we need.
21480
21481         (GetValidPlaces): Same here.
21482
21483         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21484
21485         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21486
21487         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21488
21489         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21490
21491         (Method::Emit): Handle the case when we are a PInvoke method.
21492
21493 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21494
21495         * expression.cs: Use ResolveWithSimpleName on compound names.
21496
21497 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21498
21499         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21500         before trying to reduce it.
21501
21502         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21503
21504         * constant.cs (LookupConstantValue): Implement.
21505
21506         (EmitConstant): Use the above in emitting the constant.
21507
21508         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21509         that are user-defined by doing a LookupConstantValue on them.
21510
21511         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21512         too, like above.
21513
21514 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21515
21516         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21517
21518         (BaseAccess.DoResolve): Implement.
21519
21520         (MemberAccess.DoResolve): Split this routine into a
21521         ResolveMemberAccess routine that can be used independently
21522
21523 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21524
21525         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21526         As that share bits of the implementation.  Is returns a boolean,
21527         while As returns the Type that is being probed.
21528
21529 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21530
21531         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21532         instead of a Literal - much easier.
21533
21534         (EnumInTransit): Remove - utterly useless :-)
21535
21536         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21537
21538         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21539
21540         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21541         chain when we have no associated expression.
21542
21543 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21544
21545         * constant.cs (Define): Use Location while reporting the errror.
21546
21547         Also emit a warning when 'new' is used and there is no inherited
21548         member to hide.
21549
21550         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21551         populated.
21552
21553         (LookupEnumValue): Implement to lookup an enum member's value and define it
21554         if necessary.
21555
21556         (Populate): Re-write accordingly to use the above routine.
21557
21558 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * expression.cs (This): Fix prototype for DoResolveLValue to
21561         override the base class DoResolveLValue.
21562
21563         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21564         declarations) 
21565
21566         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21567         (we need to load the address of the field here).  This fixes
21568         test-22. 
21569
21570         (FieldExpr.DoResolveLValue): Call the DoResolve
21571         function to initialize the Instance expression.
21572
21573         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21574         correctly the GetEnumerator operation on a value type.
21575
21576         * cs-parser.jay: Add more simple parsing error catches.
21577
21578         * statement.cs (Switch): Add support for string switches.
21579         Handle null specially.
21580
21581         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21582
21583 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21584
21585         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21586
21587         (declare_local_constant): New helper function.
21588
21589         * statement.cs (AddConstant): Keep a separate record of constants
21590
21591         (IsConstant): Implement to determine if a variable is a constant.
21592
21593         (GetConstantExpression): Implement.
21594
21595         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21596
21597         * statement.cs (IsVariableDefined): Re-write.
21598
21599 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21600
21601         * class.cs (TypeContainer::FindMembers): Look for constants
21602         in the case when we are looking for MemberTypes.Field
21603
21604         * expression.cs (MemberAccess::DoResolve): Check that in the
21605         case we are a FieldExpr and a Literal, we are not being accessed
21606         by an instance reference.
21607
21608         * cs-parser.jay (local_constant_declaration): Implement.
21609
21610         (declaration_statement): Implement for constant declarations.
21611
21612 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21613
21614         * statement.cs (Switch): Catch double defaults.
21615
21616         (Switch): More work on the switch() statement
21617         implementation.  It works for integral values now, need to finish
21618         string support.
21619
21620
21621 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21624         integer literals into other integer literals.  To be used by
21625         switch. 
21626
21627 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21628
21629         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21630         some memory.
21631
21632         (EmitDynamicInitializers): Cope with the above since we extract data
21633         directly from ArrayData now.
21634
21635         (ExpectInitializers): Keep track of whether initializers are mandatory
21636         or not.
21637
21638         (Bounds): Make it a hashtable to prevent the same dimension being 
21639         recorded for every element in that dimension.
21640
21641         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21642         from being found.
21643
21644         Also fix bug which was causing the indices to be emitted in the reverse
21645         order.
21646
21647 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21650         unfinished.  They do not work, because the underlying code is
21651         sloppy.
21652
21653 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * cs-parser.jay: Remove bogus fixme.
21656
21657         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21658         on Switch statement.
21659
21660 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21661
21662         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21663         the same. 
21664
21665         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21666         parameter. Apparently, any expression is allowed. 
21667
21668         (ValidateInitializers): Update accordingly.
21669
21670         (CheckIndices): Fix some tricky bugs thanks to recursion.
21671
21672         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21673         I was being completely brain-dead.
21674
21675         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21676         and re-write acordingly.
21677
21678         (DelegateInvocation): Re-write accordingly.
21679
21680         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21681
21682         (MakeByteBlob): Handle types more correctly.
21683
21684         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21685         initialization from expressions but it is incomplete because I am a complete
21686         Dodo :-|
21687
21688 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21691         on If.  Basically, we have to return `true' (ie, we do return to
21692         our caller) only if both branches of the if return.
21693
21694         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21695         short-circuit operators, handle them as short circuit operators. 
21696
21697         (Cast.DoResolve): Resolve type.
21698         (Cast.Cast): Take an expression as the target type.
21699
21700         * cs-parser.jay (cast_expression): Remove old hack that only
21701         allowed a limited set of types to be handled.  Now we take a
21702         unary_expression and we resolve to a type during semantic
21703         analysis.
21704
21705         Use the grammar productions from Rhys to handle casts (this is
21706         not complete like Rhys syntax yet, we fail to handle that corner
21707         case that C# has regarding (-x), but we will get there.
21708
21709 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21710
21711         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21712         field which is an array type.
21713
21714         * cs-parser.jay (declare_local_variables): Support array initialization too.
21715
21716         * typemanager.cs (MakeKey): Implement.
21717
21718         (everywhere): Use the above appropriately.
21719
21720         * cs-parser.jay (for_statement): Update for array initialization while
21721         declaring variables.
21722
21723         * ecore.cs : The error message was correct, it's the variable's names that
21724         were misleading ;-) Make the code more readable.
21725
21726         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21727         the correct type etc.
21728
21729         (ConvertExplicit): Handle Enum types by examining the underlying type.
21730
21731 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21732
21733         * parameter.cs (GetCallingConvention): Always return
21734         CallingConventions.Standard for now.
21735
21736 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21737
21738         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21739         and `r' after calling DoNumericPromotions.
21740
21741         * ecore.cs: Fix error message (the types were in the wrong order).
21742
21743         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21744         BindingFlags.Instance as well 
21745
21746         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21747         implicit int literal conversion in an empty cast so that we
21748         propagate the right type upstream.
21749
21750         (UnboxCast): new class used to unbox value types.
21751         (Expression.ConvertExplicit): Add explicit type conversions done
21752         by unboxing.
21753
21754         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21755         the target type before applying the implicit LongLiterals to ULong
21756         literal cast.
21757
21758 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21759
21760         * cs-parser.jay (for_statement): Reworked the way For works: now
21761         we declare manually any variables that are introduced in
21762         for_initializer to solve the problem of having out-of-band code
21763         emition (that is what got for broken).
21764
21765         (declaration_statement): Perform the actual variable declaration
21766         that used to be done in local_variable_declaration here.
21767
21768         (local_variable_declaration): Do not declare anything, just pass
21769         the information on a DictionaryEntry
21770
21771 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21772
21773         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21774         re-write of the logic to now make it recursive.
21775
21776         (UpdateIndices): Re-write accordingly.
21777
21778         Store element data in a separate ArrayData list in the above methods.
21779
21780         (MakeByteBlob): Implement to dump the array data into a byte array.
21781
21782 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21783
21784         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21785         into CheckIndices.
21786
21787         * constant.cs (Define): Implement.
21788
21789         (EmitConstant): Re-write fully.
21790
21791         Pass in location info.
21792
21793         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21794         respectively.
21795
21796         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21797         DictionaryEntry since we need location info too.
21798
21799         (constant_declaration): Update accordingly.
21800
21801         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21802         code into another method : UpdateIndices.
21803
21804 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21805
21806         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21807         some type checking etc.
21808
21809 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21810
21811         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21812         bits to provide dimension info if the user skips doing that.
21813
21814         Update second constructor to store the rank correctly.
21815
21816 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21817
21818         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21819         and try to implement.
21820
21821         * ../errors/cs0150.cs : Add.
21822
21823         * ../errors/cs0178.cs : Add.
21824
21825 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21826
21827         * statement.cs: Implement foreach on multi-dimensional arrays. 
21828
21829         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21830         name of the params argument.
21831
21832         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21833         initializing the array.
21834
21835         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21836         we can use this elsewhere.
21837
21838         * statement.cs: Finish implementation of foreach for single
21839         dimension arrays.
21840
21841         * cs-parser.jay: Use an out-of-band stack to pass information
21842         around, I wonder why I need this.
21843
21844         foreach_block: Make the new foreach_block the current_block.
21845
21846         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21847         function used to return a static Parameters structure.  Used for
21848         empty parameters, as those are created very frequently.
21849
21850         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21851
21852 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21853
21854         * interface.cs : Default modifier is private, not public. The
21855         make verify test passes again.
21856
21857 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21858
21859         * support.cs (ReflectionParameters): Fix logic to determine
21860         whether the last parameter is a params one. Test 9 passes again.
21861
21862         * delegate.cs (Populate): Register the builders we define with
21863         RegisterParameterForBuilder. Test 19 passes again.
21864
21865         * cs-parser.jay (property_declaration): Reference $6 instead
21866         of $$ to get at the location.
21867
21868         (indexer_declaration): Similar stuff.
21869
21870         (attribute): Ditto.
21871
21872         * class.cs (Property): Register parameters for the Get and Set methods
21873         if they exist. Test 23 passes again.
21874
21875         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21876         call to EmitArguments as we are sure there aren't any params arguments. 
21877         Test 32 passes again.
21878
21879         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21880         IndexOutOfRangeException. 
21881
21882         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21883         Test 33 now passes again.
21884
21885 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21886
21887         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21888         broke a bunch of things.  Will have to come up with a better way
21889         of tracking locations.
21890
21891         * statement.cs: Implemented foreach for single dimension arrays.
21892
21893 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21894
21895         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21896         an error.  This removes the lookup from the critical path.
21897
21898         * cs-parser.jay: Removed use of temporary_loc, which is completely
21899         broken. 
21900
21901 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21902
21903         * support.cs (ReflectionParameters.ParameterModifier): Report
21904         whether the argument is a PARAMS argument or not.
21905
21906         * class.cs: Set the attribute `ParamArrayAttribute' on the
21907         parameter argument.
21908
21909         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21910         and cons_param_array_attribute (ConstructorInfo for
21911         ParamArrayAttribute)., 
21912
21913         * codegen.cs: Emit the return using the `Return' statement, that
21914         way we can report the error correctly for missing return values. 
21915
21916         * class.cs (Method.Emit): Clean up.
21917
21918         * expression.cs (Argument.Resolve): Take another argument: the
21919         location where this argument is used.  Notice that this is not
21920         part of the "Argument" class as to reduce the size of the
21921         structure (we know the approximate location anyways).
21922
21923         Test if the argument is a variable-reference, if not, then
21924         complain with a 206.
21925
21926         (Argument.Emit): Emit addresses of variables.
21927
21928         (Argument.FullDesc): Simplify.
21929
21930         (Invocation.DoResolve): Update for Argument.Resolve.
21931
21932         (ElementAccess.DoResolve): ditto.
21933
21934         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21935         method should be virtual, as this method is always virtual.
21936
21937         (NewDelegate.DoResolve): Update for Argument.Resolve.
21938
21939         * class.cs (ConstructorInitializer.DoResolve): ditto.
21940
21941         * attribute.cs (Attribute.Resolve): ditto.
21942
21943 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21944
21945         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21946
21947         * expression.cs (ParameterReference): Drop IStackStorage and implement
21948         IAssignMethod instead. 
21949
21950         (LocalVariableReference): ditto.
21951
21952         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21953         IAssignMethod instead. 
21954
21955 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21956
21957         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21958         enumerations that are used in heavily used structures derive from
21959         byte in a laughable and pathetic attempt to reduce memory usage.
21960         This is the kind of pre-optimzations that you should not do at
21961         home without adult supervision.
21962
21963         * expression.cs (UnaryMutator): New class, used to handle ++ and
21964         -- separatedly from the other unary operators.  Cleans up the
21965         code, and kills the ExpressionStatement dependency in Unary.
21966
21967         (Unary): Removed `method' and `Arguments' from this class, making
21968         it smaller, and moving it all to SimpleCall, so I can reuse this
21969         code in other locations and avoid creating a lot of transient data
21970         strucutres when not required.
21971
21972         * cs-parser.jay: Adjust for new changes.
21973
21974 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21975
21976         * enum.cs (Enum.Populate): If there is a failure during
21977         definition, return
21978
21979         * cs-parser.jay (opt_enum_base): we used to catch type errors
21980         here, but this is really incorrect.  The type error should be
21981         catched during semantic analysis.
21982
21983 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21984
21985         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21986         current_local_parameters as expected since I, in my stupidity, had forgotten
21987         to do this :-)
21988
21989         * attribute.cs (GetValidPlaces): Fix stupid bug.
21990
21991         * class.cs (Method::Emit): Perform check on applicability of attributes.
21992
21993         (Constructor::Emit): Ditto.
21994
21995         (Field::Emit): Ditto.
21996
21997         (Field.Location): Store location information.
21998
21999         (Property, Event, Indexer, Operator): Ditto.
22000
22001         * cs-parser.jay (field_declaration): Pass in location for each field.
22002
22003         * ../errors/cs0592.cs : Add.
22004
22005 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22006
22007         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22008
22009         (InitCoreTypes): Update accordingly.
22010
22011         (RegisterAttrType, LookupAttr): Implement.
22012
22013         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22014         info about the same.
22015
22016         (Resolve): Update to populate the above as necessary.
22017
22018         (Error592): Helper.
22019
22020         (GetValidPlaces): Helper to the above.
22021
22022         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22023
22024         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22025
22026 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22027
22028         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22029
22030         * ../errors/cs0617.cs : Add.
22031
22032 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22033
22034         * enum.cs (Emit): Rename to Populate to be more consistent with what
22035         we expect it to do and when exactly it is called.
22036
22037         * class.cs, rootcontext.cs : Update accordingly.
22038
22039         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22040         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22041
22042         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22043
22044         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22045         of a fieldinfo using the above, when dealing with a FieldBuilder.
22046
22047 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22048
22049         * ../errors/cs0031.cs : Add.
22050
22051         * ../errors/cs1008.cs : Add.
22052
22053         * ../errrors/cs0543.cs : Add.
22054
22055         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22056         enum type.
22057
22058         (FindMembers): Implement.
22059
22060         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22061         enums and delegates too.
22062
22063         (enum_types): Rename to builder_to_enum.
22064
22065         (delegate_types): Rename to builder_to_delegate.
22066
22067         * delegate.cs (FindMembers): Implement.
22068
22069 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22070
22071         * typemanager.cs (IsEnumType): Implement.
22072
22073         * enum.cs (Emit): Re-write parts to account for the underlying type
22074         better and perform checking etc.
22075
22076         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22077         of the underlying type.
22078
22079         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22080         value
22081
22082         * enum.cs (error31): Helper to report error #31.
22083
22084         * cs-parser.jay (enum_declaration): Store location of each member too.
22085
22086         * enum.cs (member_to_location): New hashtable. 
22087
22088         (AddEnumMember): Update location hashtable.
22089
22090         (Emit): Use the location of each member while reporting errors.
22091
22092 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22093
22094         * cs-parser.jay: A for_initializer if is a
22095         local_variable_declaration really ammount to have an implicit
22096         block with the variable declaration and no initializer for for.
22097
22098         * statement.cs (For.Emit): Cope with null initializers.
22099
22100         This fixes the infinite loop on for initializers.
22101
22102 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22103
22104         * enum.cs: More cleanup.
22105
22106         * ecore.cs: Remove dead code.
22107
22108         * class.cs (Property.Emit): More simplification.
22109         (Event.Emit): ditto.
22110
22111         Reworked to have less levels of indentation.
22112
22113 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22114
22115         * class.cs (Property): Emit attributes.
22116
22117         (Field): Ditto.
22118
22119         (Event): Ditto.
22120
22121         (Indexer): Ditto.
22122
22123         (Operator): Ditto.
22124
22125         * enum.cs (Emit): Ditto.
22126
22127         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22128         Enums too.
22129
22130         * class.cs (Field, Event, etc.): Move attribute generation into the
22131         Emit method everywhere.
22132
22133         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22134         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22135         as we had no way of defining nested enums !
22136
22137         * rootcontext.cs : Adjust code accordingly.
22138
22139         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22140
22141 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22142
22143         * expression.cs (EvalConstantExpression): Move into ecore.cs
22144
22145         * enum.cs (Enum): Rename some members and make them public and readonly
22146         according to our convention.
22147
22148         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22149         nothing else.
22150
22151         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22152
22153         (Enum::Emit): Write a simple version for now which doesn't try to compute
22154         expressions. I shall modify this to be more robust in just a while.
22155
22156         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22157
22158         (TypeContainer::CloseType): Create the Enum types too.
22159
22160         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22161
22162         * expression.cs (EvalConstantExpression): Get rid of completely.
22163
22164         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22165         user-defined values and other cases.
22166
22167         (IsValidEnumLiteral): Helper function.
22168
22169         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22170         out there in the case we had a literal FieldExpr.
22171
22172         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22173
22174         (Literalize): Revamp a bit to take two arguments.
22175
22176         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22177
22178 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22179
22180         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22181
22182         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22183
22184         (Resolve): Use the above to ensure we have proper initializers.
22185
22186 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22187
22188         * expression.cs (Expression::EvalConstantExpression): New method to 
22189         evaluate constant expressions.
22190
22191         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22192
22193 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22194
22195         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22196         in an array.
22197
22198         (Binary.ResolveOperator): Handle operator != (object a, object b)
22199         and operator == (object a, object b);
22200
22201         (Binary.DoNumericPromotions): Indicate whether the numeric
22202         promotion was possible.
22203
22204         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22205         Implement.  
22206
22207         Made the ArrayAccess implement interface IAssignMethod instead of
22208         IStackStore as the order in which arguments are passed reflects
22209         this.
22210
22211         * assign.cs: Instead of using expr.ExprClass to select the way of
22212         assinging, probe for the IStackStore/IAssignMethod interfaces.
22213
22214         * typemanager.cs: Load InitializeArray definition.
22215
22216         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22217         static data that can be used to initialize arrays. 
22218
22219 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22220
22221         * expression.cs: Handle operator== and operator!= for booleans.
22222
22223         (Conditioal.Reduce): Implement reducer for the ?: operator.
22224
22225         (Conditional.Resolve): Implement dead code elimination.
22226
22227         (Binary.Resolve): Catch string literals and return a new
22228         concatenated string.
22229
22230         (Unary.Reduce): Implement reduction of unary expressions.
22231
22232         * ecore.cs: Split out the expression core handling here.
22233
22234         (Expression.Reduce): New method used to perform constant folding
22235         and CSE.  This is needed to support constant-expressions. 
22236
22237         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22238         targets, and optimize for !x.
22239
22240 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22241
22242         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22243         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22244         set custom atttributes.
22245
22246         * literal.cs (Literal::GetValue): New abstract method to return the actual
22247         value of the literal, cast as an object.
22248
22249         (*Literal): Implement GetValue method.
22250
22251         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22252         expressions to the arraylist but objects of type Argument.
22253
22254         * class.cs (TypeContainer::Emit): Emit our attributes too.
22255
22256         (Method::Emit, Constructor::Emit): Ditto.
22257
22258         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22259         to be ignoring earlier.
22260
22261 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22262
22263         * attribute.cs (AttributeSection::Define): Implement to do the business
22264         of constructing a CustomAttributeBuilder.
22265
22266         (Attribute): New trivial class. Increases readability of code.  
22267
22268         * cs-parser.jay : Update accordingly.
22269
22270         (positional_argument_list, named_argument_list, named_argument): New rules
22271
22272         (attribute_arguments): Use the above so that we are more correct.
22273
22274 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22275
22276         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22277         to perform all checks for a method with a params parameter.
22278
22279         (Invocation::OverloadResolve): Update to use the above method and therefore
22280         cope correctly with params method invocations.
22281
22282         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22283         params too.
22284
22285         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22286         constructors in our parent too because we can't afford to miss out on 
22287         protected ones ;-)
22288
22289         * attribute.cs (AttributeSection): New name for the class Attribute
22290
22291         Other trivial changes to improve readability.
22292
22293         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22294         use the new class names.
22295
22296 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22297
22298         * class.cs (Method::Define): Complete definition for params types too
22299
22300         (Indexer::Define): Ditto.
22301
22302         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22303         Cope everywhere with a request for info about the array parameter.
22304
22305 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22306
22307         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22308
22309         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22310         local_variable_type to extract the string corresponding to the type.
22311
22312         (local_variable_type): Fixup the action to use the new helper method.
22313
22314         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22315         go.
22316
22317         * expression.cs : Clean out code which uses the above.
22318
22319 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22320
22321         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22322         and bale out if necessary by returning a false.
22323
22324         (RegisterProperty): Ditto.
22325
22326         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22327         and print out appropriate error messages.
22328
22329         * interface.cs (everywhere): Ditto.
22330
22331         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22332         location to constructor.
22333
22334         * class.cs (Property, Event, Indexer): Update accordingly.
22335
22336         * ../errors/cs111.cs : Added.
22337
22338         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22339         of a method, as laid down by the spec.
22340
22341         (Invocation::OverloadResolve): Use the above method.
22342
22343 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22344
22345         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22346         now take a TypeContainer and a Parameters object.
22347
22348         (ParameterData): Modify return type of ParameterModifier method to be 
22349         Parameter.Modifier and not a string.
22350
22351         (ReflectionParameters, InternalParameters): Update accordingly.
22352
22353         * expression.cs (Argument::GetParameterModifier): Same here.
22354
22355         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22356         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22357         symbol in it at all so maybe this is only for now.
22358
22359 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22360
22361         * support.cs (InternalParameters): Constructor now takes an extra argument 
22362         which is the actual Parameters class.
22363
22364         (ParameterDesc): Update to provide info on ref/out modifiers.
22365
22366         * class.cs (everywhere): Update call to InternalParameters to pass in
22367         the second argument too.
22368
22369         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22370         to return the modifier info [ref/out etc]
22371
22372         (InternalParameters, ReflectionParameters): Implement the above.
22373
22374         * expression.cs (Argument::ParameterModifier): Similar function to return
22375         info about the argument's modifiers.
22376
22377         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22378         too.
22379
22380         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22381         a new SetFormalParameters object which we pass to InternalParameters.
22382
22383 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22384
22385         * expression.cs (NewArray): Merge into the ArrayCreation class.
22386
22387 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22388
22389         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22390         NewUserdefinedArray into one as there wasn't much of a use in having
22391         two separate ones.
22392
22393         * expression.cs (Argument): Change field's name to ArgType from Type.
22394
22395         (Type): New readonly property which returns the proper type, taking into 
22396         account ref/out modifiers.
22397
22398         (everywhere): Adjust code accordingly for the above.
22399
22400         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22401         whether we are emitting for a ref or out parameter.
22402
22403         * expression.cs (Argument::Emit): Use the above field to set the state.
22404
22405         (LocalVariableReference::Emit): Update to honour the flag and emit the
22406         right stuff.
22407
22408         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22409
22410         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22411
22412         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22413
22414         (ReflectionParameters, InternalParameters): Implement the above method.
22415
22416         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22417         reporting errors.
22418
22419         (Invocation::FullMethodDesc): Ditto. 
22420
22421 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22422
22423         * cs-parser.jay: Add extra production for the second form of array
22424         creation. 
22425
22426         * expression.cs (ArrayCreation): Update to reflect the above
22427         change. 
22428
22429         * Small changes to prepare for Array initialization.
22430
22431 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22432
22433         * typemanager.cs (ImplementsInterface): interface might be null;
22434         Deal with this problem;
22435
22436         Also, we do store negative hits on the cache (null values), so use
22437         this instead of calling t.GetInterfaces on the type everytime.
22438
22439 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22440
22441         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22442
22443         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22444         split functionality out into different classes.
22445
22446         (New::FormArrayType): Move into NewBuiltinArray.
22447
22448         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22449         quite useless.
22450
22451         (NewBuiltinArray): New class to handle creation of built-in arrays.
22452
22453         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22454         account creation of one-dimensional arrays.
22455
22456         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22457
22458         (NewUserdefinedArray::DoResolve): Implement.
22459
22460         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22461
22462         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22463         we maintain inside the TypeManager. This is necessary to perform lookups on the
22464         module builder.
22465
22466         (LookupType): Update to perform GetType on the module builders too.     
22467
22468         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22469
22470         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22471
22472 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22473
22474         * expression.cs (New::DoResolve): Implement guts of array creation.
22475
22476         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22477
22478 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22479
22480         * expression.cs: Fix bug I introduced lsat night that broke
22481         Delegates. 
22482
22483         (Expression.Resolve): Report a 246 error (can not resolve name)
22484         if we find a SimpleName in the stream.
22485
22486         (Expression.ResolveLValue): Ditto.
22487
22488         (Expression.ResolveWithSimpleName): This function is a variant of
22489         ResolveName, this one allows SimpleNames to be returned without a
22490         warning.  The only consumer of SimpleNames is MemberAccess
22491
22492 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22493
22494         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22495         might arrive here.  I have my doubts that this is correct.
22496
22497         * statement.cs (Lock): Implement lock statement.
22498
22499         * cs-parser.jay: Small fixes to support `lock' and `using'
22500
22501         * cs-tokenizer.cs: Remove extra space
22502
22503         * driver.cs: New flag --checked, allows to turn on integer math
22504         checking. 
22505
22506         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22507         Threading.Monitor.Exit 
22508
22509 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22510
22511         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22512         Expression Class to be IndexerAccess.
22513
22514         Notice that Indexer::DoResolve sets the eclass to Value.
22515
22516 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22517
22518         * class.cs (TypeContainer::Emit): Emit code for indexers.
22519
22520         * assign.cs (IAssignMethod): New interface implemented by Indexers
22521         and Properties for handling assignment.
22522
22523         (Assign::Emit): Simplify and reuse code. 
22524
22525         * expression.cs (IndexerAccess, PropertyExpr): Implement
22526         IAssignMethod, clean up old code. 
22527
22528 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22529
22530         * typemanager.cs (ImplementsInterface): New method to determine if a type
22531         implements a given interface. Provides a nice cache too.
22532
22533         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22534         method.
22535
22536         (ConvertReferenceExplicit): Ditto.
22537
22538         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22539         various methods, with correct names etc.
22540
22541         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22542         Operator.UnaryNegation.
22543
22544         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22545         we have a unary plus or minus operator.
22546
22547         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22548         UnaryMinus.
22549
22550         * everywhere : update accordingly.
22551
22552         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22553         respectively.
22554
22555         * class.cs (Method::Define): For the case where we are implementing a method
22556         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22557         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22558
22559 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22560
22561         * interface.cs (FindMembers): Implement to work around S.R.E
22562         lameness.
22563
22564         * typemanager.cs (IsInterfaceType): Implement.
22565
22566         (FindMembers): Update to handle interface types too.
22567
22568         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22569         use IsAssignableFrom as that is not correct - it doesn't work.
22570
22571         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22572         and accordingly override EmitStatement.
22573
22574         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22575         using the correct logic :-)
22576
22577 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22578
22579         * ../errors/cs-11.cs : Add to demonstrate error -11 
22580
22581 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22582
22583         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22584         then pass this as a hint to ResolveLValue.
22585
22586         * expression.cs (FieldExpr): Add Location information
22587
22588         (FieldExpr::LValueResolve): Report assignment to readonly
22589         variable. 
22590
22591         (Expression::ExprClassFromMemberInfo): Pass location information.
22592
22593         (Expression::ResolveLValue): Add new method that resolves an
22594         LValue. 
22595
22596         (Expression::DoResolveLValue): Default invocation calls
22597         DoResolve. 
22598
22599         (Indexers): New class used to keep track of indexers in a given
22600         Type. 
22601
22602         (IStackStore): Renamed from LValue, as it did not really describe
22603         what this did.  Also ResolveLValue is gone from this interface and
22604         now is part of Expression.
22605
22606         (ElementAccess): Depending on the element access type
22607
22608         * typemanager.cs: Add `indexer_name_type' as a Core type
22609         (System.Runtime.CompilerServices.IndexerNameAttribute)
22610
22611         * statement.cs (Goto): Take a location.
22612
22613 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22614
22615         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22616         if two delegates are compatible.
22617
22618         (NewDelegate::DoResolve): Update to take care of the case when
22619         we instantiate a delegate from another delegate.
22620
22621         * typemanager.cs (FindMembers): Don't even try to look up members
22622         of Delegate types for now.
22623
22624 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22625
22626         * delegate.cs (NewDelegate): New class to take care of delegate
22627         instantiation.
22628
22629         * expression.cs (New): Split the delegate related code out into 
22630         the NewDelegate class.
22631
22632         * delegate.cs (DelegateInvocation): New class to handle delegate 
22633         invocation.
22634
22635         * expression.cs (Invocation): Split out delegate related code into
22636         the DelegateInvocation class.
22637
22638 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22639
22640         * expression.cs (New::DoResolve): Implement delegate creation fully
22641         and according to the spec.
22642
22643         (New::DoEmit): Update to handle delegates differently.
22644
22645         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22646         because of which we were printing out arguments in reverse order !
22647
22648         * delegate.cs (VerifyMethod): Implement to check if the given method
22649         matches the delegate.
22650
22651         (FullDelegateDesc): Implement.
22652
22653         (VerifyApplicability): Implement.
22654
22655         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22656         delegate invocations too.
22657
22658         (Invocation::Emit): Ditto.
22659
22660         * ../errors/cs1593.cs : Added.
22661
22662         * ../errors/cs1594.cs : Added.
22663
22664         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22665
22666 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22667
22668         * typemanager.cs (intptr_type): Core type for System.IntPtr
22669
22670         (InitCoreTypes): Update for the same.
22671
22672         (iasyncresult_type, asynccallback_type): Ditto.
22673
22674         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22675         correct.
22676
22677         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22678         too.
22679
22680         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22681         the builders for the 4 members of a delegate type :-)
22682
22683         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22684         type.
22685
22686         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22687
22688         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22689
22690 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22691
22692         * statement.cs (Break::Emit): Implement.   
22693         (Continue::Emit): Implement.
22694
22695         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22696         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22697         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22698         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22699         end loop
22700
22701         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22702         properties that track the label for the current loop (begin of the
22703         loop and end of the loop).
22704
22705 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22706
22707         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22708         use of emitting anything at all.
22709
22710         * class.cs, rootcontext.cs : Get rid of calls to the same.
22711
22712         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22713
22714         (Populate): Define the constructor correctly and set the implementation
22715         attributes.
22716
22717         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22718         have been defined.
22719
22720         (AddDelegateType): Implement.
22721
22722         (IsDelegateType): Implement helper method.
22723
22724         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22725
22726         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22727         and accordingly handle it.
22728
22729         * delegate.cs (Populate): Take TypeContainer argument.
22730         Implement bits to define the Invoke method. However, I still haven't figured out
22731         how to take care of the native int bit :-(
22732
22733         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22734         Qualify the name of the delegate, not its return type !
22735
22736         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22737         conversion.
22738
22739         (StandardConversionExists): Checking for array types turns out to be recursive.
22740
22741         (ConvertReferenceExplicit): Implement array conversion.
22742
22743         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22744
22745 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22746
22747         * cs-parser.jay (delegate_declaration): Store the fully qualified
22748         name as it is a type declaration.
22749
22750         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22751         readonly.
22752
22753         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22754         as TypeContainer::DefineType.
22755
22756         (Populate): Method in which all the definition of the various methods (Invoke)
22757         etc is done.
22758
22759         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22760         see.
22761
22762         (CloseDelegate): Finally creates the delegate.
22763
22764         * class.cs (TypeContainer::DefineType): Update to define delegates.
22765         (Populate, Emit and CloseType): Do the same thing here too.
22766
22767         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22768         delegates in all these operations.
22769
22770 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22771
22772         * expression.cs: LocalTemporary: a new expression used to
22773         reference a temporary that has been created.
22774
22775         * assign.cs: Handle PropertyAccess back here, so that we can
22776         provide the proper semantic access to properties.
22777
22778         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22779         a few more explicit conversions. 
22780
22781         * modifiers.cs: `NEW' modifier maps to HideBySig.
22782
22783         * expression.cs (PropertyExpr): Make this into an
22784         ExpressionStatement, and support the EmitStatement code path. 
22785
22786         Perform get/set error checking, clean up the interface.
22787
22788         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22789         them into toplevel access objects.
22790
22791 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22792
22793         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22794         SRE.
22795
22796         * typemanager.cs: Keep track here of our PropertyBuilders again to
22797         work around lameness in SRE.
22798
22799 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22800
22801         * expression.cs (LValue::LValueResolve): New method in the
22802         interface, used to perform a second resolution pass for LValues. 
22803
22804         (This::DoResolve): Catch the use of this in static methods.
22805
22806         (This::LValueResolve): Implement.
22807
22808         (This::Store): Remove warning, assigning to `this' in structures
22809         is 
22810
22811         (Invocation::Emit): Deal with invocation of
22812         methods on value types.  We need to pass the address to structure
22813         methods rather than the object itself.  (The equivalent code to
22814         emit "this" for structures leaves the entire structure on the
22815         stack instead of a pointer to it). 
22816
22817         (ParameterReference::DoResolve): Compute the real index for the
22818         argument based on whether the method takes or not a `this' pointer
22819         (ie, the method is static).
22820
22821         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22822         value types returned from functions when we need to invoke a
22823         method on the sturcture.
22824
22825
22826 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22827
22828         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22829         defining the type in the Modulebuilder or Typebuilder. This is to take
22830         care of nested types which need to be defined on the TypeBuilder using
22831         DefineNestedMethod.
22832
22833         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22834         methods in RootContext, only ported to be part of TypeContainer.
22835
22836         (TypeContainer::GetInterfaceOrClass): Ditto.
22837
22838         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22839
22840         * interface.cs (Interface::DefineInterface): New method. Does exactly
22841         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22842         too.
22843
22844         (Interface::GetInterfaces): Move from RootContext here and port.
22845
22846         (Interface::GetInterfaceByName): Same here.
22847
22848         * rootcontext.cs (ResolveTree): Re-write.
22849
22850         (PopulateTypes): Re-write.
22851
22852         * class.cs (TypeContainer::Populate): Populate nested types too.
22853         (TypeContainer::Emit): Emit nested members too.
22854
22855         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22856         instead just use the name argument passed in as it is already fully
22857         qualified.
22858
22859         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22860         to TypeContainer mapping to see if a type is user-defined.
22861
22862         * class.cs (TypeContainer::CloseType): Implement. 
22863
22864         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22865         the default constructor.
22866
22867         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22868         twice.
22869
22870         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22871
22872         * interface.cs (CloseType): Create the type here.
22873
22874         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22875         the hierarchy.
22876
22877         Remove all the methods which are now in TypeContainer.
22878
22879 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22880
22881         * delegate.cs (Define): Re-write bits to define the delegate
22882         correctly.
22883
22884 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22885
22886         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22887
22888         * expression.cs (ImplicitReferenceConversion): handle null as well
22889         as a source to convert to any reference type.
22890
22891         * statement.cs (Return): Perform any implicit conversions to
22892         expected return type.  
22893
22894         Validate use of return statement.  
22895
22896         * codegen.cs (EmitContext): Pass the expected return type here.
22897
22898         * class.cs (Method, Constructor, Property): Pass expected return
22899         type to EmitContext.
22900
22901 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22902
22903         * expression.cs: Make DoResolve take an EmitContext instead of a
22904         TypeContainer.
22905
22906         Replaced `l' and `location' for `loc', for consistency.
22907
22908         (Error, Warning): Remove unneeded Tc argument.
22909
22910         * assign.cs, literal.cs, constant.cs: Update to new calling
22911         convention. 
22912
22913         * codegen.cs: EmitContext now contains a flag indicating whether
22914         code is being generated in a static method or not.
22915
22916         * cs-parser.jay: DecomposeQI, new function that replaces the old
22917         QualifiedIdentifier.  Now we always decompose the assembled
22918         strings from qualified_identifier productions into a group of
22919         memberaccesses.
22920
22921 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22922
22923         * rootcontext.cs: Deal with field-less struct types correctly now
22924         by passing the size option to Define Type.
22925
22926         * class.cs: Removed hack that created one static field. 
22927
22928 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22929
22930         * statement.cs: Moved most of the code generation here. 
22931
22932 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22933
22934         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22935         seem very right.
22936
22937         (ElementAccess): Remove useless bits for now - keep checks as the spec
22938         says.
22939
22940 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22941
22942         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22943         and start performing checks according to the spec.
22944
22945 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22946
22947         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22948         rank_specifiers instead.
22949
22950         (rank_specifiers): Change the order in which the rank specifiers are stored
22951
22952         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22953
22954         * expression.cs (ElementAccess): Implement the LValue interface too.
22955
22956 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22957
22958         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22959         except that user defined conversions are not included.
22960
22961         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22962         perform the conversion of the return type, if necessary.
22963
22964         (New::DoResolve): Check whether we are creating an array or an object
22965         and accordingly do the needful.
22966
22967         (New::Emit): Same here.
22968
22969         (New::DoResolve): Implement guts of array creation.
22970
22971         (New::FormLookupType): Helper function.
22972
22973 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22974
22975         * codegen.cs: Removed most of the code generation here, and move the
22976         corresponding code generation bits to the statement classes. 
22977
22978         Added support for try/catch/finalize and throw.
22979
22980         * cs-parser.jay: Added support for try/catch/finalize.
22981
22982         * class.cs: Catch static methods having the flags override,
22983         virtual or abstract.
22984
22985         * expression.cs (UserCast): This user cast was not really doing
22986         what it was supposed to do.  Which is to be born in fully resolved
22987         state.  Parts of the resolution were being performed at Emit time! 
22988
22989         Fixed this code.
22990
22991 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22992
22993         * expression.cs: Implicity convert the result from UserCast.
22994
22995 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22996
22997         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22998         prevented it from working correctly. 
22999
23000         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23001         merely ConvertImplicit.
23002
23003 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23004
23005         * typemanager.cs: Make the LookupTypeContainer function static,
23006         and not per-instance.  
23007
23008         * class.cs: Make static FindMembers (the one that takes a Type
23009         argument). 
23010
23011         * codegen.cs: Add EmitForeach here.
23012
23013         * cs-parser.jay: Make foreach a toplevel object instead of the
23014         inline expansion, as we need to perform semantic analysis on it. 
23015
23016 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23017
23018         * expression.cs (Expression::ImplicitUserConversion): Rename to
23019         UserDefinedConversion.
23020
23021         (Expression::UserDefinedConversion): Take an extra argument specifying 
23022         whether we look for explicit user conversions too.
23023
23024         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23025
23026         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23027
23028         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23029         with the appropriate arguments.
23030
23031         * cs-parser.jay (cast_expression): Record location too.
23032
23033         * expression.cs (Cast): Record location info.
23034
23035         (Expression::ConvertExplicit): Take location argument.
23036
23037         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23038         to determine if we are doing explicit conversions.
23039
23040         (UserCast::Emit): Update accordingly.
23041
23042         (Expression::ConvertExplicit): Report an error if everything fails.
23043
23044         * ../errors/cs0030.cs : Add.
23045
23046 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23047
23048         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23049         virtual and newslot bits. 
23050
23051         * class.cs (TypeContainer::RegisterRequiredImplementations):
23052         Record methods we need.
23053
23054         (TypeContainer::MakeKey): Helper function to make keys for
23055         MethodBases, since the Methodbase key is useless.
23056
23057         (TypeContainer::Populate): Call RegisterRequiredImplementations
23058         before defining the methods.   
23059
23060         Create a mapping for method_builders_to_methods ahead of time
23061         instead of inside a tight loop.
23062
23063         (::RequireMethods):  Accept an object as the data to set into the
23064         hashtable so we can report interface vs abstract method mismatch.
23065
23066 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23067
23068         * report.cs: Make all of it static.
23069
23070         * rootcontext.cs: Drop object_type and value_type computations, as
23071         we have those in the TypeManager anyways.
23072
23073         Drop report instance variable too, now it is a global.
23074
23075         * driver.cs: Use try/catch on command line handling.
23076
23077         Add --probe option to debug the error reporting system with a test
23078         suite. 
23079
23080         * report.cs: Add support for exiting program when a probe
23081         condition is reached.
23082
23083 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23084
23085         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23086         we do a forcible conversion regardless of type, to check if 
23087         ForceConversion returns a null.
23088
23089         (Binary::error19): Use location to report error.
23090
23091         (Unary::error23): Use location here too.
23092
23093         * ../errors/cs0019.cs : Check in.
23094
23095         * ../errors/cs0023.cs : Check in.
23096
23097         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23098         case of a non-null MethodInfo object with a length of 0 !
23099
23100         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23101         an applicable member - according to the spec :-)
23102         Also fix logic to find members in base types.
23103
23104         (Unary::ResolveOperator): Same here.
23105
23106         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23107         as I was getting thoroughly confused between this and error19 :-)
23108
23109         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23110         (::FindMostEncompassedType): Implement.
23111         (::FindMostEncompassingType): Implement.
23112         (::StandardConversionExists): Implement.
23113
23114         (UserImplicitCast): Re-vamp. We now need info about most specific
23115         source and target types so that we can do the necessary conversions.
23116
23117         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23118         mathematical union with no duplicates.
23119
23120 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23121
23122         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23123         in order from base classes to child classes, so that we can in
23124         child classes look up in our parent for method names and
23125         attributes (required for handling abstract, virtual, new, override
23126         constructs: we need to instrospect our base class, and if we dont
23127         populate the classes in order, the introspection might be
23128         incorrect.  For example, a method could query its parent before
23129         the parent has any methods and would determine that the parent has
23130         no abstract methods (while it could have had them)).
23131
23132         (RootContext::CreateType): Record the order in which we define the
23133         classes.
23134
23135 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23136
23137         * class.cs (TypeContainer::Populate): Also method definitions can
23138         fail now, keep track of this.
23139
23140         (TypeContainer::FindMembers): Implement support for
23141         DeclaredOnly/noDeclaredOnly flag.
23142
23143         (Constructor::Emit) Return the ConstructorBuilder.
23144
23145         (Method::Emit) Return the MethodBuilder. 
23146         Check for abstract or virtual methods to be public.
23147
23148         * rootcontext.cs (RootContext::CreateType): Register all the
23149         abstract methods required for the class to be complete and the
23150         interface methods that must be implemented. 
23151
23152         * cs-parser.jay: Report error 501 (method requires body if it is
23153         not marked abstract or extern).
23154
23155         * expression.cs (TypeOf::Emit): Implement.
23156
23157         * typemanager.cs: runtime_handle_type, new global type.
23158
23159         * class.cs (Property::Emit): Generate code for properties.
23160
23161 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23162
23163         * expression.cs (Unary::ResolveOperator): Find operators on base type
23164         too - we now conform exactly to the spec.
23165
23166         (Binary::ResolveOperator): Same here.
23167
23168         * class.cs (Operator::Define): Fix minor quirk in the tests.
23169
23170         * ../errors/cs0215.cs : Added.
23171
23172         * ../errors/cs0556.cs : Added.
23173
23174         * ../errors/cs0555.cs : Added.
23175
23176 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23177
23178         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23179         single integer which is really efficient
23180
23181 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23182
23183         *  expression.cs (Expression::ImplicitUserConversion): Use location
23184         even in the case when we are examining True operators.
23185  
23186         * class.cs (Operator::Define): Perform extensive checks to conform
23187         with the rules for operator overloading in the spec.
23188
23189         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23190         some of the other conversions mentioned in the spec.
23191
23192         * typemanager.cs (array_type): New static member for the System.Array built-in
23193         type.
23194
23195         (cloneable_interface): For System.ICloneable interface.
23196
23197         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23198         we start resolving the tree and populating types.
23199
23200         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23201  
23202 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23203
23204         * expression.cs (Expression::ExprClassFromMemberInfo,
23205         Expression::Literalize): Create literal expressions from
23206         FieldInfos which are literals.
23207
23208         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23209         type casts, because they were wrong.  The test suite in tests
23210         caught these ones.
23211
23212         (ImplicitNumericConversion): ushort to ulong requires a widening
23213         cast. 
23214
23215         Int32 constant to long requires widening cast as well.
23216
23217         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23218         for integers because the type on the stack is not i4.
23219
23220 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23221
23222         * expression.cs (report118): require location argument. 
23223
23224         * parameter.cs: Do not dereference potential null value.
23225
23226         * class.cs: Catch methods that lack the `new' keyword when
23227         overriding a name.  Report warnings when `new' is used without
23228         anything being there to override.
23229
23230         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23231
23232         * class.cs: Only add constructor to hashtable if it is non-null
23233         (as now constructors can fail on define).
23234
23235         (TypeManager, Class, Struct): Take location arguments.
23236
23237         Catch field instance initialization in structs as errors.
23238
23239         accepting_filter: a new filter for FindMembers that is static so
23240         that we dont create an instance per invocation.
23241
23242         (Constructor::Define): Catch errors where a struct constructor is
23243         parameterless 
23244
23245         * cs-parser.jay: Pass location information for various new
23246         constructs. 
23247
23248         * delegate.cs (Delegate): take a location argument.
23249
23250         * driver.cs: Do not call EmitCode if there were problesm in the
23251         Definition of the types, as many Builders wont be there. 
23252
23253         * decl.cs (Decl::Decl): Require a location argument.
23254
23255         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23256         into integers, and find the most appropiate integer for it.
23257
23258         * literal.cs: Implement ULongLiteral.
23259
23260         * rootcontext.cs: Provide better information about the location of
23261         failure when CreateType fails.
23262
23263 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23264
23265         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23266         as well.
23267
23268         * expression.cs (Binary::CheckShiftArguments): Add missing type
23269         computation.
23270         (Binary::ResolveOperator): Add type to the logical and and logical
23271         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23272         before.
23273
23274         (Binary::DoNumericPromotions): In the case where either argument
23275         is ulong (and most signed types combined with ulong cause an
23276         error) perform implicit integer constant conversions as well.
23277
23278 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23279
23280         * expression.cs (UserImplicitCast): Method should always be
23281         non-null. 
23282         (Invocation::BetterConversion): Simplified test for IntLiteral.
23283
23284         (Expression::ImplicitNumericConversion): Split this routine out.
23285         Put the code that performs implicit constant integer conversions
23286         here. 
23287
23288         (Expression::Resolve): Become a wrapper around DoResolve so we can
23289         check eclass and type being set after resolve.
23290
23291         (Invocation::Badness): Remove this dead function
23292
23293         (Binary::ResolveOperator): Do not compute the expensive argumnets
23294         unless we have a union for it.
23295
23296         (Probe::Emit): Is needs to do an isinst and then
23297         compare against null.
23298
23299         (::CanConvert): Added Location argument.  If the Location argument
23300         is null (Location.Null), then we do not report errors.  This is
23301         used by the `probe' mechanism of the Explicit conversion.  We do
23302         not want to generate an error for something that the user
23303         explicitly requested to be casted.  But the pipeline for an
23304         explicit cast first tests for potential implicit casts.
23305
23306         So for now, if the Location is null, it means `Probe only' to
23307         avoid adding another argument.   Might have to revise this
23308         strategy later.
23309
23310         (ClassCast): New class used to type cast objects into arbitrary
23311         classes (used in Explicit Reference Conversions).
23312
23313         Implement `as' as well.
23314
23315         Reverted all the patches from Ravi below: they were broken:
23316
23317                 * The use of `level' as a mechanism to stop recursive
23318                   invocations is wrong.  That was there just to catch the
23319                   bug with a strack trace but not as a way of addressing
23320                   the problem.
23321
23322                   To fix the problem we have to *understand* what is going
23323                   on and the interactions and come up with a plan, not
23324                   just get things going.
23325
23326                 * The use of the type conversion cache that I proposed
23327                   last night had an open topic: How does this work across
23328                   protection domains.  A user defined conversion might not
23329                   be public in the location where we are applying the
23330                   conversion, a different conversion might be selected
23331                   (ie, private A->B (better) but public B->A (worse),
23332                   inside A, A->B applies, but outside it, B->A will
23333                   apply).
23334
23335                 * On top of that (ie, even if the above is solved),
23336                   conversions in a cache need to be abstract.  Ie, `To
23337                   convert from an Int to a Short use an OpcodeCast', not
23338                   `To convert from an Int to a Short use the OpcodeCast on
23339                   the variable 5' (which is what this patch was doing).
23340
23341 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23342
23343         * expression.cs (Invocation::ConversionExists): Re-write to use
23344         the conversion cache
23345
23346         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23347         cache all conversions done, not just user-defined ones.
23348
23349         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23350         to determine if a conversion exists instead of acutually trying to 
23351         perform the conversion. It's faster too.
23352
23353         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23354         and only then attempt the implicit conversion.
23355
23356 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23357
23358         * expression.cs (ConvertImplicit): Use a cache for conversions
23359         already found. Check level of recursion and bail out if necessary.
23360
23361 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23362
23363         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23364         Export standard methods that we expect for string operations.
23365
23366         * statement.cs (Block::UsageWarning): Track usage of variables and
23367         report the errors for not used variables.
23368
23369         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23370         operator. 
23371
23372 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * codegen.cs: remove unnneded code 
23375
23376         * expression.cs: Removed BuiltinTypeAccess class
23377
23378         Fix the order in which implicit conversions are
23379         done.  
23380
23381         The previous fixed dropped support for boxed conversions (adding a
23382         test to the test suite now)
23383
23384         (UserImplicitCast::CanConvert): Remove test for source being null,
23385         that code is broken.  We should not feed a null to begin with, if
23386         we do, then we should track the bug where the problem originates
23387         and not try to cover it up here.
23388
23389         Return a resolved expression of type UserImplicitCast on success
23390         rather than true/false.  Ravi: this is what I was talking about,
23391         the pattern is to use a static method as a "constructor" for
23392         objects. 
23393
23394         Also, do not create arguments until the very last minute,
23395         otherwise we always create the arguments even for lookups that
23396         will never be performed. 
23397
23398         (UserImplicitCast::Resolve): Eliminate, objects of type
23399         UserImplicitCast are born in a fully resolved state. 
23400
23401         * typemanager.cs (InitCoreTypes): Init also value_type
23402         (System.ValueType). 
23403
23404         * expression.cs (Cast::Resolve): First resolve the child expression.
23405
23406         (LValue): Add new method AddressOf to be used by
23407         the `&' operator.  
23408
23409         Change the argument of Store to take an EmitContext instead of an
23410         ILGenerator, because things like FieldExpr need to be able to call
23411         their children expression to generate the instance code. 
23412
23413         (Expression::Error, Expression::Warning): Sugar functions for
23414         reporting errors.
23415
23416         (Expression::MemberLookup): Accept a TypeContainer instead of a
23417         Report as the first argument.
23418
23419         (Expression::ResolvePrimary): Killed.  I still want to improve
23420         this as currently the code is just not right.
23421
23422         (Expression::ResolveMemberAccess): Simplify, but it is still
23423         wrong. 
23424
23425         (Unary::Resolve): Catch errors in AddressOf operators.
23426
23427         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23428         index to a byte for the short-version, or the compiler will choose
23429         the wrong Emit call, which generates the wrong data.
23430
23431         (ParameterReference::Emit, ::Store): same.
23432
23433         (FieldExpr::AddressOf): Implement.
23434
23435         * typemanager.cs: TypeManager: made public variable instead of
23436         property.
23437
23438         * driver.cs: document --fatal.
23439
23440         * report.cs (ErrorMessage, WarningMessage): new names for the old
23441         Error and Warning classes.
23442
23443         * cs-parser.jay (member_access): Turn built-in access to types
23444         into a normal simplename
23445
23446 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23447
23448         * expression.cs (Invocation::BetterConversion): Fix to cope
23449         with q being null, since this was introducing a bug.
23450
23451         * expression.cs (ConvertImplicit): Do built-in conversions first.
23452
23453 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23454
23455         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23456
23457 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23458
23459         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23460         I had introduced long ago (what's new ?).
23461
23462         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23463         the work of all the checking. 
23464         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23465         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23466
23467         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23468         that is the right way. 
23469
23470         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23471         overloading resolution. Use everywhere instead of cutting and pasting code.
23472
23473         (Binary::ResolveOperator): Use MakeUnionSet.
23474
23475         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23476         we have to convert to bool types. Not complete yet.
23477
23478 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23479
23480         * typemanager.cs (TypeManager::CSharpName): support ushort.
23481
23482         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23483         to provide an expression that performsn an implicit constant int
23484         conversion (section 6.1.6).
23485         (Expression::ConvertImplicitRequired): Reworked to include
23486         implicit constant expression conversions.
23487
23488         (Expression::ConvertNumericExplicit): Finished.
23489
23490         (Invocation::Emit): If InstanceExpression is null, then it means
23491         that we perform a call on this.
23492
23493 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23494
23495         * expression.cs (Unary::Emit): Remove some dead code.
23496         (Probe): Implement Resolve and Emit for `is'.
23497         (Expression::ConvertImplicitRequired): Attempt to do constant
23498         expression conversions here.  Maybe should be moved to
23499         ConvertImplicit, but I am not sure.
23500         (Expression::ImplicitLongConstantConversionPossible,
23501         Expression::ImplicitIntConstantConversionPossible): New functions
23502         that tell whether is it possible to apply an implicit constant
23503         expression conversion.
23504
23505         (ConvertNumericExplicit): Started work on explicit numeric
23506         conversions.
23507
23508         * cs-parser.jay: Update operator constants.
23509
23510         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23511         (Parameters::GetSignature): Hook up VerifyArgs here.
23512         (Parameters::VerifyArgs): Verifies that no two arguments have the
23513         same name. 
23514
23515         * class.cs (Operator): Update the operator names to reflect the
23516         ones that the spec expects (as we are just stringizing the
23517         operator names).
23518
23519         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23520         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23521         previous usage did only work for our methods.
23522         (Expression::ConvertImplicit): Handle decimal implicit numeric
23523         conversions as well.
23524         (Expression::InternalTypeConstructor): Used to invoke constructors
23525         on internal types for default promotions.
23526
23527         (Unary::Emit): Implement special handling for the pre/post
23528         increment/decrement for overloaded operators, as they need to have
23529         the same semantics as the other operators.
23530
23531         (Binary::ResolveOperator): ditto.
23532         (Invocation::ConversionExists): ditto.
23533         (UserImplicitCast::Resolve): ditto.
23534
23535 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23536
23537         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23538         operator, return after emitting body. Regression tests pass again !
23539
23540         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23541         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23542         (Invocation::OverloadResolve): Ditto.
23543         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23544
23545         * everywhere : update calls to the above methods accordingly.
23546
23547 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23548
23549         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23550
23551         * expression.cs (ExpressionStatement): New base class used for
23552         expressions that can appear in statements, so that we can provide
23553         an alternate path to generate expression that do not leave a value
23554         on the stack.
23555
23556         (Expression::Emit, and all the derivatives): We no longer return
23557         whether a value is left on the stack or not.  Every expression
23558         after being emitted leaves a single value on the stack.
23559
23560         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23561         facilties of ExpressionStatement if possible.
23562
23563         * cs-parser.jay: Update statement_expression.
23564
23565 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23566
23567         * driver.cs: Change the wording of message
23568
23569 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23570
23571         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23572         the type of the expression to the return type of the method if
23573         we have an overloaded operator match ! The regression tests pass again !
23574         (Unary::ResolveOperator): Ditto.
23575
23576         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23577         to find "op_Implicit", not "implicit" ;-)
23578         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23579         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23580
23581         * everywhere : Correct calls to the above accordingly.
23582
23583         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23584         (ConvertImplicit): Do user-defined conversion if it exists.
23585
23586 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23587
23588         * assign.cs: track location.
23589         (Resolve): Use implicit conversions on assignment.
23590
23591         * literal.cs: Oops.  Not good, Emit of short access values should
23592         pass (Bytes) or the wrong argument will be selected.
23593
23594         * expression.cs (Unary::Emit): Emit code for -expr.
23595
23596         (Unary::ResolveOperator): Handle `Substract' for non-constants
23597         (substract from zero from the non-constants).
23598         Deal with Doubles as well. 
23599
23600         (Expression::ConvertImplicitRequired): New routine that reports an
23601         error if no implicit conversion exists. 
23602
23603         (Invocation::OverloadResolve): Store the converted implicit
23604         expressions if we make them
23605
23606 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23607
23608         * class.cs (ConstructorInitializer): Take a Location argument.
23609         (ConstructorBaseInitializer): Same here.
23610         (ConstructorThisInitializer): Same here.
23611
23612         * cs-parser.jay : Update all calls accordingly.
23613
23614         * expression.cs (Unary, Binary, New): Take location argument.
23615         Update accordingly everywhere.
23616
23617         * cs-parser.jay : Update all calls to the above to take a location
23618         argument.
23619
23620         * class.cs : Ditto.
23621
23622 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23623
23624         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23625         (Invocation::BetterConversion): Same here
23626         (Invocation::ConversionExists): Ditto.
23627
23628         (Invocation::ConversionExists): Implement.
23629
23630 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23631
23632         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23633         Also take an additional TypeContainer argument.
23634
23635         * All over : Pass in TypeContainer as argument to OverloadResolve.
23636
23637         * typemanager.cs (CSharpName): Update to check for the string type and return
23638         that too.
23639
23640         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23641         a given method.
23642
23643 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23644
23645         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23646         (Invocation::BetterFunction): Implement.
23647         (Invocation::BetterConversion): Implement.
23648         (Invocation::ConversionExists): Skeleton, no implementation yet.
23649
23650         Okay, things work fine !
23651
23652 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23653
23654         * typemanager.cs: declare and load enum_type, delegate_type and
23655         void_type. 
23656
23657         * expression.cs (Expression::Emit): Now emit returns a value that
23658         tells whether a value is left on the stack or not.  This strategy
23659         might be reveted tomorrow with a mechanism that would address
23660         multiple assignments.
23661         (Expression::report118): Utility routine to report mismatches on
23662         the ExprClass.
23663
23664         (Unary::Report23): Report impossible type/operator combination
23665         utility function.
23666
23667         (Unary::IsIncrementableNumber): Whether the type can be
23668         incremented or decremented with add.
23669         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23670         complemented. 
23671         (Unary::ResolveOperator): Implement ++, !, ~,
23672
23673         (Invocation::Emit): Deal with new Emit convetion.
23674
23675         * All Expression derivatives: Updated their Emit method to return
23676         whether they leave values on the stack or not.
23677
23678         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23679         stack for expressions that are statements. 
23680
23681 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23682
23683         * expression.cs (LValue): New interface.  Must be implemented by
23684         LValue objects.
23685         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23686         LValue interface.
23687
23688         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23689         interface for generating code, simplifies the code.
23690
23691 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23692
23693         * expression.cs (everywhere): Comment out return statements in ::Resolve
23694         methods to avoid the warnings.
23695
23696 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23697
23698         * driver.cs (parse): Report error 2001 if we can not open the
23699         source file.
23700
23701         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23702         not resolve it.
23703
23704         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23705         object. 
23706
23707         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23708         otherwise nested blocks end up with the same index.
23709
23710         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23711
23712         * expression.cs:  Instead of having FIXMEs in the Resolve
23713         functions, throw exceptions so it is obvious that we are facing a
23714         bug. 
23715
23716         * cs-parser.jay (invocation_expression): Pass Location information.
23717
23718         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23719         Use a basename for those routines because .NET does not like paths
23720         on them. 
23721
23722         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23723         already defined.
23724
23725 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23726
23727         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23728         are loading the correct data types (throws an exception if not).
23729         (TypeManager::InitCoreTypes): Use CoreLookupType
23730
23731         * expression.cs (Unary::ResolveOperator): return the child
23732         expression for expressions which are just +expr.
23733         (Unary::ResolveOperator): Return negative literals for -LITERAL
23734         expressions (otherwise they are Unary {Literal}).
23735         (Invocation::Badness): Take into account `Implicit constant
23736         expression conversions'.
23737
23738         * literal.cs (LongLiteral): Implement long literal class.
23739         (IntLiteral): export the `Value' of the intliteral. 
23740
23741 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23742
23743         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23744
23745         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23746         instead of 'Operator'
23747
23748         * expression.cs (Binary::ResolveOperator): Update accordingly.
23749         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23750         and 'Minus'
23751
23752         * cs-parser.jay (unary_expression): Update to use the new names.
23753
23754         * gen-treedump.cs (GetUnary): Same here.
23755
23756         * expression.cs (Unary::Resolve): Implement.
23757         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23758         operators are found instead of making noise ;-)
23759         (Unary::ResolveOperator): New method to do precisely the same thing which
23760         Binary::ResolveOperator does for Binary expressions.
23761         (Unary.method, .Arguments): Add.
23762         (Unary::OperName): Implement.   
23763         (Unary::ForceConversion): Copy and Paste !
23764
23765         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23766         a unary operator.
23767
23768         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23769         for the inbuilt operators. Only overloading works for now ;-)
23770
23771 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23772
23773         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23774         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23775
23776         * expression.cs (This::Emit): Implement. 
23777         (This::Resolve): Implement.
23778         (TypeOf:Resolve): Implement.
23779         (Expression::ResolveSimpleName): Add an implicit this to instance
23780         field references. 
23781         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23782         Bind instance variable to Field expressions.
23783         (FieldExpr::Instance): New field used to track the expression that
23784         represents the object instance.
23785         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23786         binding 
23787         (FieldExpr::Emit): Implement.
23788
23789         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23790         the last instruction contains a return opcode to avoid generating
23791         the last `ret' instruction (this generates correct code, and it is
23792         nice to pass the peverify output).
23793
23794         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23795         initializer for static and instance variables.
23796         (Constructor::Emit): Allow initializer to be null in the case of
23797         static constructors.  Only emit initializer for instance
23798         constructors. 
23799
23800         (TypeContainer::FindMembers): Return a null array if there are no
23801         matches.
23802
23803         Also fix the code for the MemberTypes.Method branch, as it was not
23804         scanning that for operators (or tried to access null variables before).
23805
23806         * assign.cs (Assign::Emit): Handle instance and static fields. 
23807
23808         * TODO: Updated.
23809
23810         * driver.cs: Stop compilation if there are parse errors.
23811
23812         * cs-parser.jay (constructor_declaration): Provide default base
23813         initializer for non-static constructors.
23814         (constructor_declarator): Do not provide a default base
23815         initializers if none was specified.
23816         Catch the fact that constructors should not have parameters.
23817
23818         * class.cs: Do not emit parent class initializers for static
23819         constructors, that should be flagged as an error.
23820
23821 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23822
23823         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23824         Move back code into TypeContainer::Populate.
23825
23826 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23827
23828         * class.cs (TypeContainer::AddConstructor): Fix the check to
23829         compare against Name, not Basename. 
23830         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23831
23832         * cs-parser.jay : Update accordingly.
23833
23834         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23835         for methods, don't forget to look into the operators too.
23836         (RegisterMethodBuilder): Helper method to take care of this for
23837         methods, constructors and operators.
23838         (Operator::Define): Completely revamp.
23839         (Operator.OperatorMethod, MethodName): New fields.
23840         (TypeContainer::Populate): Move the registering of builders into
23841         RegisterMethodBuilder.
23842         (Operator::Emit): Re-write.
23843
23844         * expression.cs (Binary::Emit): Comment out code path to emit method
23845         invocation stuff for the case when we have a user defined operator. I am
23846         just not able to get it right !
23847
23848 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23849
23850         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23851         argument. 
23852
23853         (Expression::MemberLookup): Provide a version that allows to
23854         specify the MemberTypes and BindingFlags. 
23855
23856         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23857         so it was not fetching variable information from outer blocks.
23858
23859         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23860         Beforefieldinit as it was buggy.
23861
23862         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23863         that Ravi put here.  
23864
23865         * class.cs (Constructor::Emit): Only emit if block is not null.
23866         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23867         deal with this by semantically definining it as if the user had
23868         done it.
23869
23870         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23871         constructors as we now "emit" them at a higher level.
23872
23873         (TypeContainer::DefineDefaultConstructor): Used to define the
23874         default constructors if none was provided.
23875
23876         (ConstructorInitializer): Add methods Resolve and Emit. 
23877
23878         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23879
23880 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23881
23882         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23883         the default constructor builder with our hashtable for methodbuilders
23884         to methodcores.
23885
23886         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23887         and argument_count is 0 in which case we have a match.
23888         (Binary::ResolveOperator): More null checking and miscellaneous coding
23889         style cleanup.
23890
23891 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23892
23893         * rootcontext.cs (IsNameSpace): Compare against null.
23894
23895         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23896
23897         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23898         and Unary::Operator.
23899
23900         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23901         accordingly.
23902
23903         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23904         we have overloaded operators.
23905         (Binary::ResolveOperator): Implement the part which does the operator overload
23906         resolution.
23907
23908         * class.cs (Operator::Emit): Implement.
23909         (TypeContainer::Emit): Emit the operators we have too.
23910
23911         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23912         the case when we have a user-defined operator.
23913
23914 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23915
23916         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23917
23918 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23919
23920         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23921         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23922         (Constructor::Emit): Implement.
23923         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23924         if we have no work to do. 
23925         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23926         Emit method.
23927
23928         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23929         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23930
23931         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23932         of parent.parent.
23933
23934 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23935
23936         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23937         in the source.
23938         (Tree::RecordNamespace): Method to do what the name says ;-)
23939         (Tree::Namespaces): Property to get at the namespaces hashtable.
23940
23941         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23942         keep track.
23943
23944         * rootcontext.cs (IsNamespace): Fixed it :-)
23945
23946 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23947
23948         * class.cs (TypeContainer::FindMembers): Add support for
23949         constructors. 
23950         (MethodCore): New class that encapsulates both the shared aspects
23951         of a Constructor and a Method.  
23952         (Method, Constructor): Factored pieces into MethodCore.
23953
23954         * driver.cs: Added --fatal which makes errors throw exceptions.
23955         Load System assembly as well as part of the standard library.
23956
23957         * report.cs: Allow throwing exceptions on errors for debugging.
23958
23959         * modifiers.cs: Do not use `parent', instead use the real type
23960         container to evaluate permission settings.
23961
23962         * class.cs: Put Ravi's patch back in.  He is right, and we will
23963         have to cope with the
23964
23965 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23966
23967         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23968         FamORAssem, not FamANDAssem.
23969
23970 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23971
23972         * driver.cs: Added --parse option that only parses its input files
23973         and terminates.
23974
23975         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23976         incorrect.  IsTopLevel is not used to tell whether an object is
23977         root_types or not (that can be achieved by testing this ==
23978         root_types).  But to see if this is a top-level *class* (not
23979         necessarly our "toplevel" container). 
23980
23981 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23982
23983         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23984         parent instead of a direct call to GetType.
23985
23986 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23987
23988         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23989         Modifiers.TypeAttr. This should just be a call to that method.
23990
23991         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23992         object so that we can determine if we are top-level or not.
23993
23994         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23995         TypeContainer too.
23996
23997         * enum.cs (Enum::Define): Ditto.
23998
23999         * modifiers.cs (FieldAttr): Re-write.
24000
24001         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24002         (TypeContainer::HaveStaticConstructor): New property to provide access
24003         to precisely that info.
24004
24005         * modifiers.cs (MethodAttr): Re-write.
24006         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24007
24008         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24009         of top-level types as claimed.
24010
24011 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24012
24013         * expression.cs (MemberLookup): Fruitless attempt to lookup
24014         constructors.  Maybe I need to emit default constructors?  That
24015         might be it (currently .NET emits this for me automatically).
24016         (Invocation::OverloadResolve): Cope with Arguments == null.
24017         (Invocation::EmitArguments): new function, shared by the new
24018         constructor and us.
24019         (Invocation::Emit): Handle static and instance methods.  Emit
24020         proper call instruction for virtual or non-virtual invocations.
24021         (New::Emit): Implement.
24022         (New::Resolve): Implement.
24023         (MemberAccess:Resolve): Implement.
24024         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24025         to track instances.
24026         (FieldExpr::Resolve): Set type.
24027
24028         * support.cs: Handle empty arguments.
24029                 
24030         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24031         SimpleLookup): Auxiliary routines to help parse a qualifier
24032         identifier.  
24033
24034         Update qualifier_identifier rule.
24035
24036         * codegen.cs: Removed debugging messages.
24037
24038         * class.cs: Make this a global thing, this acts just as a "key" to
24039         objects that we might have around.
24040
24041         (Populate): Only initialize method_builders_to_methods once.
24042
24043         * expression.cs (PropertyExpr): Initialize type from the
24044         PropertyType. 
24045
24046         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24047         Resolve pattern.  Attempt to implicitly convert value to boolean.
24048         Emit code.
24049
24050         * expression.cs: Set the type for the int32/int32 argument case.
24051         (Binary::ResolveOperator): Set the return type to boolean for
24052         comparission operators
24053
24054         * typemanager.cs: Remove debugging print code.
24055
24056         (Invocation::Resolve): resolve type.
24057
24058         * class.cs: Allocate a MemberInfo of the correct size, as the code
24059         elsewhere depends on the test to reflect the correct contents.
24060
24061         (Method::) Keep track of parameters, due to System.Reflection holes
24062
24063         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24064         mapping here.
24065
24066         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24067         of the exact size and return that.
24068
24069         (Class::LookupMethodByBuilder): New function that maps
24070         MethodBuilders to its methods.  Required to locate the information
24071         on methods because System.Reflection bit us again.
24072
24073         * support.cs: New file, contains an interface ParameterData and
24074         two implementations: ReflectionParameters and InternalParameters
24075         used to access Parameter information.  We will need to grow this
24076         as required.
24077
24078         * expression.cs (Invocation::GetParameterData): implement a cache
24079         and a wrapper around the ParameterData creation for methods. 
24080         (Invocation::OverloadResolve): Use new code.
24081
24082 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24083
24084         * class.cs (TypeContainer::EmitField): Remove and move into 
24085         (Field::Define): here and modify accordingly.
24086         (Field.FieldBuilder): New member.
24087         (TypeContainer::Populate): Update accordingly.
24088         (TypeContainer::FindMembers): Implement.
24089
24090 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24091
24092         * statement.cs: (VariableInfo::VariableType): New field to be
24093         initialized with the full type once it is resolved. 
24094
24095 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24096
24097         * parameter.cs (GetParameterInfo): Use a type cache to compute
24098         things only once, and to reuse this information
24099
24100         * expression.cs (LocalVariableReference::Emit): Implement.
24101         (OpcodeCast::Emit): fix.
24102
24103         (ParameterReference::Resolve): Implement.
24104         (ParameterReference::Emit): Implement.
24105
24106         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24107         that are expressions need to stay as Expressions.
24108
24109         * typemanager.cs (CSharpName): Returns the C# name of a type if
24110         possible. 
24111
24112         * expression.cs (Expression::ConvertImplicit): New function that
24113         implements implicit type conversions.
24114
24115         (Expression::ImplicitReferenceConversion): Implements implicit
24116         reference conversions.
24117
24118         (EmptyCast): New type for transparent casts.
24119
24120         (OpcodeCast): New type for casts of types that are performed with
24121         a sequence of bytecodes.
24122
24123         (BoxedCast): New type used for casting value types into reference
24124         types.  Emits a box opcode.
24125
24126         (Binary::DoNumericPromotions): Implements numeric promotions of
24127         and computation of the Binary::Type.
24128
24129         (Binary::EmitBranchable): Optimization.
24130
24131         (Binary::Emit): Implement code emission for expressions.
24132
24133         * typemanager.cs (TypeManager): Added two new core types: sbyte
24134         and byte.
24135
24136 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24137
24138         * class.cs (TypeContainer::FindMembers): Method which does exactly
24139         what Type.FindMembers does, only we don't have to use reflection. No
24140         implementation yet.
24141
24142         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24143         typecontainer objects as we need to get at them.
24144         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24145
24146         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24147         typecontainer object.
24148
24149         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24150         of just a Report object.
24151
24152 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24153
24154         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24155         "remove_"
24156         (TypeContainer::Populate): Now define the delegates of the type too.
24157         (TypeContainer.Delegates): Property to access the list of delegates defined
24158         in the type.
24159
24160         * delegates.cs (Delegate::Define): Implement partially.
24161
24162         * modifiers.cs (TypeAttr): Handle more flags.
24163
24164 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24165
24166         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24167         and not <=
24168         (Operator::Define): Re-write logic to get types by using the LookupType method
24169         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24170         (Indexer::Define): Ditto.
24171         (Event::Define): Ditto.
24172         (Property::Define): Ditto.
24173
24174 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24175
24176         * class.cs (TypeContainer::Populate): Now define operators too. 
24177         (TypeContainer.Operators): New property to access the list of operators
24178         in a type.
24179         (Operator.OperatorMethodBuilder): New member to hold the method builder
24180         for the operator we are defining.
24181         (Operator::Define): Implement.
24182
24183 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24184
24185         * class.cs (Event::Define): Make the prefixes of the accessor methods
24186         addOn_ and removeOn_ 
24187
24188         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24189         of the location being passed in too. Ideally, this should go later since all
24190         error reporting should be done through the Report object.
24191
24192         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24193         (Populate): Iterate thru the indexers we have and define them too.
24194         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24195         for the get and set accessors.
24196         (Indexer::Define): Implement.
24197
24198 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24199
24200         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24201         my previous implementation, did not work.
24202
24203         * typemanager.cs: Add a couple of missing types (the longs).
24204
24205         * literal.cs: Use TypeManager.bool_type instead of getting it.
24206
24207         * expression.cs (EventExpr): New kind of expressions.
24208         (Expressio::ExprClassFromMemberInfo): finish
24209
24210 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24211
24212         * assign.cs: Emit stores to static fields differently.
24213
24214 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24215
24216         * Merge in changes and adjust code to tackle conflicts. Backed out my
24217         code in Assign::Resolve ;-) 
24218
24219 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24220
24221         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24222         instead Report.Error and also pass in the location.
24223         (CSharpParser::Lexer): New readonly property to return the reference
24224         to the Tokenizer object.
24225         (declare_local_variables): Use Report.Error with location instead of plain 
24226         old error.
24227         (CheckDef): Ditto.
24228
24229         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24230         (Operator.CheckBinaryOperator): Ditto.
24231
24232         * cs-parser.jay (operator_declarator): Update accordingly.
24233
24234         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24235         (CheckBinaryOperator): Same here.
24236
24237         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24238         on the name without any prefixes of namespace names etc. This is because we
24239         already might have something already fully qualified like 
24240         'System.Console.WriteLine'
24241
24242         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24243
24244 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24245
24246         * cs-tokenizer.cs (location): Return a string which also contains
24247         the file name.
24248
24249         * expression.cs (ElementAccess): New class for expressions of the
24250         type 'element access.'
24251         (BaseAccess): New class for expressions of the type 'base access.'
24252         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24253         respectively.
24254
24255         * cs-parser.jay (element_access): Implement action.
24256         (base_access): Implement actions.
24257         (checked_expression, unchecked_expression): Implement.
24258
24259         * cs-parser.jay (local_variable_type): Correct and implement.
24260         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24261
24262         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24263
24264         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24265         name and the specifiers.
24266
24267         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24268
24269         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24270         making them all public ;-)
24271
24272         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24273         class anyways.
24274
24275 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24276
24277         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24278         PropertyExprs.
24279         (FieldExpr, PropertyExprs): New resolved expressions.
24280         (SimpleName::MemberStaticCheck): Perform static checks for access
24281         to non-static fields on static methods. Maybe this should be
24282         generalized for MemberAccesses. 
24283         (SimpleName::ResolveSimpleName): More work on simple name
24284         resolution. 
24285
24286         * cs-parser.jay (primary_expression/qualified_identifier): track
24287         the parameter index.
24288
24289         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24290         (EmitContext::EmitBoolExpression): Chain to expression generation
24291         instead of temporary hack.
24292         (::EmitStatementExpression): Put generic expression code generation.
24293
24294         * assign.cs (Assign::Emit): Implement variable assignments to
24295         local variables, parameters and fields.
24296
24297 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24298
24299         * statement.cs (Block::GetVariableInfo): New method, returns the
24300         VariableInfo for a variable name in a block.
24301         (Block::GetVariableType): Implement in terms of GetVariableInfo
24302
24303         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24304         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24305
24306 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24307
24308         * cs-parser.jay (operator_declaration): Continue on my quest : update
24309         to take attributes argument.
24310         (event_declaration): Ditto.
24311         (enum_declaration): Ditto.
24312         (indexer_declaration): Ditto.
24313
24314         * class.cs (Operator::Operator): Update constructor accordingly.
24315         (Event::Event): Ditto.
24316
24317         * delegate.cs (Delegate::Delegate): Same here.
24318
24319         * enum.cs (Enum::Enum): Same here.
24320
24321 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24322
24323         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24324
24325         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24326
24327         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24328         being passed around as an arraylist.
24329         (Attributes::AddAttribute): Method to add attribute sections.
24330
24331         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24332         (struct_declaration): Update accordingly.
24333         (constant_declaration): Update.
24334         (field_declaration): Update.
24335         (method_header): Update.
24336         (fixed_parameter): Update.
24337         (parameter_array): Ditto.
24338         (property_declaration): Ditto.
24339         (destructor_declaration): Ditto.
24340
24341         * class.cs (Struct::Struct): Update constructors accordingly.
24342         (Class::Class): Ditto.
24343         (Field::Field): Ditto.
24344         (Method::Method): Ditto.
24345         (Property::Property): Ditto.
24346         (TypeContainer::OptAttribute): update property's return type.
24347
24348         * interface.cs (Interface.opt_attributes): New member.
24349         (Interface::Interface): Update to take the extra Attributes argument.
24350
24351         * parameter.cs (Parameter::Parameter): Ditto.
24352
24353         * constant.cs (Constant::Constant): Ditto.
24354
24355         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24356         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24357         the attributes as a parameter.
24358         (InterfaceProperty): Update constructor call.
24359         (InterfaceEvent): Ditto.
24360         (InterfaceMethod): Ditto.
24361         (InterfaceIndexer): Ditto.
24362
24363         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24364         pass the attributes too.
24365         (interface_event_declaration): Ditto.
24366         (interface_property_declaration): Ditto.
24367         (interface_method_declaration): Ditto.
24368         (interface_declaration): Ditto.
24369
24370 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24371
24372         * class.cs (Method::Define): Track the "static Main" definition to
24373         create an entry point. 
24374
24375         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24376         EntryPoint if we find it. 
24377
24378         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24379         (EmitContext::ig): Make this variable public.
24380
24381         * driver.cs: Make the default output file be the first file name
24382         with the .exe extension.  
24383
24384         Detect empty compilations
24385
24386         Handle various kinds of output targets.  Handle --target and
24387         rename -t to --dumper.
24388
24389         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24390         methods inherited from Expression return now an Expression.  This
24391         will is used during the tree rewriting as we resolve them during
24392         semantic analysis.
24393
24394         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24395         the spec.  Missing entirely is the information about
24396         accessability of elements of it.
24397
24398         (Expression::ExprClassFromMemberInfo): New constructor for
24399         Expressions that creates a fully initialized Expression based on
24400         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24401         a Type.
24402
24403         (Invocation::Resolve): Begin implementing resolution of invocations.
24404
24405         * literal.cs (StringLiteral):  Implement Emit.
24406
24407 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24408
24409         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24410         member.
24411
24412 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24413
24414         * cs-parser.jay (attribute_arguments): Implement actions.
24415         (attribute): Fix bug in production. Implement action.
24416         (attribute_list): Implement.
24417         (attribute_target): Implement.
24418         (attribute_target_specifier, opt_target_specifier): Implement
24419         (CheckAttributeTarget): New method to check if the attribute target
24420         is valid.
24421         (attribute_section): Implement.
24422         (opt_attributes): Implement.
24423
24424         * attribute.cs : New file to handle attributes.
24425         (Attribute): Class to hold attribute info.
24426
24427         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24428         (attribute_section): Modify production to use 2 different rules to 
24429         achieve the same thing. 1 s/r conflict down !
24430         Clean out commented, useless, non-reducing dimension_separator rules.
24431
24432         * class.cs (TypeContainer.attributes): New member to hold list
24433         of attributes for a type.
24434         (Struct::Struct): Modify to take one more argument, the attribute list.
24435         (Class::Class): Ditto.
24436         (Field::Field): Ditto.
24437         (Method::Method): Ditto.
24438         (Property::Property): Ditto.
24439
24440         * cs-parser.jay (struct_declaration): Update constructor call to
24441         pass in the attributes too.
24442         (class_declaration): Ditto.
24443         (constant_declaration): Ditto.
24444         (field_declaration): Ditto.
24445         (method_header): Ditto.
24446         (fixed_parameter): Ditto.
24447         (parameter_array): Ditto.
24448         (property_declaration): Ditto.
24449
24450         * constant.cs (Constant::Constant): Update constructor similarly.
24451         Use System.Collections.
24452
24453         * parameter.cs (Parameter::Parameter): Update as above.
24454
24455 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24456
24457         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24458         (TypeContainer.delegates): New member to hold list of delegates.
24459
24460         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24461         this time as I seem to be on crack ;-)
24462
24463 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24464
24465         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24466         tell whether an identifier represents a namespace.
24467
24468         * expression.cs (NamespaceExpr): A namespace expression, used only
24469         temporarly during expression resolution.
24470         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24471         utility functions to resolve names on expressions.
24472
24473 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24474
24475         * codegen.cs: Add hook for StatementExpressions. 
24476
24477         * class.cs: Fix inverted test for static flag in methods.
24478
24479 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24480
24481         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24482         to make it coincide with MS' number.
24483         (Operator::CheckBinaryOperator): Ditto.
24484
24485         * ../errors/errors.txt : Remove error numbers added earlier.
24486
24487         * ../errors/cs1019.cs : Test case for error # 1019
24488
24489         * ../errros/cs1020.cs : Test case for error # 1020
24490
24491         * cs-parser.jay : Clean out commented cruft.
24492         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24493         used anywhere - non-reducing rule.
24494         (namespace_declarations): Non-reducing rule - comment out.
24495
24496         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24497         with TypeContainer::AddEnum.
24498
24499         * delegate.cs : New file for delegate handling classes.
24500         (Delegate): Class for declaring delegates.
24501
24502         * makefile : Update.
24503
24504         * cs-parser.jay (delegate_declaration): Implement.
24505
24506 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24507
24508         * class.cs (Event::Define): Implement.
24509         (Event.EventBuilder): New member.
24510
24511         * class.cs (TypeContainer::Populate): Update to define all enums and events
24512         we have.
24513         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24514         readonly fields for all these cases ?
24515
24516 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24517
24518         * class.cs (Property): Revamp to use the convention of making fields readonly.
24519         Accordingly modify code elsewhere.
24520
24521         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24522         the Define method of the Property class.
24523
24524         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24525         trivial bug.
24526         (TypeContainer::Populate): Update to define all the properties we have. Also
24527         define all enumerations.
24528
24529         * enum.cs (Define): Implement.
24530
24531 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24532
24533         * cs-parser.jay (overloadable_operator): The semantic value is an
24534         enum of the Operator class.
24535         (operator_declarator): Implement actions.
24536         (operator_declaration): Implement.
24537
24538         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24539         validity of definitions.
24540         (Operator::CheckBinaryOperator): Static method to check for binary operators
24541         (TypeContainer::AddOperator): New method to add an operator to a type.
24542
24543         * cs-parser.jay (indexer_declaration): Added line to actually call the
24544         AddIndexer method so it gets added ;-)
24545
24546         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24547         already taken care of by the MS compiler ?  
24548
24549 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24550
24551         * class.cs (Operator): New class for operator declarations.
24552         (Operator::OpType): Enum for the various operators.
24553
24554 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24555
24556         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24557         ostensibly handle this in semantic analysis.
24558
24559         * cs-parser.jay (general_catch_clause): Comment out
24560         (specific_catch_clauses, specific_catch_clause): Ditto.
24561         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24562         (catch_args, opt_catch_args): New productions.
24563         (catch_clause): Rewrite to use the new productions above
24564         (catch_clauses): Modify accordingly.
24565         (opt_catch_clauses): New production to use in try_statement
24566         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24567         and re-write the code in the actions to extract the specific and
24568         general catch clauses by being a little smart ;-)
24569
24570         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24571         Hooray, try and catch statements parse fine !
24572
24573 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24574
24575         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24576         string from the hashtable of variables.
24577
24578         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24579         I end up making that mistake ;-)
24580         (catch_clauses): Fixed gross error which made Key and Value of the 
24581         DictionaryEntry the same : $1 !!
24582
24583 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24584
24585         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24586
24587         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24588         when the add and remove accessors are specified. 
24589
24590 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24591
24592         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24593         information about indexer_declarator.
24594         (indexer_declarator): Implement actions.
24595         (parsing_indexer): New local boolean used to keep track of whether
24596         we are parsing indexers or properties. This is necessary because 
24597         implicit_parameters come into picture even for the get accessor in the 
24598         case of an indexer.
24599         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24600
24601         * class.cs (Indexer): New class for indexer declarations.
24602         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24603         (TypeContainer::indexers): New member to hold list of indexers for the
24604         type.
24605
24606 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24607
24608         * cs-parser.jay (add_accessor_declaration): Implement action.
24609         (remove_accessor_declaration): Implement action.
24610         (event_accessors_declaration): Implement
24611         (variable_declarators): swap statements for first rule - trivial.
24612
24613         * class.cs (Event): New class to hold information about event
24614         declarations.
24615         (TypeContainer::AddEvent): New method to add an event to a type
24616         (TypeContainer::events): New member to hold list of events.
24617
24618         * cs-parser.jay (event_declaration): Implement actions.
24619
24620 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24621
24622         * cs-parser.jay (dim_separators): Implement. Make it a string
24623         concatenating all the commas together, just as they appear.
24624         (opt_dim_separators): Modify accordingly
24625         (rank_specifiers): Update accordingly. Basically do the same
24626         thing - instead, collect the brackets here.
24627         (opt_rank_sepcifiers): Modify accordingly.
24628         (array_type): Modify to actually return the complete type string
24629         instead of ignoring the rank_specifiers.
24630         (expression_list): Implement to collect the expressions
24631         (variable_initializer): Implement. We make it a list of expressions
24632         essentially so that we can handle the array_initializer case neatly too.
24633         (variable_initializer_list): Implement.
24634         (array_initializer): Make it a list of variable_initializers
24635         (opt_array_initializer): Modify accordingly.
24636
24637         * expression.cs (New::NType): Add enumeration to help us
24638         keep track of whether we have an object/delegate creation
24639         or an array creation.
24640         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24641         members to hold data about array creation.
24642         (New:New): Modify to update NewType
24643         (New:New): New Overloaded contructor for the array creation
24644         case.
24645
24646         * cs-parser.jay (array_creation_expression): Implement to call
24647         the overloaded New constructor.
24648
24649 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24650
24651         * class.cs (TypeContainer::Constructors): Return member
24652         constructors instead of returning null.
24653
24654 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24655
24656         * typemanager.cs (InitCoreTypes): Initialize the various core
24657         types after we have populated the type manager with the user
24658         defined types (this distinction will be important later while
24659         compiling corlib.dll)
24660
24661         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24662         on Expression Classification.  Now all expressions have a method
24663         `Resolve' and a method `Emit'.
24664
24665         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24666         generation from working.     Also add some temporary debugging
24667         code. 
24668
24669 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24670
24671         * codegen.cs: Lots of code generation pieces.  This is only the
24672         beginning, will continue tomorrow with more touches of polish.  We
24673         handle the fundamentals of if, while, do, for, return.  Others are
24674         trickier and I need to start working on invocations soon.
24675
24676         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24677         s.InitStatement. 
24678
24679         * codegen.cs (EmitContext): New struct, used during code
24680         emission to keep a context.   Most of the code generation will be
24681         here. 
24682
24683         * cs-parser.jay: Add embedded blocks to the list of statements of
24684         this block.  So code generation proceeds in a top down fashion.
24685
24686 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24687
24688         * statement.cs: Add support for multiple child blocks.
24689
24690 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24691
24692         * codegen.cs (EmitCode): New function, will emit the code for a
24693         Block of code given a TypeContainer and its ILGenerator. 
24694
24695         * statement.cs (Block): Standard public readonly optimization.
24696         (Block::Block constructors): Link children. 
24697         (Block::Child): Child Linker.
24698         (Block::EmitVariables): Emits IL variable declarations.
24699
24700         * class.cs: Drop support for MethodGroups here, delay until
24701         Semantic Analysis.
24702         (Method::): Applied the same simplification that I did before, and
24703         move from Properties to public readonly fields.
24704         (Method::ParameterTypes): Returns the parameter types for the
24705         function, and implements a cache that will be useful later when I
24706         do error checking and the semantic analysis on the methods is
24707         performed.
24708         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24709         and made a method, optional argument tells whether this is a class
24710         or a structure to apply the `has-this' bit.
24711         (Method::GetCallingConvention): Implement, returns the calling
24712         convention. 
24713         (Method::Define): Defines the type, a second pass is performed
24714         later to populate the methods.
24715
24716         (Constructor::ParameterTypes): implement a cache similar to the
24717         one on Method::ParameterTypes, useful later when we do semantic
24718         analysis. 
24719
24720         (TypeContainer::EmitMethod):  New method.  Emits methods.
24721
24722         * expression.cs: Removed MethodGroup class from here.
24723
24724         * parameter.cs (Parameters::GetCallingConvention): new method.
24725
24726 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24727
24728         * class.cs (TypeContainer::Populate): Drop RootContext from the
24729         argument. 
24730
24731         (Constructor::CallingConvention): Returns the calling convention.
24732         (Constructor::ParameterTypes): Returns the constructor parameter
24733         types. 
24734
24735         (TypeContainer::AddConstructor): Keep track of default constructor
24736         and the default static constructor.
24737
24738         (Constructor::) Another class that starts using `public readonly'
24739         instead of properties. 
24740
24741         (Constructor::IsDefault): Whether this is a default constructor. 
24742
24743         (Field::) use readonly public fields instead of properties also.
24744
24745         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24746         track of static constructors;  If none is used, turn on
24747         BeforeFieldInit in the TypeAttributes. 
24748
24749         * cs-parser.jay (opt_argument_list): now the return can be null
24750         for the cases where there are no arguments. 
24751
24752         (constructor_declarator): If there is no implicit `base' or
24753         `this', then invoke the default parent constructor. 
24754
24755         * modifiers.cs (MethodAttr): New static function maps a set of
24756         modifiers flags into a MethodAttributes enum
24757         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24758         MethodAttr, TypeAttr to represent the various mappings where the
24759         modifiers are used.
24760         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24761
24762 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24763
24764         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24765         method arguments.
24766
24767         * interface.cs (PopulateIndexer): Implemented the code generator
24768         for interface indexers.
24769
24770 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24771
24772         * interface.cs (InterfaceMemberBase): Now we track the new status
24773         here.  
24774
24775         (PopulateProperty): Implement property population.  Woohoo!  Got
24776         Methods and Properties going today. 
24777
24778         Removed all the properties for interfaces, and replaced them with
24779         `public readonly' fields. 
24780
24781 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24782
24783         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24784         initialize their hashtables/arraylists only when they are needed
24785         instead of doing this always.
24786
24787         * parameter.cs: Handle refs and out parameters.
24788
24789         * cs-parser.jay: Use an ArrayList to construct the arguments
24790         instead of the ParameterCollection, and then cast that to a
24791         Parameter[] array.
24792
24793         * parameter.cs: Drop the use of ParameterCollection and use
24794         instead arrays of Parameters.
24795
24796         (GetParameterInfo): Use the Type, not the Name when resolving
24797         types. 
24798
24799 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24800
24801         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24802         and instead use public readonly fields.
24803
24804         * class.cs: Put back walking code for type containers.
24805
24806 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24807
24808         * class.cs (MakeConstant): Code to define constants.
24809
24810         * rootcontext.cs (LookupType): New function.  Used to locate types 
24811
24812
24813 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24814
24815         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24816         this System.Reflection code is.  Kudos to Microsoft
24817
24818         * typemanager.cs: Implement a type cache and avoid loading all
24819         types at boot time.  Wrap in LookupType the internals.  This made
24820         the compiler so much faster.  Wow.  I rule!
24821
24822         * driver.cs: Make sure we always load mscorlib first (for
24823         debugging purposes, nothing really important).
24824
24825         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24826         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24827
24828         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24829         on namespaces that have been imported using the `using' keyword.
24830
24831         * class.cs (TypeContainer::TypeAttr): Virtualize.
24832         (Class::TypeAttr): Return attributes suitable for this bad boy.
24833         (Struct::TypeAttr): ditto.
24834         Handle nested classes.
24835         (TypeContainer::) Remove all the type visiting code, it is now
24836         replaced with the rootcontext.cs code
24837
24838         * rootcontext.cs (GetClassBases): Added support for structs. 
24839
24840 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24841
24842         * interface.cs, statement.cs, class.cs, parameter.cs,
24843         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24844         Drop use of TypeRefs, and use strings instead.
24845
24846 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24847
24848         * rootcontext.cs: 
24849
24850         * class.cs (Struct::Struct): set the SEALED flags after
24851         checking the modifiers.
24852         (TypeContainer::TypeAttr): new property, returns the
24853         TypeAttributes for a class.  
24854
24855         * cs-parser.jay (type_list): Oops, list production was creating a
24856         new list of base types.
24857
24858         * rootcontext.cs (StdLib): New property.
24859         (GetInterfaceTypeByName): returns an interface by type name, and
24860         encapsulates error handling here.
24861         (GetInterfaces): simplified.
24862         (ResolveTree): Encapsulated all the tree resolution here.
24863         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24864         types. 
24865
24866         * driver.cs: Add support for --nostdlib, to avoid loading the
24867         default assemblies.
24868         (Main): Do not put tree resolution here. 
24869
24870         * rootcontext.cs: Beginning of the class resolution.
24871
24872 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24873
24874         * rootcontext.cs: Provide better error reporting. 
24875
24876         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24877
24878         * rootcontext.cs (CreateInterface): Handle the case where there
24879         are no parent interfaces.
24880
24881         (CloseTypes): Routine to flush types at the end.
24882         (CreateInterface): Track types.
24883         (GetInterfaces): Returns an array of Types from the list of
24884         defined interfaces.
24885
24886         * typemanager.c (AddUserType): Mechanism to track user types (puts
24887         the type on the global type hash, and allows us to close it at the
24888         end). 
24889
24890 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24891
24892         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24893         RecordInterface instead.
24894
24895         * cs-parser.jay: Updated to reflect changes above.
24896
24897         * decl.cs (Definition): Keep track of the TypeBuilder type that
24898         represents this type here.  Not sure we will use it in the long
24899         run, but wont hurt for now.
24900
24901         * driver.cs: Smaller changes to accomodate the new code.
24902
24903         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24904         when done. 
24905
24906         * rootcontext.cs (CreateInterface):  New method, used to create
24907         the System.TypeBuilder type for interfaces.
24908         (ResolveInterfaces): new entry point to resolve the interface
24909         hierarchy. 
24910         (CodeGen): Property, used to keep track of the code generator.
24911
24912 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24913
24914         * cs-parser.jay: Add a second production for delegate_declaration
24915         with `VOID'.
24916
24917         (enum_body): Put an opt_comma here instead of putting it on
24918         enum_body or enum_member_declarations so we can handle trailing
24919         commas on enumeration members.  Gets rid of a shift/reduce.
24920
24921         (type_list): Need a COMMA in the middle.
24922
24923         (indexer_declaration): Tell tokenizer to recognize get/set
24924
24925         * Remove old targets.
24926
24927         * Re-add the parser target.
24928
24929 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24930
24931         * cs-parser.jay: Add precendence rules for a number of operators
24932         ot reduce the number of shift/reduce conflicts in the grammar.
24933
24934 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24935
24936         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24937         and put it here.
24938
24939         Get rid of old crufty code.
24940
24941         * rootcontext.cs: Use this to keep track of the parsed
24942         representation and the defined types available to the program. 
24943
24944         * gen-treedump.cs: adjust for new convention.
24945
24946         * type.cs: Split out the type manager, and the assembly builder
24947         from here. 
24948
24949         * typemanager.cs: the type manager will live here now.
24950
24951         * cil-codegen.cs: And the code generator here. 
24952
24953 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24954
24955         * makefile: Fixed up for easy making.
24956
24957 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24958
24959         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24960         the 
24961
24962         (unary_expression): Expand pre_increment_expression and
24963         post_decrement_expression to reduce a shift/reduce.
24964
24965 2001-07-11  Simon Cozens
24966
24967         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24968
24969         Improve allow_keyword_as_indent name.
24970
24971 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24972
24973         * Adjustments for Beta2. 
24974
24975 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24976
24977         * decl.cs: Added `Define' abstract method.
24978         (InTransit): new property, used to catch recursive definitions. 
24979
24980         * interface.cs: Implement `Define'. 
24981
24982         * modifiers.cs: Map Modifiers.constants to
24983         System.Reflection.TypeAttribute flags.
24984
24985         * class.cs: Keep track of types and user-defined types.
24986         (BuilderInit): New method for creating an assembly
24987         (ResolveType): New function to launch the resolution process, only
24988         used by interfaces for now.
24989
24990         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24991         that are inserted into the name space. 
24992
24993 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24994
24995         * ARGH.  I have screwed up my tree so many times due to the use of
24996         rsync rather than using CVS.  Going to fix this at once. 
24997
24998         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24999         load types.
25000
25001 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25002
25003         * Experiment successful: Use System.Type rather that our own
25004         version of Type.  
25005
25006 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25007
25008         * cs-parser.jay: Removed nsAliases from here.
25009
25010         Use new namespaces, handle `using XXX;' 
25011
25012         * namespace.cs: Reimplemented namespace handling, use a recursive
25013         definition of the class.  Now we can keep track of using clauses
25014         and catch invalid using clauses.
25015
25016 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * gen-treedump.cs: Adapted for all the renaming.
25019
25020         * expression.cs (Expression): this class now has a Type property
25021         which returns an expression Type.
25022
25023         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25024         `Type', as this has a different meaning now in the base
25025
25026 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25027
25028         * interface.cs, class.cs: Removed from all the sources the
25029         references to signature computation, as we can not do method
25030         signature computation during the parsing time, as we are not
25031         trying to solve at that point distinguishing:
25032
25033         class X {
25034                 void a (Blah x) {}
25035                 void a (NS.Blah x) {}
25036         }
25037
25038         Which depending on the context might be valid or not, as we do not
25039         know if Blah is the same thing as NS.Blah at that point.
25040
25041         * Redid everything so the code uses TypeRefs now instead of
25042         Types.  TypeRefs are just temporary type placeholders, that need
25043         to be resolved.  They initially have a pointer to a string and the
25044         current scope in which they are used.  This is used later by the
25045         compiler to resolve the reference to an actual Type. 
25046
25047         * DeclSpace is no longer a CIR.Type, and neither are
25048         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25049         are all DeclSpaces, but no Types. 
25050
25051         * type.cs (TypeRefManager): This implements the TypeRef manager,
25052         which keeps track of all the types that need to be resolved after
25053         the parsing has finished. 
25054
25055 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25056
25057         * ARGH.  We are going to have to store `foreach' as a class rather
25058         than resolving it, as we need to verify error 1579 after name
25059         resolution.   *OR* we could keep a flag that says `This request to
25060         IEnumerator comes from a foreach statement' which we can then use
25061         to generate the error.
25062
25063 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25064
25065         * class.cs (TypeContainer.AddMethod): we now add methods to the
25066         MethodGroup instead of the method hashtable.  
25067
25068         * expression.cs: Add MethodGroup abstraction, which gets us one
25069         step closer to the specification in the way we handle method
25070         declarations.  
25071
25072         * cs-parser.jay (primary_expression): qualified_identifier now
25073         tried to match up an identifier to a local variable reference or
25074         to a parameter reference.
25075
25076         current_local_parameters is now a parser global variable that
25077         points to the current parameters for the block, used during name
25078         lookup.
25079
25080         (property_declaration): Now creates an implicit `value' argument to
25081         the set accessor.
25082
25083 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25084
25085         * parameter.cs: Do not use `param' arguments as part of the
25086         signature, per the spec.
25087
25088 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25089
25090         * decl.cs: Base class for classes, structs and interfaces.  This
25091         is the "Declaration Space" 
25092
25093         * cs-parser.jay: Use CheckDef for checking declaration errors
25094         instead of having one on each function.
25095
25096         * class.cs: Factor out some code for handling error handling in
25097         accordance to the "Declarations" section in the "Basic Concepts"
25098         chapter in the ECMA C# spec.
25099
25100         * interface.cs: Make all interface member classes derive from
25101         InterfaceMemberBase.
25102
25103 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25104
25105         * Many things: all interfaces are parsed and generated in
25106         gen-treedump.  Support for member variables, constructors,
25107         destructors, properties, constants is there.
25108
25109         Beginning of the IL backend, but very little done, just there for
25110         testing purposes. 
25111
25112 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25113
25114         * cs-parser.jay: Fix labeled statement.
25115
25116         * cs-tokenizer.cs (escape): Escape " and ' always.
25117         ref_line, ref_name: keep track of the line/filename as instructed
25118         by #line by the compiler.
25119         Parse #line.
25120
25121 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25122
25123         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25124         to match the values in System.CodeDOM.
25125
25126         Divid renamed to Divide.
25127
25128         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25129         statements. 
25130         (Statements.set): remove.
25131
25132         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25133         statements. 
25134
25135         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25136         falseStatements always have valid values. 
25137
25138         * cs-parser.jay: Use System.CodeDOM now.
25139