2009-06-16 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2009-06-16  Marek Safar  <marek.safar@gmail.com>
2
3         * driver.cs: Close resource handlers.
4
5 2009-06-12  Jb Evain  <jbevain@novell.com>
6
7         * rootcontext.cs: add a Platform field.
8         * driver.cs: handle /platform.
9         * codegen.cs: pass the proper flags according to
10         the platform when saving the assembly.
11
12 2009-06-11  Marek Safar  <marek.safar@gmail.com>
13
14         * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
15         Add optional parameters grammar.
16
17 2009-06-10  Marek Safar  <marek.safar@gmail.com>
18
19         * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
20         driver.cs: Split lang version and metadata version.
21
22 2009-06-10  Marek Safar  <marek.safar@gmail.com>
23
24         * decl.cs: Better overload ctor collision error message.
25
26 2009-06-05  Jb Evain  <jbevain@novell.com>
27
28         * driver.cs (EmbededResource): avoid using an internal method
29         in gmcs to embed manifest resources.
30
31 2009-06-04  Sebastien Pouliot  <sebastien@ximian.com>
32
33         * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
34         the compiler from older mono versions (like moon's bots)
35
36 2009-06-04  Marek Safar  <marek.safar@gmail.com>
37
38         * namespace.cs (LookupTypeReflection): Ignore collisions between
39         forwarded types.
40
41 2009-06-04  Marek Safar  <marek.safar@gmail.com>
42
43         * codegen.cs: Enabled generic type forwarders.
44
45 2009-06-04  Marek Safar  <marek.safar@gmail.com>
46
47         * dmcs.*: Add another version of SRE compiler.
48
49 2009-06-03  Marek Safar  <marek.safar@gmail.com>
50
51         * generic.cs, typemanager.cs, parameter.cs, convert.cs,
52         generic-mcs.cs: Fixed variant type conversions.
53
54 2009-06-02  Marek Safar  <marek.safar@gmail.com>
55
56         A fix for bug #507863
57         * codegen.cs: Fixes a crash on invalid string value attribute.
58
59 2009-06-01  Marek Safar  <marek.safar@gmail.com>
60
61         A fix for bug #508334
62         * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
63         cs-parser.jay: Fully import __arglist modifier.
64
65 2009-05-29  Marek Safar  <marek.safar@gmail.com>
66
67         * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
68         delegate.cs, generic-mcs.cs: Rewrote type variance checks to
69         actually work with closed generic types.
70
71 2009-05-27  Alan McGovern  <amcgovern@novell.com>
72
73         * class.cs, decl.cs, delegate.cs, parameter.cs: 
74         Fix the build by replacing the use of 'var' with the actual type.
75
76 2009-05-27  Marek Safar  <marek.safar@gmail.com>
77
78         * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
79     cs-parser.jay, generic-mcs.cs: Report wrong variant types
80         declarations.
81           
82         * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
83         filter.
84
85 2009-05-26  Rodrigo Kumpera  <rkumpera@novell.com>
86                         Marek Safar  <marek.safar@gmail.com>
87
88         A fix for bug #377509
89         * parameter.cs: Use predefined and not empty name for implicit
90         setters.
91
92 2009-05-21  Marek Safar  <marek.safar@gmail.com>
93
94         * class.cs: Don't report wrong warnings for event fields.
95
96 2009-05-21  Marek Safar  <marek.safar@gmail.com>
97
98         A fix for bug #504667
99         * class.cs: Check for static class using parent container instead of
100         parent type.
101
102 2009-05-08  Marek Safar  <marek.safar@gmail.com>
103
104         A fix for bug #496922
105         * expression.cs: Always use temporary variable when using object
106         initializer.
107
108 2009-04-28  Marek Safar  <marek.safar@gmail.com>
109
110         A fix for bug #495112
111         * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
112         local cache.
113
114 2009-04-27  Miguel de Icaza  <miguel@novell.com>
115
116         * driver.cs: Add a flag to work as a replacement for CSC in VS.
117
118 2009-04-24  Miguel de Icaza  <miguel@novell.com>
119
120         * complete.cs: No idea how gonzalo got a null in the list, but
121         avoid crashing.
122
123 2009-04-24  Miguel de Icaza  <miguel@novell.com>
124
125         * complete.cs (CompletionElementInitializer): New completion class
126         to support completing inside a C# 3 element initializer, so this
127         allows completion for Silverlight situations where it is very
128         common to do:
129
130         new TextBlock () { Fo<TAB>
131
132         (CompletionSimpleName): Expose the prefix that was
133         passed to the simple name.
134
135         * cs-parser.jay (object_or_collection_initializer): Add support
136         for element_initializers.
137
138         * expression.cs (CollectionOrObjectInitializers.DoResolve):
139         special case completion expressions as this method aggressively
140         collects data before it operates, and errors were being thrown
141         earlier than we were able to complete.
142
143 2009-04-23  Miguel de Icaza  <miguel@novell.com>
144
145         * eval.cs: Make getcompletions silent and enable debugging output
146         if the -v option is passed.
147
148         * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
149         Consider looking up the namespace that matches the prefix being
150         used. 
151
152         This is part of the support for allowing completions like:
153         `System.Co<TAB>' to complete to System.Console.
154
155         * complete.cs (CompletionSimpleName.AppendResults): Make this
156         routine reusable.
157
158 2009-04-21  Raja R Harinath  <harinath@hurrynot.org>
159
160         * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
161         COMPLETE_COMPLETION as internal.
162
163 2009-04-17  Miguel de Icaza  <miguel@novell.com>
164
165         * complete.cs: Include namespace resolution in simple names as
166         well as global types and types in the using scope in the
167         resolution. 
168
169         * namespace.cs: Supporting infrastrcture to provide completions
170         based on the current using scope. 
171
172         * eval.cs: Introduce an entry point that allows for initialization
173         to return a list of the files passed on the command line.
174
175 2009-04-14  Marek Safar  <marek.safar@gmail.com>
176
177         A fix for bug #494243
178         * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
179
180 2009-04-13  Marek Safar  <marek.safar@gmail.com>
181
182         A fix for bug #493887
183         * statement.cs: Don't skip string multi-section with default or
184         null label when populating string hashtable.
185
186 2009-04-06  Marek Safar  <marek.safar@gmail.com>
187
188         A fix for bug #492329
189         * expression.cs (New): Load variable when assigning type parameter
190         to ref variable.
191
192 2009-04-06  Marek Safar  <marek.safar@gmail.com>
193
194         A fix for bug #488960
195         * decl.cs: Compare MVAR types using non-null values.
196
197 2009-03-27  Marek Safar  <marek.safar@gmail.com>
198
199         * typemanager.cs, expression.cs: Removed unused nullable checks.
200
201 2009-03-27  Marek Safar  <marek.safar@gmail.com>
202
203         * *.cs: Removed some gmcs conditionals.
204
205 2009-03-26  Marek Safar  <marek.safar@gmail.com>
206
207         * generic.cs, support.cs: Moved generics stuff out of support.cs
208
209 2009-03-24  Marek Safar  <marek.safar@gmail.com>
210
211         * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
212         DeclaringType.
213
214 2009-03-23  Marek Safar  <marek.safar@gmail.com>
215
216         * attribute.cs: Consider all members for error reporting when
217         checking named arguments.
218
219 2009-03-23  Marek Safar  <marek.safar@gmail.com>
220
221         A fix for bug #487625
222         * namespace.cs: Use a warning for all predefined type conflicts.
223
224 2009-03-23  Marek Safar  <marek.safar@gmail.com>
225
226         A fix for bug #485706
227         * statement.cs: Explicitly type catch type argument to pass verifier
228         check.
229
230 2009-03-22  Miguel de Icaza  <miguel@novell.com>
231
232         Initial support to provide code completion facilities to consumers
233         of the evaluator API.
234         
235         * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
236         support the completion engine.   When we reach the end of the
237         input stream instead of returning EOF, when this flag is true the
238         tokenizer instead produces:
239
240                 One GENERATE_COMPLETION token: this token then must be
241                 handled in the grammar at every point where the user
242                 would likely request a completion.
243
244                 As many COMPLETE_COMPLETION tokens as necessary.   These
245                 tokens are generated to assist the parser in unwinding and
246                 producing a valid parse tree.    
247
248         The parser rules do not have to be perfect, the parser needs to be
249         augmented with judicious use of GENERATE_COMPLETION tokens to
250         improve the areas where we can provide completion and the parser
251         needs to add support for COMPLETE_COMPLETION tokens in productions
252         to make them work.
253
254         It is common to not have enough support for COMPLETE_COMPLETION
255         under certain rules and that even if we generated the
256         GENERATE_COMPLETION token that the resulting tree will be invalid
257         due to the missing rules that support COMPLETE_COMPLETION.
258
259         The final EOF token is produced by having the parser notify the
260         tokenizer when it reaches the root production that the next token
261         should be EOF.
262
263         * support.cs (CompletionResult): New Exception.   This exception
264         is thrown to return the completion results when one of the special
265         completion expressions is reached.
266
267         This exception is thrown by the completing ExpressionStatements
268         classes that live in complete.cs
269
270         * complete.cs (CompletingExpression): a new base class for
271         completing expressions.   This derives from the
272         ExpressionStatement class and not from Expression as it allows
273         completion to happen not only where expressions are expected in
274         the grammar, but also where statements are expected.
275
276         (CompletionSimpleName): A new class used to provide completions
277         for SimpleNames.     This currently only resolves to local
278         variables from the evaluator context (GetVars call).
279
280         (CompletionMemberAccess): Implements support for completing member
281         access patterns. 
282
283         * cs-parser.jay: Add support for completion in a few places. 
284
285         * eval.cs (GetCompletions): New public API for the evaluator that
286         returns a list of possible completions given the input.   The
287         return value is an array of completions 
288
289         * anonymous.cs (Compatible): If the exception thrown from the
290         resolved expression is a CompletionResult exception let that one
291         through instead of printing a diagnostic error in the try/catch. 
292 <       
293 2009-03-22  Miguel de Icaza  <miguel@novell.com>
294
295         * 
296
297         * driver.cs (Main): Use Environment.Exit to quit quickly and
298         prevent the compiler from doing the usual wait for helper thread
299         to terminate.  
300
301         This is to prevent a slowdown that was reported by Gonzalo on
302         ASP.NET 
303
304 2009-03-19  Marek Safar  <marek.safar@gmail.com>
305
306         * ecore.cs: Load build-in types directly instead of accessing
307         an internal field.
308
309 2009-03-18  Marek Safar  <marek.safar@gmail.com>
310
311         * ecore.cs: Always use unbox.any when available.
312
313 2009-03-18  Marek Safar  <marek.safar@gmail.com>
314
315         * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
316
317 2009-03-17  Marek Safar  <marek.safar@gmail.com>
318
319         * generic.cs: Removed obsolete version of type inference.
320
321 2009-03-16  Marek Safar  <marek.safar@gmail.com>
322
323         * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
324         expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
325         delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
326         attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
327
328 2009-03-11  Marek Safar  <marek.safar@gmail.com>
329
330         A fix for bug #482996
331         * anonymous.cs: Make sure we are not infering return type when
332         checking type compatibility.
333
334 2009-03-11  Marek Safar  <marek.safar@gmail.com>
335
336         * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
337         rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
338         generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
339         attributes in their own structure. Needed when accessing their
340         properties before they are resolved.
341
342 2009-03-09  Marek Safar  <marek.safar@gmail.com>
343
344         * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
345         hashtable (~10x faster).
346         
347         * driver.cs: Removed wrong Reset.
348
349 2009-03-08  Marek Safar  <marek.safar@gmail.com>
350
351         * class.cs: Use correct common base type for unmanaged delayed
352         check.
353
354         * rootcontext.cs: Wrap unhandled exception.
355
356 2009-03-06  Raja R Harinath  <harinath@hurrynot.org>
357
358         Make SeekableStreamReader self-tuning and arbitrarily seekable
359         * support.cs (SeekableStreamReader.ResetStream): New.  Allocates
360         the buffer.
361         (SeekableStreamReader.Position.set): Use it.  Simplify logic
362         which, as a side-effect, makes it arbitrarily-seekable.  Tune the
363         buffer size when the stream needs to be re-read from the beginning.
364
365 2009-03-05  Marek Safar  <marek.safar@gmail.com>
366
367         A fix for bug #480100
368         * parameter.cs: A parameter is not hoisted when used directly as ET.
369
370 2009-03-04  Marek Safar  <marek.safar@gmail.com>
371
372         * statement.cs: Fixed an issue when using variable is of interface
373         type.
374
375 2009-03-03  Marek Safar  <marek.safar@gmail.com>
376
377         A fix for bug #480319
378         * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
379
380 2009-03-03  Marek Safar  <marek.safar@gmail.com>
381
382         A fix for bug #480867
383         * typemanager.cs, expression.cs, ecore.cs: Changed method group
384         expression to have no valid type.
385
386 2009-03-03  Marek Safar  <marek.safar@gmail.com>
387
388         A fix for bug #481258
389         * class.cs: Set extension method flag in partial container.
390
391 2009-03-03  Marek Safar  <marek.safar@gmail.com>
392
393         * statement.cs, typemanager.cs: Use expression for StringEmitter.
394         
395         * attribute.cs: Add sanity check.
396
397 2009-02-27  Marek Safar  <marek.safar@gmail.com>
398
399         * class.cs: Add external constructor error.
400
401 2009-02-26  Marek Safar  <marek.safar@gmail.com>
402
403         A fix for bug #475354
404         * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
405         correctly user defined nullable equality operators.
406
407 2009-02-25  Marek Safar  <marek.safar@gmail.com>
408
409         A fix for bug #479532
410         * expression.cs: Implement NewInitialize::AddressOf.
411
412 2009-02-25  Marek Safar  <marek.safar@gmail.com>
413
414         A fix for bug #413633
415         * expression.cs: Iterate all base class-constraint types.
416
417 2009-02-24  Marek Safar  <marek.safar@gmail.com>
418
419         A fix for bug #479209
420         * literal.cs: Mutate null underlying type.
421
422 2009-02-24  Marek Safar  <marek.safar@gmail.com>
423
424         A fix for bug #476295
425         * convert.cs: Avoid wrapping implicitly convertible reference type.
426
427 2009-02-23  Marek Safar  <marek.safar@gmail.com>
428
429         * iterators.cs: Create MemberName correctly.
430
431 2009-02-23  Marek Safar  <marek.safar@gmail.com>
432
433         A fix for bug #478655
434         * literal.cs: Check also underlying null type conversion.
435
436 2009-02-21  Marek Safar  <marek.safar@gmail.com>
437
438         * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
439
440 2009-02-20  Marek Safar  <marek.safar@gmail.com>
441
442         A fix for bug #477447
443         * statement.cs: Add reference to correct parent storey when this
444         is accessible from deep children storey (more than 1 level).
445
446 2009-02-19  Marek Safar  <marek.safar@gmail.com>
447
448         A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
449         * class.cs: Define base type members before setting up member cache.
450
451 2009-02-18  Marek Safar  <marek.safar@gmail.com>
452
453         A fix for bug #477378
454         * nullable.cs, expression.cs, statement.cs: More precise null type
455         sanity checks.
456
457 2009-02-18  Marek Safar  <marek.safar@gmail.com>
458
459         A fix for bug #472805
460         * typemanager.cs, namespace.cs: Import only visible extension method
461         types.
462
463 2009-02-18  Marek Safar  <marek.safar@gmail.com>
464
465         A fix for bug #476895
466         * attribute.cs: Use correct resolve context for attribute type.
467
468 2009-02-18  Marek Safar  <marek.safar@gmail.com>
469
470         A fix for bug #476266
471         * anonymous.cs: Mutate multi-dimensional arrays.
472
473 2009-02-18  Marek Safar  <marek.safar@gmail.com>
474
475         A fix for bug #476400
476         * statement.cs, expression.cs: Removed wrong Dispose optimization.
477
478 2009-02-18  Marek Safar  <marek.safar@gmail.com>
479
480         A fix for bug #476811
481         * generics.cs: Fixed null-literal check.
482
483 2009-02-17  Marek Safar  <marek.safar@gmail.com>
484
485         * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
486         expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
487         messing with static variables.
488
489 2009-02-16  Marek Safar  <marek.safar@gmail.com>
490
491         A fix for bug #475965
492         * generics.cs: Check generic parameter type after extracting from
493         Expression<T>.
494
495 2009-02-16  Marek Safar  <marek.safar@gmail.com>
496
497         A fix for bug #475823
498         * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
499         typed-null support.
500
501 2009-02-14  Marek Safar  <marek.safar@gmail.com>
502
503         * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
504         Simplified event field definition using backing field and not
505         field builder directly.
506
507         * expression.cs (EmitLdArg): Optimize fast paths.
508
509 2009-02-13  Marek Safar  <marek.safar@gmail.com>
510
511         A fix for bug #475327
512         * expression.cs (ArrayCreation): Don't mutate values optimized away.
513
514 2009-02-13  Marek Safar  <marek.safar@gmail.com>
515
516         A fix for bug #475342
517         * cs-parser.jay: Using 'super' instead of 'base' to call base
518         constructor crashes compiler.
519
520 2009-02-13  Marek Safar  <marek.safar@gmail.com>
521
522         A fix for bug #475354
523         * expression.cs (Constantify): Add nullable types.
524         
525         * const.cs (EmitDecimalConstant): Avoid explicit cast.
526
527 2009-02-12  Marek Safar  <marek.safar@gmail.com>
528
529         A fix for bug #475246
530         * expression.cs: More broken flowanalysis hacking needed.
531
532 2009-02-12  Marek Safar  <marek.safar@gmail.com>
533
534         * attribute.cs: Compare only ref/out array modifiers. 
535
536 2009-02-11  Marek Safar  <marek.safar@gmail.com>
537
538         * statement.cs: Use member cache when looking for foreach members.
539
540 2009-02-11  Marek Safar  <marek.safar@gmail.com>
541
542         * expression.cs: Don't expose internal initializer types.
543         
544         * statement.cs: Check also explicit conversions for goto case.
545
546 2009-02-11  Marek Safar  <marek.safar@gmail.com>
547
548         * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
549
550 2009-02-10  Marek Safar  <marek.safar@gmail.com>
551
552         * *.cs: Replace null-type with NullLiteral where appropriate.
553
554 2009-02-09  Marek Safar  <marek.safar@gmail.com>
555
556         * expression.cs: Initializer of reference argument use temporary
557         variable to be verifiable.
558         
559         * parameter.cs: Share EmitLdArg.
560
561 2009-02-09  Marek Safar  <marek.safar@gmail.com>
562
563         A fix for bug #473559
564         * class.cs: Fixed: Not reporting error about nested class with the
565         same name.
566
567 2009-02-06  Scott Peterson  <lunchtimemama@gmail.com>
568
569         Contributed under the MIT/X11 license.
570
571         * generic.cs: Added VerifyVariantTypeParameters which performs new
572         variance verification logic. The old logic, based on the spec, was
573         wrong because the spec is full of LIES!
574
575         * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
576
577         *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
578
579         * class.cs:
580         * ecore.cs: Added calls to the new variance verification logic.
581
582         * parameter.cs:
583         * delegate.cs: Removed calls to the old variance verification logic.
584
585 2009-02-06  Marek Safar  <marek.safar@gmail.com>
586
587         * delegate.cs: Use cached Invoke method directly.
588
589 2009-02-06  Marek Safar  <marek.safar@gmail.com>
590
591         * expression.cs: Emit expression tree for hoisted variable access.
592
593 2009-02-04  Marek Safar  <marek.safar@gmail.com>
594
595         * namespace.cs: Add better extension class check.
596
597 2009-02-05  Scott Peterson  <lunchtimemama@gmail.com>
598
599         * generic.cs: Fixed typeo (TypeParameter.Variacne).
600
601 2009-02-04  Scott Peterson  <lunchtimemama@gmail.com>
602
603         This patch adds initial generic variance support to the compiler.
604         It is contributed under the MIT/X11 license.
605
606         * typemanager.cs: Modified ImplementsInterface to check variance.
607         Added VerifyVariantTypeParameters which checks the specified type to see
608         if it uses a variant type parameter as a type argument (which is not
609         allowed). Added IsVariantOf which determins if the first type is a
610         variant of the second. NOTE: This only supports reference types at
611         the moment to conform with the current level of VM support. When the
612         VM supports value types, this will follow step.
613
614         * generic.cs: Added the Variance enum. Added a Variance property to
615         TypeParameter and added variance support to definition phase. Added a
616         Variance property to TypeParameterName. Also check to make sure that
617         no variant types appear in generic method parameters.
618
619         * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
620         keywords if the langversion supports it.
621
622         * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
623         that variant types are only used in legal positions. Also added
624         ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
625         parameters.
626
627         * decl.cs: Construct TypeParameter with the variance information.
628
629         * convert.cs: Checks variance in ImplicitReferenceConversionExists
630         and ImplicitConversionStandard.
631
632         * rootcontext.cs: Added new "Future" language version.
633
634         * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
635         type parameters are not used as type arguments in interface inheritance.
636         In MemberBase.DoMemberDependentChecks, ensure that contravariant type
637         parameters are not used as method return types. In MemberBase.
638         ResolveMemberType, ensure that variant type parameters are not used
639         as type arguments. Also call VerifyNoVariantTypeParameters on every
640         set of parameters which are resolved.
641
642         * delegate.cs: Modified Delegate.Define to ensure that variant
643         parameters are not used as type arguments and that a contravariant
644         parameter is not used as the return type. Also call
645         VerifyNoVariantTypeParameters on the delegate parameters.
646
647         * cs-parser.jay: Modified grammar to support "in" and "out" keywords
648         to specify generic variance.
649
650         * driver.cs: Added support for LanguageVersion.Future in the form of
651         "-langversion:future".
652
653         * generic-mcs.cs: Stubbed out new members in generic.cs.
654
655 2009-02-03  Marek Safar  <marek.safar@gmail.com>
656
657         * class.cs, generic.cs: Emit type parameter constraints for nested
658         types.
659
660 2009-02-02  Marek Safar  <marek.safar@gmail.com>
661
662         A fix for bug #471213
663         * class.cs: Avoid emitting backing field for abstract event fields.
664
665 2009-02-01  Marek Safar  <marek.safar@gmail.com>
666
667         A fix for bug #359731
668         * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
669         expressions.
670
671 2009-01-30  Marek Safar  <marek.safar@gmail.com>
672
673         A fix for bug #470767
674         * statement.cs: Introduced BlockScopeExpression, needed when 
675         expression tree conversion has to emit scope variables.
676
677 2009-01-29  Marek Safar  <marek.safar@gmail.com>
678
679         * class.cs: Remove duplicate CallingConvention.
680
681 2009-01-29  Marek Safar  <marek.safar@gmail.com>
682
683         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
684         when I finally found the right naming convention.
685
686 2009-01-29  Marek Safar  <marek.safar@gmail.com>
687
688         * cs-tokenizer.cs: Put back different open parens optimization.
689
690 2009-01-28  Marek Safar  <marek.safar@gmail.com>
691
692         A fix for bug #470227
693         * cs-tokenizer.cs: Remove too agressive parser optimization.
694
695 2009-01-28  Marek Safar  <marek.safar@gmail.com>
696
697         A fix for bug #324319
698         * class.cs: Remove too early base type resolve.
699
700 2009-01-27  Marek Safar  <marek.safar@gmail.com>
701
702         A fix for bug #324319
703         * ecore.cs: Explicitly type null when assigning to type argument to
704         make pass verifier check.
705
706 2009-01-27  Marek Safar  <marek.safar@gmail.com>
707
708         * anonymous.cs: Fixed recent regression when initializing captured 
709         this.
710
711 2009-01-26  Marek Safar  <marek.safar@gmail.com>
712
713         A fix for bug #469019
714         * anonymous.cs: Use all parent type parameters when instantiating
715         nested generic storey.
716
717 2009-01-26  Marek Safar  <marek.safar@gmail.com>
718
719         * expression.cs: Check for null instance methodgroup expression.
720
721 2009-01-26  Marek Safar  <marek.safar@gmail.com>
722
723         A fix for bug #469244
724         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
725         instance inside a conditional expression.
726
727 2009-01-23  Marek Safar  <marek.safar@gmail.com>
728
729         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
730         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
731         GetElementType and HasElementType. IsValueType clean up.
732
733 2009-01-23  Marek Safar  <marek.safar@gmail.com>
734
735         * nullable.cs: Use common EmitCall.
736         
737         * expression.cs: Emit constraint. for virtual calls only.
738
739 2009-01-23  Marek Safar  <marek.safar@gmail.com>
740
741         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
742         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
743         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
744         checks.
745
746 2009-01-22  Jb Evain  <jbevain@novell.com>
747
748         * anonymous.cs: make anonymous types' ToString implementation
749         match what csc outputs.
750
751 2009-01-21  Marek Safar  <marek.safar@gmail.com>
752
753         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
754         up.
755
756 2009-01-17  Marek Safar  <marek.safar@gmail.com>
757
758         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
759         verifier checks.
760
761 2009-01-16  Marek Safar  <marek.safar@gmail.com>
762
763         * nullable.cs (LiftedBinaryOperator): Check for all possible null
764         expressions.
765
766 2009-01-15  Marek Safar  <marek.safar@gmail.com>
767
768         A fix for bug #466634
769         * statement.cs: Add reference for nested storey when only this
770         is captured.
771
772 2009-01-15  Marek Safar  <marek.safar@gmail.com>
773
774         A fix for bug #466474
775         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
776         was specified.
777
778 2009-01-15  Marek Safar  <marek.safar@gmail.com>
779
780         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
781         Fixed nested stories parent referencing process. Also fixes #463985.
782
783 2009-01-06  Marek Safar  <marek.safar@gmail.com>
784
785         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
786         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
787         implementation. Also fixes #463108.
788
789 2009-01-05  Marek Safar  <marek.safar@gmail.com>
790
791         A fix for bug #416109
792         * decl.cs: Issue correct CLSAttribute warning location.
793
794 2009-01-05  Marek Safar  <marek.safar@gmail.com>
795
796         A fix for bug #456775
797         * attribute.cs: Use attribute owner scope when resolving attribute
798         arguments.
799
800 2009-01-05  Marek Safar  <marek.safar@gmail.com>
801
802         A fix for bug #457257
803         * decl.cs: Fixed incorrect member declaring type comparison.
804
805 2009-01-05  Marek Safar  <marek.safar@gmail.com>
806
807         A fix for bug #460896
808         * driver.cs: Handle /RES resources as embeddable.
809
810 2009-01-05  Marek Safar  <marek.safar@gmail.com>
811
812         A fix for bug #462515
813         * ecore.cs: Report inacessible members upwards.
814
815 2009-01-05  Marek Safar  <marek.safar@gmail.com>
816
817         A fix for bug #463190, #463192
818         * decl.cs, namespace.cs: Also import internal extension classes.
819
820 2009-01-04  Marek Safar  <marek.safar@gmail.com>
821
822         A fix for bug #463415
823         * generic.cs: Use right index for RemoveDependentTypes.
824
825 2009-01-02  Marek Safar  <marek.safar@gmail.com>
826
827         A fix for bug #463196
828         * expression.cs: Fixed enum to null comparison.
829
830 2009-01-02  Marek Safar  <marek.safar@gmail.com>
831
832         A fix for bug #463121
833         * nullable.cs: Fixed nullable user equality operator comparison.
834
835 2009-01-02  Marek Safar  <marek.safar@gmail.com>
836
837         A fix for bug #462950
838         * class.cs, decl.cs: Use full explicit name when defining automatic
839         property backing field.
840
841 2009-01-02  Marek Safar  <marek.safar@gmail.com>
842
843         A fix for bug #462592
844         * pending.cs: Emit type arguments for generic proxy method.
845
846 2008-12-30  Marek Safar  <marek.safar@gmail.com>
847
848         * expression.cs (As): Mutate all type arguments.
849
850 2008-12-29  Marek Safar  <marek.safar@gmail.com>
851
852         A fix for bug #462622
853         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
854         context.
855
856 2008-12-29  Marek Safar  <marek.safar@gmail.com>
857
858         A fix for bug #450782
859         * ecore.cs: Consider more variables of form V.I to be fixed.
860
861 2008-12-29  Marek Safar  <marek.safar@gmail.com>
862
863         A fix for bug #460712
864         * typemanager.cs: Core types could be imported.
865
866 2008-12-28  Marek Safar  <marek.safar@gmail.com>
867
868         A fix for bugs #460847, #460772, #458049, #457339, #447807
869         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
870         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
871         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
872         user lambdas used inside query clauses.
873
874 2008-12-18  Marek Safar  <marek.safar@gmail.com>
875
876         A fix for bug #460229
877         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
878
879 2008-12-18  Marek Safar  <marek.safar@gmail.com>
880
881         A fix for bug #459952
882         * decl.cs, namespace.cs: Use common CheckAccessLevel.
883
884 2008-12-18  Marek Safar  <marek.safar@gmail.com>
885
886         A fix for bug #459630
887         * convert.cs: Enum to valuetype conversion is not allowed.
888
889 2008-12-18  Marek Safar  <marek.safar@gmail.com>
890
891         A fix for bug #457087
892         * generic.cs: Don't crash when constraint comes from type
893         declaration.
894
895 2008-12-16  Marek Safar  <marek.safar@gmail.com>
896
897         A fix for bug #459221
898         * anonymous.cs, statement.cs: Delay only captured this
899         initialization.
900
901 2008-12-12  Marek Safar  <marek.safar@gmail.com>
902
903         A fix for bug #457489
904         * anonymous.cs, statement.cs: Split anonymous storey instantiation
905         and initialization to capture scope initializers correctly.
906
907 2008-12-11  Marek Safar  <marek.safar@gmail.com>
908
909         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
910         ParameterReference refactoring.
911
912 2008-12-03  Marek Safar  <marek.safar@gmail.com>
913
914         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
915         to be imported from any assembly.
916
917 2008-12-03  Marek Safar  <marek.safar@gmail.com>
918
919         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
920         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
921         from anonymous method and lambda expression.
922
923 2008-12-01  Marek Safar  <marek.safar@gmail.com>
924
925         A fix for bug #448560
926         * expression.cs (As): Box any generic type arguments to be
927         verifiable.
928
929 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
930
931         Add tripwire for implicit conversion bugs
932         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
933         for CS1501 error.
934         (MethodGroupExpr.OverloadResolve): Add sanity check between
935         IsApplicable and VerifyArgumentsCompat.
936         (VerifyArgumentsCompat): Report CS1501 where appropriate.
937
938 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
939
940         Fix build break in System.Data_test
941         * convert.cs (ImplicitConversionExists): Move NullLiteral
942         conversions ...
943         (ImplicitStandardConversionExists): ... here.
944
945 2008-11-28  Marek Safar  <marek.safar@gmail.com>
946
947         * literal.cs: Emit correctly explicit null to nullable cast.
948
949 2008-11-28  Marek Safar  <marek.safar@gmail.com>
950
951         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
952         resolve.
953
954 2008-11-28  Marek Safar  <marek.safar@gmail.com>
955
956         A fix for bug #449005
957         * convert.cs, nullable.cs: Use only one implicit nullable
958         conversion.
959
960 2008-11-27  Marek Safar  <marek.safar@gmail.com>
961
962         * convert.cs, literal.cs: More Convert cleanup is needed.
963
964 2008-11-27  Marek Safar  <marek.safar@gmail.com>
965
966         * decl.cs, class.cs: Fixed misleading error message.
967
968 2008-11-26  Marek Safar  <marek.safar@gmail.com>
969
970         A fix for bug #449005
971         * nullable.cs (EmitEquality): Disable optimization for user operator
972         operands.
973
974 2008-11-25  Marek Safar  <marek.safar@gmail.com>
975
976         A fix for bug #447027
977         * anonymous.cs (HoistedVariable): Cache also outer access to deal
978         with context variables stored as expression instances.
979
980 2008-11-25  Marek Safar  <marek.safar@gmail.com>
981
982         A fix for bug #447027
983         * delegate.cs: Fixed delegate VerifyMethod logic.
984
985 2008-11-24  Marek Safar  <marek.safar@gmail.com>
986
987         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
988         but not verifiable.
989
990 2008-11-21  Marek Safar  <marek.safar@gmail.com>
991
992         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
993         member type resolve to follow normal flow, instead of random
994         property access.
995
996 2008-11-21  Marek Safar  <marek.safar@gmail.com>
997
998         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
999         type.
1000
1001 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1002
1003         * const.cs: Emit decimal array constant as literal.
1004
1005 2008-11-20  Marek Safar  <marek.safar@gmail.com>
1006
1007         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
1008
1009 2008-11-19  Marek Safar  <marek.safar@gmail.com>
1010
1011         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
1012         into real property (saves 8 MB for corlib compilation).
1013
1014 2008-11-19  Marek Safar  <marek.safar@gmail.com>
1015
1016         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
1017         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
1018         generic-mcs.cs: Small cleanup of TypeArguments.
1019
1020 2008-11-18  Marek Safar  <marek.safar@gmail.com>
1021
1022         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
1023         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
1024         of ConstructedType expression, renamed to GenericTypeExpr.
1025
1026 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1027
1028         A fix for bug #445303
1029         * location.cs (IsConditionalDefined): Handle undefined global
1030         defines.
1031
1032 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1033
1034         A fix for bug #444678
1035         * expression.cs (TryReduceConstant): Always create new constant
1036         instance.
1037
1038 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1039
1040         A fix for bug #444673
1041         * ecore.cs: Ignore open generic types when used as generic type
1042         instance fields.
1043
1044 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1045
1046         A fix for bug #445458
1047         * expression.cs, cs-parser.jay: Don't crash when an expression
1048         statement is null.
1049
1050 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1051
1052         A fix for bug #445464
1053         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
1054         inside unbound type.
1055
1056 2008-11-14  Jb Evain  <jbevain@novell.com>
1057
1058         * driver.cs: ignore empty -nowarn argument such as
1059         the one in -nowarn:12,13,,.
1060
1061 2008-11-13  Marek Safar  <marek.safar@gmail.com>
1062
1063         A fix for bug #444271
1064         * anonymous.cs: Rescan parent storeys when best candidate was
1065         undone.
1066
1067 2008-11-13  Marek Safar  <marek.safar@gmail.com>
1068
1069         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
1070         useless UnboundTypeExpression.
1071         
1072         * attribute.cs: Do check obsolete attribute on generic types.
1073
1074 2008-11-12  Marek Safar  <marek.safar@gmail.com>
1075
1076         A fix for bugs #425680, #400139
1077         * ecore.cs, expression.cs: Trying to do some almost_matched_members
1078         refactoring.
1079
1080 2008-11-11  Marek Safar  <marek.safar@gmail.com>
1081
1082         A fix for bug #435747
1083         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
1084         compound value types assignment. Few micro optimizations added.
1085
1086 2008-11-10  Marek Safar  <marek.safar@gmail.com>
1087
1088         A fix for bug #442610
1089         * anonymous.cs (MutateConstructor): More SRE hacking.
1090
1091 2008-11-10  Marek Safar  <marek.safar@gmail.com>
1092
1093         A fix for bug #442579
1094         * ecore.cs: Also initialize expanded form of a method with 1 params
1095         parameter.
1096
1097 2008-11-06  Marek Safar  <marek.safar@gmail.com>
1098
1099         * expression.cs (UnaryMutator): Do early l-side check.
1100
1101 2008-11-05  Miguel de Icaza  <miguel@novell.com>
1102
1103         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1104         Init, otherwise we would crash later on when checking for friend
1105         assemblies. 
1106
1107         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1108         Otherwise we never get any meaningful information as to what
1109         failed. 
1110
1111 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1112
1113         A fix for bug #436318
1114         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1115
1116 2008-11-05  Miguel de Icaza  <miguel@novell.com>
1117
1118         * namespace.cs: Turns out that it was a really bad idea to hide
1119         the errors for namespaces not found here in eval mode.    
1120
1121         * eval.cs: When we process using clauses, only enter those into
1122         the list of valid using clauses after they have been validated.   
1123
1124         The above change gives the proper semantics: it does not
1125         senselessly report the same errors with broken using statements by
1126         never storing them in the first place when they are invalid.
1127
1128 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1129
1130         A fix for bug #421839
1131         * cs-parser.jay: Remove expression from coalesce rule to force lower
1132         priority than the assignment operator.
1133
1134 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1135
1136         A fix for bug #437875
1137         * nullable.cs: Compile correctly method group operand used with null
1138         coalescing operator.
1139
1140 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1141
1142         A fix for bug #434589
1143         * expression.cs (Binary): Ignore lifted conversions when at least
1144         one operand is of reference type.
1145
1146 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1147
1148         * cs-parser.jay: Better syntax error report.
1149
1150 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1151
1152         A fix for bug #436792
1153         * cs-parser.jay: Use GetLocation to access location.
1154
1155 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1156
1157         A fix for bug #440774
1158         * cs-parser.jay: Also set current_array_type when parsing local
1159         variables types.
1160
1161 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1162
1163         A fix for bug #440785
1164         * expression.cs (As): Don't resolve self modifing expression
1165         multiple times.
1166
1167 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1168
1169         A fix for bug #439447
1170         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1171
1172 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1173
1174         A fix for bug #437571
1175         * cs-parser.jay: Fixes internal error for invalid expression
1176         statements.
1177
1178 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1179
1180         * ecore.cs: Resolve correctly ambiguous params delegate methods.
1181
1182 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1183
1184         * generic.cs, anonymous.cs: Simplified GetDeclarations.
1185
1186 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1187
1188         * cs-tokenizer.cs: More precise cast parsing.
1189
1190 2008-10-16  Martin Baulig  <martin@ximian.com>
1191
1192         * anonymous.cs (AnonymousMethodStorey): Put back the
1193         `hoisted_locals' hashtable and use it in EmitType().
1194
1195 2008-10-15  Marek Safar  <marek.safar@gmail.com>
1196
1197         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1198         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1199         ~5MB for corlib.
1200
1201 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1202
1203         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1204
1205 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1206
1207         * statement.cs: Mutate scope initializers.
1208
1209 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1210
1211         * expression.cs: Use typeless value for This constant.
1212         
1213         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1214
1215 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1216
1217         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1218         tokenizer.
1219
1220 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1221
1222         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1223         type to type cast.
1224
1225 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1226
1227         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1228         parser and tokenizer. Fixes many ambiguities including #433258.
1229
1230 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1231
1232         * cs-parser.jay: Fixed missing accessor recovery.
1233
1234 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1235
1236         A fix for bug #433701
1237         * expression.cs: Better error message.
1238
1239 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1240
1241         * cs-parser.jay, expression.cs: Start reporting real parser errors.
1242         
1243         * Makefile: Disabled unused debug symbols.
1244
1245         Also fixes: #320556, #321097, #321656, #321876, #351316
1246
1247 2008-10-09  Miguel de Icaza  <miguel@novell.com>
1248
1249         * eval.cs: rename "<interactive>" to "{interactive}", to work
1250         around a requirement in the compiler that this be a valid
1251         filename, and in Windows it is not (433886).
1252
1253 2008-10-09  Marek Safar  <marek.safar@gmail.com>
1254
1255         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1256
1257 2008-10-08  Marek Safar  <marek.safar@gmail.com>
1258
1259         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1260         cs-parser.jay: Generic type declaration and type arguments cleanup.
1261
1262 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1263
1264         * cs-parser.jay: Allow parsing weird array creation construct.
1265
1266 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1267
1268         * cs-parser.jay: Conflicts reduction.
1269
1270 2008-10-04  Marek Safar  <marek.safar@gmail.com>
1271
1272         * cs-parser.jay: Conflicts reduction.
1273
1274 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
1275
1276         Fix #398325
1277         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1278         property.  Add a 'count' hint about the use of the shared vector.
1279         Ensure that we don't leak out dirty bits.
1280         (UsageVector.MergeChild): Throw away information about variables
1281         in child vectors.
1282         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1283
1284 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1285
1286         A fix for bug #431746
1287         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1288         parameters when iterator is created.
1289
1290 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1291
1292         A fix for bug #431827
1293         * expression.cs: Fixed right based pointer arithmetic operations
1294         emit.
1295
1296 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1297
1298         A fix for bug #353779
1299         * assign.cs, expression.cs: Fixed compound assignment conversions.
1300
1301 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1302
1303         A fix for bug #375262
1304         * statement.cs: Refactor ArrayForeach to be usable with string
1305         indexer. Optimized single dimentional arrays foreach.
1306
1307 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1308
1309         A fix for bug #431255
1310         * anonymous.cs, expression.cs: Removed broken optimization.
1311
1312 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1313
1314         * anonymous.cs: Use full type parameters of parent generic
1315         containers. Removed unnecessary AddParentStoreyReference call.
1316
1317 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1318
1319         A fix for bug #324702
1320         * class.cs: Use better shorter names for explicit interface member
1321         implementations.
1322
1323         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1324
1325 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1326         
1327         * expression.cs: Use new interface to check fixed expression.
1328
1329 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1330
1331         A fix for bug #421101
1332         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1333         interface to check for fixed fixed-buffers.
1334
1335 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1336
1337         A fix for bug #429264
1338         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1339         
1340         * delegate.cs: Removed unnecessary casts.
1341
1342 2008-09-30  Marek Safar  <marek.safar@gmail.com>
1343
1344         A fix for bug #352151
1345         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1346         class.cs: Fixed already defined explicit interface members check.
1347
1348 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
1349
1350         cs-tokenizer.cs: Fix typo.
1351
1352 2008-09-28  Miguel de Icaza  <miguel@novell.com>
1353
1354         * eval.cs (InteractiveBase): The quit command now just sets a
1355         flag, instead of calling Environment.Exit(), it is milder on
1356         embedded hosts. 
1357
1358         CompiledMethod is now in Mono.CSharp, not nested inside
1359         the Evaluator, it was inconvenient to use.
1360
1361 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1362
1363         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1364         code to be invoked without having to reparse.
1365
1366 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1367
1368         * ecore.cs: The recent changes to FieldExpr broke this as well.
1369         Fixes LINQ queries in the interactive shell.
1370
1371         * Multiple files: indentation fixing for the Mono coding
1372         guidelines for the switch statement.
1373
1374         * eval.cs: Make the Evaluator API thread safe.
1375
1376 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1377
1378         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1379         constructor parsing.
1380
1381 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1382
1383         A fix for bug #325326
1384         * statement.cs: Check possible mistaken empty statement using
1385         explicit blocks only.
1386
1387 2008-09-25  Miguel de Icaza  <miguel@novell.com>
1388
1389         * eval.cs (LoadAssembly, ReferenceAssembly): Call
1390         RootNamespace.ComputeNamespaces to update the internal list of
1391         namespaces, this is no longer done for us.
1392
1393         (InteractiveBase): Use the Evaluator APIs instead of calling into
1394         Driver directly
1395
1396 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1397
1398         A fix for bug #429264
1399         * expression.cs: Missing mutator for access to multidimensional
1400         arrays.
1401
1402 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1403
1404         * class.cs, statement: Emit DebuggerHidden attribute for iterator
1405         entry wrapper.
1406         
1407         * driver.cs: Missing input argument check.
1408
1409 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1410
1411         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1412         expression.cs, statement.cs, rootcontext.cs, class.cs, 
1413         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1414         DefineMembers.
1415
1416 2008-09-24  Miguel de Icaza  <miguel@novell.com>
1417
1418         * ecore.cs (FieldExpr): Only initialize eclass when we return a
1419         fully constructed FieldExpr, fixes the regression introduced in
1420         the last commit.
1421         
1422         * ecore.cs, expression.cs: Plug back the eclass initialization as
1423         otherwise it regresses `csharp'. 
1424
1425 2008-09-24  Marek Safar  <marek.safar@gmail.com>
1426
1427         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1428         ecore.cs, attribute.cs: Moved obsolete method checks from emit
1429         phase to resolve phase. It resolves problems with expression trees
1430         and fixes bugs #323796, #325156.
1431
1432 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1433
1434         * codegen.cs: Report better error when symbol writer is missing.
1435
1436 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1437
1438         * codegen.cs: Set .NET symbol writer.
1439         
1440         * decl.cs: Guard against null generic arguments.
1441         
1442         * report.cs: Don't report exactly same additional details.
1443
1444 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1445
1446         A fix for bug #324917
1447         * cs-parser.jay: Add missing multidimensional non-expression type
1448         ranks.
1449         
1450 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1451
1452         A fix for bug #428191
1453         * anonymous.cs: Create an outer generic fields also for non-storey
1454         anonymous methods.
1455
1456 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1457
1458         A fix for bug #378294
1459         * class.cs: Make fixed size buffers gmcs feature only.
1460
1461 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1462
1463         A fix for bug #355622, #324993
1464         * assign.cs, const.cs, class.cs: Create new EmitContext for each
1465         field initializer.
1466
1467 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1468
1469         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1470         error reporting.
1471
1472 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1473
1474         A fix for bug #416110
1475         * generic.cs: Struct constraint results in default ctor and
1476         ValueType base type constraint to be set.
1477
1478 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1479
1480         A fix for bug #423791
1481         * generic.cs: Fixed params output type type-inference.
1482
1483 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1484
1485         * cs-parser.jay, expression.cs: Fixed few expression crashes.
1486         
1487 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1488
1489         * cs-tokenizer.cs: Don't break on extra partial modifier.
1490
1491 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1492
1493         A fix for bug #427592
1494         * generic.cs: Use common parameter resolve method.
1495
1496 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1497
1498         A fix for bug #414758
1499         * expression.cs, ecore.cs: Fixed crash when accessing non-static
1500         property.
1501
1502 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1503
1504         * driver.cs, namespace.cs: Read types and namespaces after all
1505         requested assemblies are loaded, fixes issues with System.Core
1506         auto-reference, and #419888.
1507
1508 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1509
1510         A fix for bug #417705
1511         * cs-parser.jay: Fixed as/is operator expression split.
1512
1513 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1514
1515         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1516         Fixed expression tree representation of empty new expression and
1517         new initializer expression.
1518
1519 2008-09-18  Miguel de Icaza  <miguel@novell.com>
1520
1521         * eval.cs: Remove warning, keep reference to driver around.
1522
1523         * Hide fields that do not need to be public.
1524
1525 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1526
1527         A fix for bug #426385
1528         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1529         conversion for array elements.
1530
1531 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1532
1533         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1534         void parsing conflicts.
1535
1536 2008-09-15  Marek Safar  <marek.safar@gmail.com>
1537
1538         A fix for bug #425601
1539         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1540         System.Core only when there is no custom ExtensionAttribute
1541         implementation.
1542
1543 2008-09-15  Miguel de Icaza  <miguel@novell.com>
1544
1545         * namespace.cs: Do not report CS0246 (name
1546
1547 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1548
1549         A fix for bug #425669
1550         * generic.cs: Don't cache generic static anonymous method 
1551         containers.
1552
1553 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1554
1555         * generic.cs, class.cs, delegate.cs: Check recursive inherited
1556         conflicting constraints.
1557
1558 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
1559
1560         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1561         mcs too.
1562
1563 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1564
1565         * literal.cs, convert.cs, expression.cs, statement.cs: More null
1566         to null pointer conversion fixes.
1567
1568 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1569
1570         * cs-parser.jay, expression.cs: An implicitly typed local variable
1571         declarator cannot use an array initializer.
1572
1573 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1574
1575         * cs-parser.jay: Reduced number of printed tokens, add sorting.
1576
1577 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1578
1579         * generic.cs (InflatedConstraints): Don't crash when constraints
1580         are different.
1581         
1582         * cs-parser.jay: const_declarator is a block.
1583
1584         * constant.cs: Check for not allowed NaN conversions.
1585
1586 2008-09-10  Miguel de Icaza  <miguel@novell.com>
1587
1588         * driver.cs: Drop --shell argument, the compiler is no longer a
1589         REPL. 
1590
1591         * eval.cs: Move most of the code that deals with evaluation into
1592         this file and document the public API from repl.cs
1593
1594         * repl.cs: Remove from here.
1595         
1596 2008-09-10  Marek Safar  <marek.safar@gmail.com>
1597
1598         A fix for bug #424684
1599         * generic.cs: Generic class constraints must come first.
1600
1601 2008-09-09  Miguel de Icaza  <miguel@novell.com>
1602
1603         * cs-parser.jay: Improve error reporting for syntax errors in
1604         statements and expressions, we now report the expected tokens
1605         instead of reporting the useless "; expected".
1606
1607         Drop the strings from the token declaration, it turns out that
1608         they did not do what I thought they did.  Instead they were adding
1609         two sets of tokens to the tables.
1610
1611 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1612
1613         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1614         delegate.cs: Share special type check.
1615
1616 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1617
1618         A fix for bug #423981
1619         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1620
1621 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1622
1623         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1624         ConvertImplicitly.
1625
1626 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1627
1628         A fix for bugs: #324750, #335946
1629         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
1630         lookup rule to determine ?-based tokens.
1631
1632 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1633
1634         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1635         expressions (like event adding or removing) end up here, so we
1636         need to treat those as statements.
1637
1638         Add LoadAssembly method.
1639
1640 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1641
1642         * repl.cs: Add Time method.
1643
1644 2008-09-05  Marek Safar  <marek.safar@gmail.com>
1645
1646         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1647
1648 2008-09-05  Miguel de Icaza  <miguel@novell.com>
1649
1650         * repl.cs: Add workaround for old compilers.
1651
1652 2008-09-04  Jb Evain  <jbevain@novell.com>
1653
1654         * repl.cs (PrettyPrint): pretty print everything that
1655         implements IDictionary, as well as IEnumerables. Also,
1656         add a quit helper property.
1657
1658 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1659
1660         * constant.cs: Better error reporting for decimal literals.
1661         
1662         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1663         field attributes.
1664         
1665 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1666                         Miguel de Icaza  <miguel@novell.com>
1667
1668         A fix for bug #422951
1669         * assign.cs (Assign.DoResolve): Perform the type conversions
1670         checks before we attempt to initialize `New' initializers. 
1671
1672 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1673
1674         A fix for bug #422853
1675         * delegate.cs (DelegateCreation): Add special handling for
1676         EmptyExpression.Null instance expression which is just another
1677         hack for undecided member instance exression.
1678
1679 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1680
1681         * expression.cs, ecore.cs: Emit full expression tree for reduced
1682         binary expressions.
1683
1684 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1685
1686         * expression.cs (This): Guard against multi-resolving.
1687         
1688         * ecore.cs, statement.cs (Throw): Simplified.
1689         
1690         * flowanalysis.cs: Also verify event fields.
1691
1692 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1693
1694         * assign.cs (Assign.DoResolve): Perform the type conversions
1695         checks before we attempt to initialize `New' initializers. 
1696
1697         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1698
1699         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1700         public. 
1701
1702         * repl.cs: Update help.
1703
1704 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1705
1706         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1707         handling of the default config handling, including the special
1708         treatment of System.Core assembly. 
1709
1710         Fixes the REPL processing for LINQ.
1711
1712 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1713
1714         A fix for bug #422507
1715         * expression.cs (UnboxCast): Add missing child expression mutator.
1716
1717 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1718
1719         * driver.cs: Don't self reference System.Core assembly.
1720
1721 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #422507
1724         * expression.cs (StringConcat): Add missing type mutator.
1725
1726 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1727
1728         * generic.cs (TypeInferenceContext): Follow equality rule for
1729         constructed type lower bound type inference.
1730
1731 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1732
1733         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1734         <dblank@cs.brynmawr.edu> which updates the cursor position on
1735         refresh.
1736         
1737 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1738
1739         A fix for bug #367145
1740         * driver.cs: Fixed import of extension methods when using -noconfig
1741         option.
1742
1743 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1744
1745         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1746         version from non-generic implementation instead.
1747
1748 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1749
1750         A fix for bug #418908
1751         * class.cs: Use AddScopeStatement for field initializers.
1752
1753 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1754
1755         A fix for bug #415385
1756         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1757
1758 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1759
1760         A fix for bug #421736
1761         * iterators.cs: Don't crash on unreachable iterators.
1762
1763 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1764
1765         A fix for bug #421628
1766         * parameter.cs, attribute.cs: Clone also parameter attributes.
1767
1768 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1769
1770         * namespace.cs (LookupType): In EvalMode, try to replace
1771         the TypeBuilder from our cache with a Type as Reflection.Emit does
1772         not  like to mix code from older assemblies emitted and new
1773         assemblies emitted. 
1774
1775         This sounds like a serious Mono bug that prevents multiple
1776         assemblies to be generated and consumed at the same time.
1777
1778         * cs-parser.jay (push_current_class): Do not make interactive
1779         classes internal or private, make them public as we currently
1780         generate each new class in a new assembly.   
1781
1782 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1783
1784         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1785         remove types that are entered into the global namespace during
1786         parsing so that we can remove them on failure.
1787  
1788         * cs-parser.jay: Parsing: we now keep track of types that are
1789         entered into global variables and queue those in case the parsing
1790         or resolution fail.
1791  
1792         This happens in a few situations: during partial-input, we invoke
1793         the parser repeatedly for example with the string "class X", this
1794         would cause X to be registed, and we need to remove this
1795         registration so that another parse attempt later with say "class X {"
1796         would actually work.
1797  
1798         Additionally, if there is an error in the resolution phase, for
1799         example: "class X : NonExistant {}" th
1800         
1801         * cs-parser.jay: Be more precise with the errors being raised,
1802         instead of flagging all exceptions during parsing to be attributed
1803         to the parsing process, distinguish those from errors happening in
1804         the actions and hint that using -v would produce the actual
1805         exception. 
1806
1807         * repl.cs: Do not load all compiler references on each reset,
1808         doing the partial reset takes care of this.
1809         
1810 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1811
1812         * repl.cs: Add support for loading all the files from
1813         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1814         as shell libraries.
1815
1816         Introduce a micro-parser that is able to deambiguate on its input
1817         whether we are dealing with a compilation unit (namespace, class,
1818         interface, struct, delegate) declaration or a statement.   This
1819         allows both declarations and statements to be entered. 
1820
1821         Set history size by default to 300 lines.
1822
1823         Instead of distinguishing based on the parser.InteractiveResult,
1824         have only two cases: statements were parsed, or a compilation unit
1825         was.   Always pull the Using statement additions from the
1826         compilation unit parse.
1827         
1828         * cs-tokenizer.cs: Rename tokens to better describe their intent
1829         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1830         
1831         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1832         EvalMode is used to trigger the lookup of global variables while
1833         StatementMode is used turn variable declarations into static
1834         fields.
1835
1836         * getline.cs: Allow history size to be set.
1837         
1838 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1839
1840         A fix for bug #360755
1841         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1842
1843 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1844
1845         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1846         
1847         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1848         member name, it is too confusing
1849         
1850         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1851         
1852         * rootcontext.cs: Finally default to warning level 4.
1853
1854 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1855
1856         * class.cs (CheckBase): Ignore overloaded operators.
1857
1858 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1859
1860         A fix for bug #420830
1861         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1862
1863 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1864
1865         A fix for bug #420832
1866         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1867
1868 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1869
1870         A fix for bug #420386
1871         * nullables.cs: Fixed logic of nullable user comparison operators involving
1872         null values.
1873
1874 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1875         
1876         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1877
1878 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1879
1880         * repl.cs: Add support for aborting the running code with C-c. 
1881
1882 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1883
1884         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1885
1886 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1887
1888         * cs-parser.jay (interactive_statement_list): A new set of rules
1889         for hosting statements that uses the "interactive_" prefix.   
1890
1891         * repl.cs: Add support for parsing `using' as a statement or as a
1892         directive.  Deambiguating before passing this to the parser.
1893
1894         We need to distinguish statement_expressions that occur at the
1895         toplevel vs those that occur embedded into expressions.
1896
1897         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1898         that fixes the cursor key handling, and a history bug.
1899         
1900 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1901
1902         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1903         limitations in Console, instead the 2.0 bootstrap libraries now
1904         include the Console bits.
1905
1906         Also, remove the use of Nullables from getline.cs
1907
1908         ------------
1909         
1910         Interactive support for the C# compiler.   Use gmcs --shell to
1911         enter a read-eval-print loop shell.
1912
1913         Docs: http://www.mono-project.com/CsharpRepl
1914         
1915         * sources: include repl.cs here and getline.cs for gmcs.exe,
1916         everything else is getline.cs impaired.
1917
1918         * Makefile: when bootstrapping pass a special flag
1919         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1920         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1921         This distinguishes those two cases.
1922
1923         * repl.cs: Support for a read-eval-print loop.   Will be soon
1924         refactored into eval support and then REPL on top of it.
1925
1926         * ecore.cs: If a simplename lookup fails, before erroring out,
1927         if we are in EvalMode to resolve the name to a declaration in the
1928         Eval-land.    
1929
1930         This means that variable declarations that happened in previous
1931         classes (as repl puts every statement in a separate class) are
1932         made visible in this way.
1933
1934         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1935         triggered an error due to the end of file being reached.   This is
1936         used to do multi-line input, and notify the caller that the user
1937         needs to provide more text before a successful parse.
1938
1939         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1940         to drive the evaluation with a custom wrapper. 
1941
1942         * driver.cs: Add support for --shell, and refactor some code to be
1943         reused from repl.cs
1944         
1945         * namespace.cs: Add support for serializing the contents of the
1946         namespaces and reloading them.  
1947
1948         * getline.cs: A managed implementation of ReadLine under
1949         X11/Apache2 license terms.  Easy to embed in other applications as
1950         well.
1951
1952         * namespace.cs: Add some functions to save and restore the
1953         namespace state.
1954
1955         * rootcontext.cs: New public field.
1956
1957         * cs-tokenizer.cs: Add support for one of the possible characters
1958         we introduce into the token stream.  
1959
1960         This patch does not affect the regular tokenization process, the
1961         only performance hit would happen if there is an invalid character
1962         on the input string.
1963
1964         * support.cs: Move isatty helper routine here.
1965
1966         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1967         code generator for in-memory assemblies.
1968
1969 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1970
1971         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1972         parameter cannot be always used as a type.
1973
1974 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1975
1976         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1977
1978 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1979
1980         * convert.cs: Implement explicit array to IList<T> conversion.
1981
1982 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1983
1984         A fix for bug #362740
1985         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1986
1987 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1988         
1989         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1990         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1991         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1992         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1993         handling to use just one type of infrastructure and deal with generics
1994         more effectivelly.
1995
1996 2008-07-23  Martin Baulig  <martin@ximian.com>
1997
1998         *** Merged this from trunk revision 108527 ***
1999
2000         * statement.cs
2001         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
2002         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
2003         scope variable.
2004
2005 2008-08-15  Marek Safar  <marek.safar@gmail.com>
2006         
2007         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
2008         error checks.
2009
2010 2008-08-15  Marek Safar  <marek.safar@gmail.com>
2011         
2012         * delegate.cs: Fixed compiler crash when creating delegate using partial
2013         method.
2014         
2015         * typemanager.cs: MulticastDelegate is not a delegate.
2016
2017 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2018         
2019         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
2020         checks.
2021
2022 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
2023
2024         * cs-parser.jay (type): Allow 'var' in mcs too.
2025         (local_variable_type): Likewise.
2026
2027 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2028         
2029         * driver.cs: Removed broken -noconfig variants.
2030
2031 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2032         
2033         A fix for bug #417078
2034         * expression.cs: Emit correctly left side pointer operators.
2035
2036 2008-08-13  Marek Safar  <marek.safar@gmail.com>
2037
2038         * generic.cs, lambda.cs: Inflate method generic arguments only.
2039
2040 2008-08-12  Marek Safar  <marek.safar@gmail.com>
2041
2042         * class.cs: Fixed struct layout check regression.
2043
2044 2008-08-12  Marek Safar  <marek.safar@gmail.com>
2045
2046         * cs-parser.jay, enum.cs: Simplified enum parsing.
2047         
2048         * decl.cs: Check all type parameters conflicts.
2049         
2050         * expression.cs, statement.cs, attribute.cs: More expression checks.
2051
2052 2008-08-11  Marek Safar  <marek.safar@gmail.com>
2053
2054         * generic.cs: Add type inference types restriction.
2055         
2056         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
2057         anonymous.cs, expression.cs: Allocate less accessor parameters.
2058
2059 2008-08-08  Marek Safar  <marek.safar@gmail.com>
2060
2061         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
2062         classes.
2063
2064 2008-08-08  Marek Safar  <marek.safar@gmail.com>
2065
2066         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
2067
2068 2008-08-07  Marek Safar  <marek.safar@gmail.com>
2069
2070         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
2071         Also fixes #362146 and #381592.
2072
2073 2008-08-07  Marek Safar  <marek.safar@gmail.com>
2074
2075         * ecore.cs: Reduced constant cannot be used as an attribute value.
2076         
2077         * cs-parser.jay: Base expression has to be a type.
2078         
2079         * expression.cs (Conditional): Uses ReducedExpression.
2080
2081 2008-08-06  Marek Safar  <marek.safar@gmail.com>
2082
2083         A fix for bug #376826
2084         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
2085         address of hoisted local variable or parameter cannot be taken.
2086
2087 2008-08-05  Marek Safar  <marek.safar@gmail.com>
2088
2089         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
2090         anonymous method inside checked/unchecked expression.
2091
2092 2008-08-05  Marek Safar  <marek.safar@gmail.com>
2093
2094         * typemanager.cs (IsEqual): Guard against null.
2095         
2096         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2097         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2098         routine. Fixed few misleading conversion errors.
2099
2100 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2101
2102         * class.cs: Consider generics when checking cycles in struct layout.
2103
2104 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
2105
2106         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
2107
2108 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2109
2110         A fix for bug #414165
2111         * anonymous.cs: Use same anonymous implementation method for all anonymous
2112         method emits.
2113
2114 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2115
2116         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2117         constraints.
2118
2119 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2120
2121         * cs-parser.jay: Typeof argument has to be a type expression.
2122         
2123         * namespace.cs: Check alias and namespace definitions collisions.
2124         
2125         * class.cs, pending.cs: Moved explicit interface accessor implementation
2126         check.
2127         
2128         * delegate.cs, expression.cs: Verify special name invocations.
2129         
2130 2008-08-01  Marek Safar  <marek.safar@gmail.com>
2131
2132         * cs-parser.jay: Don't choke on empty generic type arguments.
2133         
2134         * cs-tokenizer.cs: Handle escaped preprocessor directives.
2135         
2136         * expression.cs, ecore.cs: Minor expressions bugs.
2137
2138 2008-08-01  Marek Safar  <marek.safar@gmail.com>
2139
2140         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2141         and added more error handling.
2142         
2143         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2144         
2145         *  modifiers.cs, enum.cs: Fixed.
2146
2147 2008-07-31  Jb Evain  <jbevain@novell.com>
2148
2149         * driver.cs: remove -pkg ability of smcs.
2150
2151 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2152
2153         * statement.cs (Switch): Correctly set empty default target for single
2154         blocks.
2155
2156 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2157
2158         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2159         string switch statement implementation to use string dictionary which
2160         significantly (2-8x) improves performance of generated code.
2161
2162 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2163
2164         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2165         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2166         
2167 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2168
2169         A fix for bug #412595
2170         * typemanager.cs, convert.cs, expression.cs: Some types are never
2171         convertible to each other.
2172
2173 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2174
2175         * nullable.cs (CreateNullConstant): An error messages update.
2176
2177 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2178
2179         A fix for bug #412595
2180         * cfold.cs: Don't cast undefined bool constant.
2181
2182 2008-07-29  Martin Baulig  <martin@ximian.com>
2183
2184         * symbolwriter.cs
2185         (SymbolWriter.Reset): New public static method.
2186
2187         * driver.cs
2188         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2189
2190 2008-07-28  Marek Safar  <marek.safar@gmail.com>
2191
2192         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2193         
2194         * expression.cs (ElementAccess): Exact size allocation.
2195
2196 2008-07-26  Marek Safar  <marek.safar@gmail.com>
2197
2198         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2199
2200 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2201
2202         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2203         
2204         * class.cs: Removed $PRIVATE$ field hack which caused problems during
2205         flow analysis.
2206
2207 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2208
2209         A fix for bug #412217
2210         * assign.cs: Mutate also assignment type.
2211
2212 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2213
2214         A fix for bug #323644
2215         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2216         indexers.
2217
2218 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2219
2220         A fix for bug #412134
2221         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2222         non-enumerable operands when overloading equality or bitwise operators.
2223
2224 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2225
2226         * anonymous.cs: Cache closed generic anonymous method delegates.
2227
2228 2008-07-24  Marek Safar  <marek.safar@gmail.com>
2229
2230         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
2231         anonymous.cs, statement.cs: Always emit anonymous method as static method
2232         when is instance free. Use nesting for nested anynomous methods blocks.
2233         
2234 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2235
2236         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2237         types.
2238
2239 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2240
2241         * expression.cs: Removed MakeSimpleCall.
2242
2243 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2244
2245         A fix for bug #323012
2246         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2247         Base method implementing interface has to be public.
2248
2249 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2250
2251         * cs-parser.jay: Don't break on missing argument.
2252
2253 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2254
2255         A fix for bug #320993
2256         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2257           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2258
2259 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2260
2261         A fix for bug #320748
2262         * convert.cs: Implicit user operators cannot convert to interfaces
2263
2264 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2265
2266         A fix for bug #312686
2267         * driver.cs: Ignore empty assembly references.
2268
2269 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2270
2271         A fix for bug #387040
2272         * ecore.cs: Skip constrains check for an explicit implementation.
2273
2274 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2275
2276         A fix for bug #409045
2277         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2278           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2279           identifiers are file specific unless passed as input arguments.
2280
2281 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2282
2283          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2284          to emit UnmanagedMarshal data under 2.0 profile.
2285
2286 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2287
2288         A fix for bug #410369
2289         * parameter.cs: Clone correctly ParamsParameter.
2290
2291 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2292
2293         * expression.cs (Argument): Always report type for type based expressions
2294         errors.
2295
2296 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2297
2298         A fix for bug #410666
2299         * anonymous.cs: Correctly initialize generic storey reference.
2300
2301 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2302
2303         * convert.cs: Don't box same type arguments.
2304
2305 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2306
2307         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2308         Finished missing generic type mutators.
2309
2310 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2311
2312         * iterators.cs, statement.cs: Finished statements CloneTo.
2313
2314 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2315
2316         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2317         
2318         * expression.cs: Emit optimized default value expressions in expression tree
2319         array initializer.
2320
2321 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2322
2323         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2324
2325 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2326
2327         A fix for bug #367536
2328         * cs-parser.jay: Check static constructor of generic types for an access
2329         modifier.
2330
2331 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2332
2333         A fix for bug #353800
2334         * lambda.cs: Emit ret for contextual statements.
2335         
2336         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2337         up emitting redundant ret for all anonymous methods with return.
2338
2339 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2340
2341         A fix for bug #365188
2342         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2343         create anonymous method storey in unreachable block.
2344
2345 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2346
2347         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2348         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2349         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2350         statement.cs: Fixed relevant defects found by Gendarme.
2351
2352 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2353
2354         A fix for bug #325291
2355         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
2356         statement.cs: Replaced IAnonymousHost with top level block flag.
2357
2358 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2359
2360         * cs-parser.jay: Clean up unused open_parens.
2361
2362 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2363
2364         * ecore.cs: Custom error message for a range variable assignment.
2365
2366 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2367
2368         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2369         load.
2370
2371 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2372
2373         * literal.cs: Null literal is of object type.
2374
2375 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2376
2377         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2378         expression of nullable equality comparison.
2379
2380 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2381
2382         * expression.cs(PointerArithmetic): Removed redundant assignment.
2383
2384 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2385
2386         * decl.cs (GetSignatureForError): Report full namespace name for containers.
2387
2388 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2389
2390         A fix for bug #408361
2391         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2392         they are replaced by GetMethod.
2393
2394 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2395
2396         A fix for bug #408721 by jeremie.laval@gmail.com
2397         * expression.cs (Indirection): Implemented CloneTo.
2398
2399 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2400
2401         * statement.cs (AssignableSlots): Temporary disabled variable initialization
2402         assert check.
2403
2404 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2405
2406         * report.cs (EnableReporting): Don't reinitialize 0-based values.
2407
2408 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2409
2410         * linq.cs: Reset tranparent parameter counter in probing mode.
2411
2412 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2413
2414         * anonymous.cs: Mutate anonymous method type.
2415
2416 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2417
2418         * ecore.cs, anonymous.cs: Mutate field expressions.
2419
2420 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2421
2422         A fix for bug #369670
2423         * linq.cs, statement.cs: Use explicit block for query expressions variables.
2424
2425 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2426
2427         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2428
2429 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
2430
2431         Fix bug #314902
2432         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2433         only one '>', and finds a '>>', abort the generic lookahead.
2434
2435 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2436
2437         A fix for bug #319902
2438         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
2439
2440 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2441
2442         A fix for bug #406371
2443         * statement.cs: Moved EmitSymbolInfo to Block.
2444
2445 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2446
2447         * ecore.cs: Report better error for extension method overload failures.
2448
2449 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2450
2451         * expression.cs (Is): No need to box reference values.
2452
2453 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2454
2455         * class.cs: Use event resolve context when initializing CreateEmitContext.
2456
2457 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2458
2459         A fix for bug #394436
2460         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2461         method used inside expression trees. Added more LINQ to expression tree
2462         conversions.
2463
2464 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2465
2466         A fix for bug #378189, #370577
2467         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2468         from expression.
2469
2470 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2471
2472         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2473         hierarchically.
2474
2475 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2476
2477         A fix for bug #406702
2478         * anonymous.cs: Always park anonymous method in the nearest parent storey.
2479
2480 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2481
2482         A fix for bug #406648
2483         * cs-parser.jay: Report nullable use in mcs for some cases.
2484
2485 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2486
2487         * ecore.cs: Improved argument mismatch error messages.
2488
2489 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2490
2491         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2492
2493 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2494
2495         * expression.cs (TypeOf): Mutate type argument.
2496
2497 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2498
2499         * class.cs: Report missing partial modifier for correct type.
2500
2501 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2502
2503         * ecore.cs, expression.cs (VariableReference): Variable property is 
2504         protected.
2505
2506 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2507
2508         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2509         
2510 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2511
2512         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2513         method delegates.
2514
2515 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2516
2517         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2518         anonymous method storey to an instance method when only "this" is hoisted.
2519
2520 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2521
2522         A fix for bug #321615
2523         * expression.cs: Pointer comparisons use unsigned operator.
2524
2525 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2526
2527         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2528
2529 2008-07-02  Marek Safar  <marek.safar@gmail.com>
2530
2531         A fix for bug #404905
2532         * class.cs: Always initialize local unsafe variables.
2533
2534 2008-06-30  Marek Safar  <marek.safar@gmail.com>
2535
2536         A fix for bug #396987
2537         * expression.cs (NewInitialize): Clear local temporary variable for next run
2538
2539 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2540
2541         A fix for bug #401020
2542         * ecore.cs: Both types and modifiers have to match for ref and out arguments
2543
2544 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2545
2546         A fix for bug #398319
2547         * cs-parser.jay: Implemented undocumented base access expression inside
2548         anonymous types.
2549
2550 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2551
2552         A fix for bug #404227
2553         * cs-parser.jay: Parse namespace declaration using qualified identifier.
2554
2555 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2556
2557         A fix for bug #404227
2558         * convert.cs: Fixed explicit array to interface cast.
2559
2560 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2561
2562         A fix for bug #403894
2563         * delegate.cs: Mutate DelegateInvocation type.
2564
2565 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2566
2567         A fix for bug #379348
2568         * delegate.cs: Box a load of generic parameters.
2569
2570 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2571
2572         * expression.cs: Add an array creation arguments mutate.
2573
2574 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2575
2576         A fix for bug #386068
2577         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2578         parameter.
2579
2580 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2581
2582         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2583         CloneTo.
2584
2585 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2586
2587         A fix for bug #403518
2588         * delegate.cs: Type correctly anonymous method new invocation.
2589
2590 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2591
2592         A fix for bug #394826
2593         * anonymous.cs: Fully qualify members when resolving anonymous type internal
2594         calls.
2595
2596 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2597
2598         A fix for bug #394826
2599         * anonymous.cs, iterators.cs: Construct generic storey only when is really
2600         needed.
2601
2602 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2603
2604         * class.cs: Clone indexer parameters for localized capturing.
2605
2606 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2607
2608         A fix for bug #402379
2609         * expression.cs: Don't crash when an object initializer resolve fails.
2610
2611 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2612
2613         A fix for bug #402888
2614         * expression.cs: Mutate conditional expression.
2615
2616 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2617
2618         A fix for bug #401012
2619         * class.cs: Keep StructLayout in shared container.
2620
2621 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2622
2623         A fix for bug #400438
2624         * decl.cs, class.cs: Only properties can be automatically implemented.
2625
2626 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2627
2628         * statement.cs (ChangeToIterator): Copy also labels.
2629
2630 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2631
2632         * ecore.cs: Pass type argument details to parent extension method.
2633
2634 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2635
2636         A fix for bug #375966
2637         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2638
2639 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
2640
2641         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2642
2643 2008-06-22  Marek Safar  <marek.safar@gmail.com>
2644
2645         A fix for bug #394347
2646         * anonymous.cs: Cache compatible delegates as compatibility check produces
2647         a new method every time.
2648
2649 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2650
2651         * anonymous.cs: Propagate storey reference for single references.
2652
2653 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2654
2655         A fix for bug #387615
2656         * assign.cs, expression.cs: Correctly clone compound assignment.
2657
2658 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2659
2660         A fix for bug #359611, #359604
2661         * anonymous.cs: Mutate all types of hoisted parameters.
2662
2663 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2664
2665         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2666         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2667         expression.cs, codegen.cs, statement.cs
2668         
2669         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2670         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2671         
2672         ** Anonymous methods, lambda expressions rewrite **
2673         
2674         Anonymous expressions are now resolved when an explicit block is resolved 
2675         and they don't require any registration procedure anymore. Further,
2676         anonymous methods are defined when explicit block is emitted which allows
2677         better control of whole process and opens possibilities for more
2678         optimizations as well as alternative to reverse whole process.
2679         
2680         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2681         process consistent and to correctly emit hoisted generic methods when they
2682         have at least 1 hoisted variable.
2683         
2684 2008-06-17  Martin Baulig  <martin@ximian.com>
2685
2686         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2687         iterator method.
2688         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2689         virtual property; check it in Emit().
2690         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2691         an iterator.
2692         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2693         an iterator.
2694         (Indexer.Define): Likewise.
2695
2696 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2697
2698         * convert.cs: Don't use IsInterface on type arguments.
2699         
2700         * delegate.cs: DelegateInvocation uses MethodInfo.
2701         
2702         * parameter.cs: Removed IsTypeParameter.
2703         
2704         * generic-mcs.cs: More missing stuff.
2705
2706 2008-06-16  Martin Baulig  <martin@ximian.com>
2707
2708         * modifiers.cs
2709         (Modifiers.DEBUGGER_HIDDEN): New public const.
2710
2711         * typemanager.cs
2712         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2713
2714         * class.cs
2715         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2716         (AbstractPropertyEventMethod): Likewise.
2717         (Constructor.Emit): Likewise.
2718         (SourceMethod.SetCompilerGenerated): Removed.
2719
2720         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2721         on MoveNext().
2722
2723         * anonymous.cs
2724         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2725         if we're an `IteratorHost'.
2726         (AnonymousMethodMethod..ctor): Don't set
2727         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2728         not on the method.
2729
2730 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2731
2732         * statement.cs: Clean-up foreach statements.
2733
2734 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2735
2736         * class.cs: Stop using public method which should not exist
2737         (MethodBuilder.SetGenericMethodSignature).
2738
2739 2008-06-11  Martin Baulig  <martin@ximian.com>
2740
2741         * location.cs
2742         (Location.LookupFile): Add `CompilationUnit' argument; when given
2743         a relative file name, make it relative to the directory the .cs
2744         file is located in instead of using the current directory.
2745
2746 2008-06-11  Martin Baulig  <martin@ximian.com>
2747
2748         * class.cs
2749         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2750         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2751         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2752         (SourceMethod.SetCompilerGenerated): Likewise.
2753
2754 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2755
2756         * codegen.cs, driver: Only write symbol file when it's asked for.
2757
2758 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2759
2760         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2761
2762 2008-06-10  Martin Baulig  <martin@ximian.com>
2763
2764         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2765
2766 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2767
2768         A fix for bug #316290
2769         * expression.cs: Include decimal operators in predefined table.
2770         
2771         * parameters.cs: More readonlyness.
2772
2773 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2774
2775         A fix for bug #397213
2776         * cs-parser.jay: One more missing current_local_parameters reset.
2777
2778 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2779
2780         A fix for bug #396633
2781         * class.cs: Host backing field in partial container.
2782
2783 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2784
2785         A fix for bug #397068
2786         * expression.cs: Check both operand types when predefined operator is used.
2787
2788 2008-06-05  Martin Baulig  <martin@ximian.com>
2789
2790         Merged the `debugger-kahalo' branch.
2791
2792         * class.cs
2793         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2794         we're an iterator method.
2795         (SourceMethod): Reflect latest symbol writer changes;
2796         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2797         now `start_row' and `end_row'.
2798         (Constructor.Emit): Fix the logic whether to emit symbol information.
2799
2800         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2801         generated methods.
2802
2803         * location.cs
2804         (CompilationUnit): New public class; derives from `SourceFile'.
2805         (SourceFileEntry.DefineSymbolInfo): New public method.
2806         (SourceFileEntry.SetChecksum): New public method.
2807         (Location): Encode hidden line numbers by using `column == 255';
2808         the .ctor now accepts `column == -1' to mark a hidden line number.
2809         (Location.Hidden): New public property.
2810         (Location.CheckPoint): Add `CompilationUnit'.
2811         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2812         (Location.Push): Add `CompilationUnit compile_unit' argument.
2813         (Location.CompilationUnit): New public property.
2814
2815         * statement.cs
2816         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2817
2818         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2819
2820         * driver.cs: `SourceFile' -> `CompilationUnit'.
2821
2822         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2823
2824         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2825
2826         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2827         `#line hidden'.
2828
2829         * symbolwriter.cs
2830         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2831         new symbol writer API to also pass the file.
2832
2833 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2834
2835         * statement.cs: Emit catch variable assignment using variable expression.
2836         
2837 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2838
2839         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2840         with other variable types.
2841
2842 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2843
2844         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2845         GetLength method emit, it breaks resolve rules.
2846         
2847 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2848             Marek Safar  <marek.safar@gmail.com>
2849                         
2850         A fix for bug #395542
2851         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2852         declaration.
2853         
2854 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2855
2856         A fix for bug #395287
2857         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2858
2859 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2860
2861         A fix for bug #395845
2862         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2863         non-nullable parameter type.
2864         
2865 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2866
2867         * class.cs: Handle contructor initializer as a statement in top-level block.
2868
2869 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2870
2871         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2872         security attributes.
2873
2874 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2875
2876         * ecore.cs, expression.cs: Small IVariable refactoring.
2877
2878 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2879
2880         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2881
2882 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2883
2884         * cs-parser.jay: Removed redundant catch type check.
2885
2886 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2887
2888         A fix for bug #390372
2889         * nullable.cs: Set correct return type.
2890
2891 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2892
2893         A fix for bug #391062
2894         * typemanager.cs: Fixed crash when comparing null types.
2895
2896 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2897
2898         A fix for bug #391871
2899         * cs-parser.jay: Better error handling for invalid catch type.
2900
2901 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2902
2903         A fix for bug #392155
2904         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2905
2906 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2907
2908         A fix for bug #390666
2909         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2910         expressions.
2911
2912 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2913
2914         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2915         in getter.
2916
2917 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2918
2919         A fix for bug #389625
2920         * delegate.cs, generic.cs: Some progress on method group return type
2921         inference.
2922
2923 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2924
2925         A fix for bug #378419
2926         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2927
2928 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2929
2930         * class.cs (Constructor): Added IsCompilerGenerated.
2931
2932 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2933
2934         * expression.cs: Enum binary operators can accept non-enum operand only when
2935         is implicitly convertible to underlying type.
2936
2937 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2938
2939         A fix for bug #389272
2940         * support.cs: Workaround System.InvalidOperationException for enums.
2941
2942 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2943
2944         A fix for bug #389073
2945         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2946
2947 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2948
2949         * driver.cs: Split Parse.
2950         
2951         * location.cs (LookupFile): Uses string.Empty.
2952
2953 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2954
2955         * expression.cs, parameter.cs: Small ParameterReference clean up.
2956
2957 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2958
2959         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2960         hack. Fixes #387502.
2961
2962 2008-05-06  Martin Baulig  <martin@ximian.com>
2963
2964         * class.cs (Constructor.Emit): Fix the logic whether to emit
2965         symbol information.
2966
2967 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2968
2969         Fix #385503
2970         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2971         InvalidOperationException when the iterator is before the start or
2972         after the end.
2973
2974 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2975
2976         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2977         when left is nullable type.
2978
2979 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2980
2981         A fix for bug #386628
2982         * expression.cs (LocalVariableReference): Continue in resolving when
2983         variable is not assigned.
2984
2985 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2986
2987         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2988         nullable operations.
2989
2990 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2991
2992         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2993         it saves many redundant temporary variables for nullable operations.
2994
2995 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2996
2997         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2998         
2999         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
3000         method.
3001         
3002         * nullable.cs: Constant coalescing operator optimizations.
3003
3004 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3005
3006         * constant.cs: Use unsigned conversion for values which are unsigned only.
3007
3008 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3009
3010         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
3011         coalescing operator as it should be.
3012
3013 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3014
3015         A fix for bug #371016
3016         * expression.cs: All predefined delegate operators require implicit method
3017         group conversion.
3018         
3019 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3020
3021         * constant.cs: Emit long constant as uint when fits the range.
3022         
3023         * convert.cs, expression.cs: Fixed few unsafe conversions.
3024
3025 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3026
3027         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
3028
3029 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
3030
3031         Fix #385758
3032         * convert.cs (ImplicitNumericConversion): Don't modify the type of
3033         'expr'.
3034         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
3035
3036 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3037
3038         * constant.cs, literal.cs: IsLiteral property for error reporting.
3039         
3040         * ecore.cs, expression.cs: Implemented Property expression.
3041
3042 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3043
3044         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
3045         
3046         * nullable.cs: Implemented nullable coalescing null operator.
3047
3048         * ecore.cs, expression.cs: Expression trees work.
3049
3050 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3051
3052         * ecore.cs: CreateExpressionTree is finally abstract.
3053
3054         * expression.cs, linq.cs: Updated.
3055
3056 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3057
3058         * expression.cs, ecore.cs: Block base access expression inside expression
3059         tree.
3060
3061 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3062
3063         A fix for bug #385058
3064         * expression.cs: User-defined operator implementations always take
3065         precedence over predefined operator implementations.
3066
3067 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3068
3069         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
3070         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
3071         expression tree conversions.
3072         
3073 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3074
3075         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
3076         operators method details to Operator class.
3077
3078 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3079
3080         * anonymous.cs: Pass unsafe flags to anonymous container.
3081         
3082         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
3083         inside expression tree.
3084
3085 2008-04-29  Martin Baulig  <martin@ximian.com>
3086
3087         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
3088         (Tokenizer.PopPosition): Also restore the `line'.
3089
3090 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3091
3092         * delegate.cs: Implemented Invoke expression.
3093
3094 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3095
3096         * expression.cs: Fixed equality reference comparison regression.
3097
3098 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3099
3100         * ecore.cs: Clean up EmptyCast hack.
3101         
3102         * expression.cs, nullable.cs: Implemented enum binary and unary operations
3103         using correct conversion rules. Also fixes #383993.
3104
3105 2008-04-28  Martin Baulig  <martin@ximian.com>
3106
3107         * class.cs (Constructor.Emit): Don't emit debugging information
3108         for generated default .ctor's.
3109
3110 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3111
3112         * convert.cs: Empty-cast ushort to int conversion.
3113
3114 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3115
3116         A fix for bug #384191
3117         * ecore.cs, expression.cs: Fixed expression cloning.
3118
3119 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3120
3121         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3122
3123 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
3124
3125         Fix #381559, test-638.cs, test-639.cs
3126         * assign.cs (CompoundAssign.Helper): New wrapper.
3127         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3128         access.
3129         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3130         Pass unconverted expressions to the params array creation expression.
3131         (FieldExpr.EmitAssign): Don't special-case StringConcat.
3132         (PropertyExpr.EmitAssign): Likewise.
3133         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3134         element if it is of kind CompoundAssign.Helper.
3135         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3136         first before anything else.
3137         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3138         (ArrayAccess.LoadArrayAndArguments): Simplify.
3139
3140 2008-04-27  Marek Safar  <marek.safar@gmail.com>
3141
3142         * expression.cs: Fixed cloning of typeof(void).
3143
3144 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
3145
3146         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3147         (Assign.Emit): Likewise.  Move it to ...
3148         (CompoundAssign.DoResolve): ... here and ...
3149         (CompoundAssign.Emit): ... here.
3150         (EventAddOrRemove): New helper to handle += and -= on events, and
3151         avoid the use of BinaryDelegates.
3152         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3153         (EventExpr.EmitAddOrRemove): Improve.
3154         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3155
3156         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3157         create VarExprs for 'foo.bar.var'.
3158         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3159         is a highly inappropriate name for its functionality.
3160
3161 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3162
3163         Simplify handling of multiple assignments
3164         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
3165         inheritable-only.
3166         (SimpleAssign): New.  Class to be used for normal assignments.
3167         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3168         * expression.cs, parameter.cs, statement.cs: Likewise.
3169
3170 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3171
3172         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3173         for incompatible underlying types, more to come, uff.
3174
3175 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3176
3177         Fix gtest-388.cs
3178         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3179         Handle 'leave_copy'.
3180
3181 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3182
3183         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3184
3185 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
3186
3187         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
3188         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3189         * statement.cs (While, Do, For): Allow test to have side effects.
3190         (For.DoEmit): Always emit InitStatement.
3191
3192         Fix test-635.cs
3193         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3194         Always create SideEffectConstant.
3195         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3196         of type EnumConstant.
3197
3198         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3199         Handle 'right' being SideEffectConstant of type 'bool'.
3200
3201         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3202         Use left.EmitBranchable instead of open coding it, so as to
3203         improve optimization opportunities.
3204
3205         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3206
3207         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3208         assumptions.
3209         (Expression.EmitSideEffect): Document.
3210
3211 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3212
3213         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3214
3215 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3216
3217         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3218
3219 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3220
3221         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3222         conversion to expression tree.
3223
3224 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3225
3226         * ecore.cs: Removed unused expression.
3227
3228 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3229
3230         * expression.cs: Implemented NegateChecked and New expressions.
3231
3232 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3233
3234         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3235
3236 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
3237
3238         Fix #351102
3239         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3240         needing final 'ret' instruction.
3241
3242 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3243
3244         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3245
3246 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3247
3248         * expression.cs: Emit ldnull and not null expression as an instance argument
3249          of static method expression calls.
3250
3251 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3252
3253         A fix for bug #378200
3254         * expression.cs: Fixed crash when creating parameterless expression tree
3255         method call.
3256
3257 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3258
3259         A fix for bug #375297
3260         * anonymous.cs: Fixed crash when inferring from null argument anonymous
3261         method.
3262
3263 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3264
3265         A fix for bug #377596
3266         * decl.cs, class.cs: Emit delegate type argument attributes.
3267
3268 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3269
3270         A fix for bug #365314
3271         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3272         
3273 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3274
3275         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3276         only.
3277
3278 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3279
3280         * generic.cs (TypeParameter): Removed redundant location.
3281
3282 2008-04-19  Marek Safar  <marek.safar@gmail.com>
3283
3284         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3285         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3286         FullNamedExpression in all declaration type expression, statements will come
3287         later.
3288
3289 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3290
3291         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3292         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3293
3294 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3295
3296         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3297         code.
3298
3299 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3300
3301         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3302         constraints.
3303
3304 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3305
3306         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3307         name expressions.
3308         Also fixes #340463.
3309
3310 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
3311
3312         Hook up 'EmitSideEffect'
3313         * constant.cs (Constant.EmitSideEffect): New.
3314         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
3315         (SideEffectConstant.EmitSideEffect): New.
3316         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
3317         unconditional branch in EmitBranchable.
3318         (FieldExpr.EmitBranchable): New.
3319         * expression.cs (Unary.EmitSideEffect): New.
3320         (Binary.EmitSideEffect): New.
3321         (VariableReference.EmitSideEffect): New.  Do nothing.
3322
3323 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3324
3325         Introduce 'EmitSideEffect'
3326         * ecore.cs (Expression.EmitSideEffect): New.
3327         (TypeCast): Rename from EmptyCast.
3328         (EmptyCast): New.
3329         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3330         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3331         * convert.cs, nullable.cs: Update to changes.
3332
3333 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3334
3335         * class.cs, cs-parser.jay: Early check for base types expression.
3336
3337 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3338
3339         * decl.cs (MemberName): Declare PrettyName as obsolete.
3340
3341 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3342
3343         * namespace.cs: Use MemberName comparison.
3344
3345 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3346
3347         Fix build break
3348         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
3349         FullName.
3350         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3351         (MemberName.FullyQualifiedName): New.  Provides the functionality
3352         that users assume FullName would have.
3353         * ecore.cs, namespace.cs: Update to changes.
3354
3355         * statement.cs (Using.assign): Make into ExpressionStatement.
3356         (Using.EmitPreTryBody): Simplify.
3357
3358 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3359
3360         * report.cs: ColorFormat is protected.
3361         
3362         * rootcontext.cs: Unused fields clean-up.
3363         
3364         * namespace.cs: Made UsingEntry name private.
3365
3366 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3367
3368         * cs-tokenizer.cs, location.cs: Removed unused field.
3369
3370 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
3371             Raja R Harinath  <harinath@hurrynot.org>
3372
3373         Fix #379822
3374         * constant.cs (SideEffectConstant.value): Rename from 'left'.
3375         (SideEffectConstant.side_effect): Rename from 'right'.
3376         (SideEffectConstant..ctor): Normalize 'side_effect'.
3377         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3378         value of this constant.
3379         * cfold.cs: Update to changes.
3380
3381 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3382
3383         * cs-paser.jay: Removed unused variable.
3384         
3385         * driver.cs: Made Compile instance method.
3386
3387 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
3388
3389         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3390
3391 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3392
3393         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
3394
3395 2008-04-13  Jb Evain  <jbevain@novell.com>
3396
3397         * namespace.cs: update the System.Core fullname for 2.1
3398         * driver.cs: update the list of required assemblies for 2.1.
3399         Merged from the Moonlight 2 branch.
3400
3401 2008-04-11  Marek Safar  <marek.safar@gmail.com>
3402
3403         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3404         types and user defined operators. User operators arguments has to be checked
3405         for null value before invocation, which also means no operator is called
3406         when any argument is not convertible to unwrapped nullable type.
3407         
3408 2008-04-09  Marek Safar  <marek.safar@gmail.com>
3409
3410         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3411         of Unary expressions to follow operator overloading rules precisely.
3412         Also fixes #321794, #323794
3413         
3414 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3415
3416         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3417         expression.
3418         
3419 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3420
3421         * expression.cs, ecore.cs: Implemented MemberInit expression.
3422         
3423 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
3424
3425         Fix mono/tests/exception4.cs
3426         * statement.cs (ExceptionStatement, TryCatch): Revert to using
3427         ec.NeedReturnLabel () rather emitting a 'nop'.
3428
3429         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3430         simple heuristic.
3431         (TryCatch.SomeCodeFollows): Likewise.
3432         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3433         for 'break', 'continue' and 'return' statements inside a try.
3434         We're fairly sure that the generated IL stream will have more
3435         instructions textually following the try.
3436         (FlowBranchingTryCatch): Likewise.
3437
3438         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3439         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3440         overrides.
3441
3442         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3443         wrapper -- forward everything to CollectionForeach.
3444         (CollectionForeach.NonDisposableWrapper): New.
3445         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3446         instead of a pop + branch to end.
3447
3448 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3449
3450         A fix for bug #377485
3451         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
3452         Propagate location for extension method groups. Report conversion failure at
3453         right place.
3454
3455 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3456
3457         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3458         ListInit and Field expressions.
3459
3460 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
3461
3462         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3463         Since $PC is always -1 inside the body of MoveNext, the fault
3464         handler is a no-op.
3465         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3466         * statement.cs (ExceptionStatement.emit_finally): Likewise.
3467         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3468
3469         The denouement!  Fix #324708
3470         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3471         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3472         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3473         'finally' inside the finally clause.
3474
3475         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3476         inside an iterator.  Don't emit the body of the 'finally' inside
3477         the finally clause yet.
3478
3479         Use the ResumableStatement infrastructure for MoveNext ()
3480         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3481         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
3482         'old_resume_points'.  Move dispatcher upfront.
3483         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3484         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3485         in an enumerator.  This encodes the main fix in this patch series
3486         -- we can only jump into the first instruction of a try from the
3487         outside, but we want to emit try/finally regions in iterators and
3488         resume in the middle of them.
3489
3490 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
3491
3492         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3493         of NeedReturnLabel here.
3494
3495         Introduce a common point for emitting try/finally to IL
3496         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
3497         features of the various subclasses, which are now driven by ...
3498         (ExceptionStatement.EmitPreTryBody): ... this and ...
3499         (ExceptionStatement.EmitTryBody): ... this and the original
3500         EmitFinallyBody.
3501         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3502         Remove DoEmit and update to follow above protocol.
3503
3504         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3505         of the dispatcher are the same, skip emitting the 'switch'.
3506         * iterator.cs (Iterator.EmitDispose): Update to changes.
3507
3508         Clean up handling of 'using' statement
3509         * statement.cs (UsingTemporary): New.  Carved out of ...
3510         (Using): ... this.  Simplify drastically.  Handle exactly
3511         one variable.
3512         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
3513         or Using as appropriate.  If there are multiple variable declared,
3514         create nested Using statements.
3515         (resource_acquisition): Kill.
3516
3517         * statement.cs (ExceptionStatement.EmitForDispose): Use
3518         EmitFinallyBody, not EmitFinally.
3519
3520         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3521         * iterator.cs: Update to changes.
3522
3523         Start using the ResumableStatement infrastructure
3524         * statement.cs (ResumeableStatement.PrepareForDispose): New.
3525         (ResumableStatement.EmitForDispose): New.
3526         (ExceptionStatement): Override them.
3527         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3528         EmitForDispose to create the body of the Dispose method.  Don't
3529         use OldResumePoint.
3530
3531         * iterator.cs (Iterator.AddResumePoint): Move here from ...
3532         * statement.cs (Toplevel.AddResumePoint): ... here.
3533         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3534         * flowanalysis.cs (FlowBranchingIterator): New.
3535         * codegen.cs (EmitContext): Update to changes.
3536
3537         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3538         (Iterator.old_resume_points): Rename from 'resume_points'.
3539         (Iterator.MoveNextStatement): Remove unused class.
3540
3541         New infrastructure for try/finally in iterators (still unused)
3542         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3543         (FlowBranchingToplevel.AddResumePoint): Hook into
3544         ToplevelBlock.AddResumePoint.
3545         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3546         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3547         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
3548         resume points and assign program-counter values.
3549         (ExceptionBlock.AddResumePoint): Collect resume points for
3550         de-muxer at the top of try block.
3551         * iterators.cs (Yield.CheckContext): Simplify.
3552         (Yield.Resolve): Use FlowBranching.AddResumePoint.
3553
3554 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
3555
3556         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3557         argument to an ExitStatement.
3558         (FlowBranchingException): Refactor saved origins code.
3559         * statement.cs (ExitStatement): Update to cahges.
3560         * iterator.cs (YieldBreak): Likewise.
3561
3562         * statement.cs (ResumableStatement): New.  Common base class for
3563         YieldReturn and ExceptionStatement.
3564         (ExitStatement): New.  Common base class for Return and YieldBreak.
3565         (Return): Update to changes.
3566         * iterator.cs (YieldBreak): Likewise.
3567         * lambda.cs (ContextualReturn): Likewise.
3568
3569         Fix #377028
3570         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3571         emit a meaningful error message.
3572
3573         Fix #324765, #319508
3574         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3575         (VariableInfo.SetAssigned): Set it.
3576         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3577         determine if CS0219 or CS0168 is appropriate.  Don't use
3578         flow-analysis information.
3579         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3580         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
3581         (EmitContext.EndFlowBranching): ... this.
3582
3583 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3584
3585         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3586
3587 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3588
3589         A fix for bug #376508
3590         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3591         ImplicitConversionExists.
3592
3593 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3594
3595         * expression.cs (Binary): Added remaining binary operators to expression
3596         tree builder.
3597
3598         * nullable.cs: Optimize shift with null argument.
3599
3600 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
3601
3602         Fix minor IL regression
3603         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3604         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3605         * cs-parser.jay (try_statement): Update to changes.
3606
3607         * statement.cs (TryFinally.need_exc_block): Delete.
3608         (TryFinally): Update to changes.
3609
3610         Now all ExceptionStatements are unconditional
3611         * statement.cs (CollectionForeach.DisposableWrapper): New.
3612         Extract out the try/finally code into a new wrapper.
3613         (CollectionForeach.Resolve): Use it to simplify the code.
3614
3615 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
3616
3617         Start at simplifying ExceptionStatement semantics a bit
3618         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3619         * cs-parser.jay (try_statement): Update to changes.
3620         (opt_catch_clauses): Remove.
3621         * flowanalysis.cs: Update to changes.
3622         (FlowBranching.BranchingType.TryCatch): New.
3623         (FlowBranchingTryCatch): New.
3624
3625         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3626         (FlowBranching.CreateBranching): Update to changes.
3627         (FlowBranchingBlock.AddSibling): Add sanity check.
3628         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3629         Update to changes.
3630
3631         * iterators.cs (Iterator.MarkFinally): Remove.
3632         * statement.cs (ExceptionStatement): Update to changes.
3633
3634         Add support for skipping over finally blocks at runtime.  First
3635         in a series to fix #324708
3636         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3637         (Iterator.EmitMoveNext): Initialize it.
3638         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3639         branch over the body of the 'finally' clause.
3640
3641 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
3642
3643         Avoid lopsided use of Foo/DoFoo names
3644         * statement.cs (ExpressionStatement.EmitFinallyBody):
3645         Rename from EmitFinally.
3646         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3647         * iterator.cs: Update to changes.
3648
3649 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3650
3651         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3652         based on UserOperatorCall. More binary nullable operators clean up.
3653
3654 2008-04-02  Martin Baulig  <martin@ximian.com>
3655
3656         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3657
3658 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3659
3660         * nullable.cs: Merge user and empty conversions when lifting expression
3661         trees.
3662         
3663         * expression.cs (StringConcat): Implemented expression tree representation.
3664
3665 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3666
3667         * nullable.cs: When lifting null literal and a user operator exists, no call 
3668         is made.
3669         
3670 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3671
3672         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3673         null.
3674
3675 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3676
3677         * nullable.cs, expression.cs: Use namespace instead heavily nested
3678         monster abstract class.
3679
3680 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3681
3682         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3683         lifting of null literal and user operators. Clean up of some temporary
3684         nullable hacks.
3685
3686 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3687
3688         Fix #368224, test-629.cs
3689         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3690         if it crossed an unwind-protect boundary.
3691         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3692         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3693         inside an unwind-protected region.
3694         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3695         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3696         'leave' instead of a 'br' if unwind-protected.
3697         (Iterator.EmitYieldBreak): Likewise.
3698
3699 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3700
3701         * driver.cs: Only define versioninfo resources if no win32 resource
3702         file was specified.
3703
3704 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3705
3706         A fix for bug #372375
3707         * convert.cs: Fixed boxing of nullable types.
3708
3709 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3710
3711         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3712         type.
3713
3714 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3715
3716         A fix for bug #374619
3717         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3718         
3719 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3720
3721         * lambda.cs: Check return type only for invocation.
3722         
3723 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3724
3725         A fix for bug #374214
3726         * ecore.cs: Correctly report argument type mismatch.
3727
3728 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3729
3730         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3731         and not rely on broken IsEnum.
3732
3733 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3734
3735         * nullable.cs: New file, extracted from generic.cs.
3736         
3737         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3738
3739 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3740
3741         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3742         predefined comparison operators and null literals.
3743         
3744         * report.cs: New warning ID.
3745         
3746 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3747
3748         A fix for bug #370577
3749         * lambda.cs: Check return type too.
3750
3751 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3752
3753         A fix for bug #372846
3754         * class.cs: Automatic properties can be declared as unsafe.
3755
3756 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3757
3758         * location.cs: Use string based concatenation.
3759         
3760         * expression.cs: LiftedBinaryOperator is gmcs only.
3761         
3762 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3763
3764         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3765         conversions rules and expression trees.
3766
3767 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3768
3769         * delegate.cs: Use extension method source as delegate target.
3770
3771 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3772
3773         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3774         binary operations to be purely based on binary operations and optimized
3775         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3776         and other ET refactoring.
3777         
3778         * typemanager.cs: Fixed warning.
3779         
3780 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3781
3782         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3783         
3784         * symbolwriter.cs: Fixed.
3785
3786 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3787
3788         * anonymous.cs, driver.cs: Reset anonymous types counters.
3789
3790 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3791
3792         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3793         
3794         * class.cs: Use fullname for all type member definitions.
3795         
3796 2008-02-19  Martin Baulig  <martin@ximian.com>
3797
3798         * class.cs
3799         (IMethodData.EmitExtraSymbolInfo): New interface method.
3800         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3801         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3802         interface method here as an empty public virtual method.
3803
3804         * anonymous.cs
3805         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3806         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3807         CodeGen.SymbolWriter.SetRealMethodName().       
3808
3809 2008-02-18  Martin Baulig  <martin@ximian.com>
3810
3811         * anonymous.cs
3812         (ScopeInfo.EmitType): Override this and emit debugging
3813         information for captured variables.
3814         (RootScopeInfo.EmitType): Override this and emit symbol
3815         information for a captured `this'.
3816
3817 2008-02-15  Martin Baulig  <martin@ximian.com>
3818
3819         * iterators.cs: Emit debugging info.
3820
3821         * codegen.cs
3822         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3823         (EmitContext.OmitDebuggingInfo): New public property.
3824
3825         * statement.cs
3826         (While): Override Emit() and don't emit symbol info there; do it
3827         inside DoEmit() instead.
3828         (Block.Emit): Omit symbol information while emitting the scope
3829         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3830         block logic.
3831         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3832         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3833         .ctor to make `IsIterator' work.
3834
3835 2008-03-14  Martin Baulig  <martin@ximian.com>
3836
3837         * symbolwriter.cs: Added the new symbol writer function from the
3838         debugger's `terrania' branch; temporarily enclose them inside
3839         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3840         my vacations.
3841
3842 2008-03-14  Martin Baulig  <martin@ximian.com>
3843
3844         * symbolwriter.cs
3845         (SymbolWriter): Make this a public static class.
3846
3847         * codegen.cs
3848         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3849         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3850
3851 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3852
3853         A fix for bug #370577
3854         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3855         return type.
3856         
3857 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3858
3859         * typemanager.cs (CSharpName): Made 250 times faster.
3860
3861 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3862
3863         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3864         
3865 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3866
3867         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3868         crash when predefined field does not exist.
3869         
3870 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3871
3872         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3873         
3874 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3875
3876         * class.cs (FixedField): Don't crash when contructors are missing.
3877
3878 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3879
3880         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3881         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3882         check internal types accessibility for internal and external types.
3883         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3884
3885 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3886
3887         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3888         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3889         attribute.cs, statement: Use corect instance of predefined types (work
3890         related to #364674).
3891
3892 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3893
3894         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3895         
3896 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3897
3898         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3899         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3900         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3901         predefined types clean up, delayed predefined types members initialization
3902         (work related to #364674).
3903
3904 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3905
3906         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3907         
3908 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3909
3910         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3911         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3912         predefined types clean up (work related to #364674).
3913
3914 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3915
3916         * ecore.cs: Print an error message instead of throwing exception.
3917         
3918 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3919
3920         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3921         expression.cs, statement.cs: Unififed null literal representation.
3922
3923 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3924
3925         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3926         expression.cs: Refactored binary operators resolve phase and improved speed.
3927         The nullable code is still missing and won't work correctly, more fixes
3928         required.
3929
3930         It also fixes #323726, #324312, #324248, and many other unreported issues.
3931
3932 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3933
3934         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3935         instead of 'gmcs'.
3936
3937 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3938
3939         * ecore.cs: Clean-up and split BetterConversion.
3940         
3941 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3942
3943         Fix #363791
3944         * enum.cs (EnumMember.Value): Only access 'value' if
3945         ResolveValue says it's ok.
3946         (EnumMember.DoResolveValue): Don't set prev_member.value.
3947         (Enum.GetDefinition): Reverse arguments of Equals --
3948         EnumMember.Value can return 'null'.
3949
3950         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3951
3952 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3953
3954         * generic.cs, expression.cs: More ongoing work on expression trees.
3955         
3956 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3957
3958         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3959         handle missing matches when mutiple operators exist.
3960         
3961 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3962
3963         A fix for bug #363218
3964         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3965         initializers.
3966         
3967 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3968
3969         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3970         update. This time to deal correctly with SideEffectConstant expression used
3971         as an argument for another constant folding.
3972
3973 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3974
3975         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3976         MethodBuilder.
3977
3978 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3979
3980         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3981
3982 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3983
3984         A fix for bug #328136
3985         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3986         side is a false constant, because we still need to evaluate the right-hand
3987         side.
3988
3989         * statement.cs (If): Emit two types of boolean constants (simple constant,
3990         side-effect constant).
3991
3992 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3993
3994         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3995
3996         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3997         constants.
3998
3999 2008-02-18  Marek Safar  <marek.safar@gmail.com>
4000
4001         A fix for bug #361457
4002         * ecore.cs (IsApplicable): Params methods have lower priority.
4003
4004         * support.cs: Return correct parameter modifier for params types.
4005
4006 2008-02-18  Marek Safar  <marek.safar@gmail.com>
4007
4008         * generic.cs (TypeParameter): Cache attribute target name.
4009
4010         * support.cs: Removed unused variable.
4011
4012         * typemanager.cs: Removed debugging leftover.
4013
4014         * ecore.cs: Use local type instead of a property;
4015
4016         * class.cs (VerifyMembers): Consider also parent to test whether type member
4017         is local or public.
4018
4019         * expression.cs (FullMethodDesc): Removed.
4020
4021         * attribute.cs (IsValidArgumentType): Made static.
4022
4023 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
4024
4025         Cleanup to be more readable.
4026         * Makefile (GMCS_PROFILE): Remove.
4027         (COMPILER_NAME): New helper.
4028
4029 2008-02-15  Miguel de Icaza  <miguel@novell.com>
4030
4031         * cs-tokenizer.cs: if a conditional expression happens inside a
4032         (...) this also means that we do not need to de-ambiguate between
4033         an parenthesized expression and a cast.
4034
4035         Fixes 346484.
4036
4037         * constant.cs (SideEffectConstant): a constant value that happens
4038         to have a side effect.
4039
4040         Fixes the build regressions introduced by the fix for #359789
4041
4042 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
4043
4044         * expression.cs (Conditional.Emit): when emitting the ternary
4045         operator, use local variables to generate code verifiable code.
4046
4047         The verifier cannot infer that the type on stack before the
4048         stloc.0 is executed is of type ParentB. This happens because the
4049         stack merge algorithm uses only parent types when deciding which
4050         is the common type.  This is described in Part III 1.8.1.3 of ECMA
4051         335.
4052
4053         This code compiled with mcs is not verifiable under MS. The MS
4054         verifier picks the first common interface of Foo and Bar, which is
4055         wrong, but doesn't use a full join type of the 2 interfaces.
4056
4057         CSC uses a clever hack to compile such code in a verifiable
4058         way. It stores the intermediate values in a local variable with
4059         the expected type.
4060
4061         Fixes: #358102
4062
4063 2008-02-14  Miguel de Icaza  <miguel@novell.com>
4064
4065         * expression.cs: Do not fold BitwiseAnd operators when the left
4066         side is a false constant, because we still need to evaluate the
4067         right-hand side.
4068
4069         Fixes #359789
4070
4071         * support.cs: Instead of throwing an InternalErrorException when
4072         the position of the stream is outside the boundary of our buffer,
4073         reset the state of the reader, and restart the reading from the
4074         beginning of the file.
4075
4076 2008-02-14  Marek Safar  <marek.safar@gmail.com>
4077
4078         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
4079
4080 2008-02-14  Marek Safar  <marek.safar@gmail.com>
4081
4082         A fix for bug #361686
4083         * decl.cs: A protected types used inside a private class which parents
4084         derives from the protected class are accessible.
4085
4086 2008-02-13  Marek Safar  <marek.safar@gmail.com>
4087
4088         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
4089         the parameterless constructor.
4090
4091 2008-02-13  Marek Safar  <marek.safar@gmail.com>
4092
4093         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4094         lookup methods to use standard member cache when doing member lookup.
4095
4096 2008-02-12  Marek Safar  <marek.safar@gmail.com>
4097
4098         * driver.cs: Don't report full path for referenced module as assembly error.
4099
4100 2008-02-12  Marek Safar  <marek.safar@gmail.com>
4101
4102         * Makefile: Fixed `qh' target to work on all machines.
4103
4104         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4105         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4106         and HasElementType with TypeManager implementation.
4107
4108 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4109
4110         A fix for bugs #325134, #359749
4111         * expression.cs, ecore.cs: Try to resolve an extension method even if the
4112         first binds point to non-method member expression.
4113
4114 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4115
4116         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4117
4118 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4119
4120         A fix for bugs #321394, #323028
4121         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4122         Reworked naive IsAccessibleAs implementation to handle nested types.
4123
4124 2008-02-05  Jb Evain  <jbevain@novell.com>
4125
4126         * class.cs: use generic type comparison for parameters
4127         as well.
4128
4129 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4130
4131         A fix for bug #325372
4132         * class.cs: Use generic type comparison when testing method signatures.
4133
4134 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4135
4136         A fix for bug #357047
4137         * ecore.cs: Applied C# 3.0 changes to better conversion.
4138
4139 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4140
4141         A fix for bug #358374
4142         * cs-parser.jay: Correctly set modifiers for all constructor types.
4143
4144 2008-02-04  Marek Safar  <marek.safar@gmail.com>
4145
4146         A fix for bug #355251
4147         * generic.cs: Added base class constraint based type inference.
4148
4149 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4150
4151         A fix for bug #357255
4152         * decl.cs: One more missing visibility check.
4153
4154 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4155
4156         * support.cs: Fixed broken return.
4157
4158 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4159
4160         * report.cs: Correctly reset warnings count after probing.
4161
4162 2008-01-25  Martin Baulig  <martin@ximian.com>
4163
4164         * namespace.cs
4165         (NamespaceEntry.SymbolFileID): Make this work again after
4166         MemberName.ToString() is gone.
4167
4168 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4169
4170         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4171         expressions.
4172
4173 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4174
4175         * generic.cs: Use full implicit conversion for type inference fixing.
4176
4177 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4178
4179         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4180         Fixed user operator conversions.
4181
4182 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4183
4184         * generic.cs: Do nullable type to null comparison optimization during
4185         resolve phase.
4186
4187 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4188
4189         A fix for bug #355163
4190         * generic.cs: Enabled l-value resolve on nullable expressions.
4191
4192 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4193
4194         A fix for bug #353986
4195         * class.cs: Ingore static ctors with parameters for any further checks.
4196
4197 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4198
4199         A fix for bug #354310
4200         * namespace.cs: Removed redundant check.
4201
4202 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4203
4204         A fix for bug #354928
4205         * expression.cs: ElementInitializers can be resolved only once.
4206
4207 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4208
4209         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4210         Condition expressions.
4211
4212 2008-01-23  Marek Safar  <marek.safar@gmail.com>
4213
4214         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4215
4216 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4217
4218         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4219         not allowed.
4220
4221         * generic.cs: Implemented coalesce expression.
4222
4223 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4224
4225         A fix for bug #355145
4226         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4227         expression tree type inference.
4228
4229 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
4230
4231         Fix #354663
4232         * expression.cs (Binary.IsUnsignedType): Fix typo.
4233
4234 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4235
4236         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4237
4238 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4239
4240         A fix for bug #355161
4241         * ecore.cs, expression.cs: Wider range of extension method supported
4242         expressions.
4243
4244 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
4245
4246         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4247         AssemblyBuilder to operate in compiler context. Fixes mcs part of
4248         bug #354970.
4249
4250 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4251
4252         A fix for bug #355148
4253         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4254
4255 2008-01-22  Miguel de Icaza  <miguel@novell.com>
4256
4257         * expression.cs (CreateExpressionTree): Add support for or and
4258         logical or, and indent following the coding conventions.
4259
4260         * typemanager.cs (LinqExpression): renamed from
4261         ExpressionTreeManager, for a shorter name.
4262
4263         Use TypeManager.CoreLookupType to lookup types from our core
4264         assemblies and turn those into "Type" variables.
4265
4266         Consumers that previously used "Namespace" and "Type" from this
4267         class should instead use the TypeExpression which is a type that
4268         is fully resolved (without involving the regular C# resolution
4269         rules). 
4270
4271         This typically looks like this:
4272
4273         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4274         new MemberAccess (texpr, name, type_arguments, loc)
4275
4276         This avoids the problem in: #355178
4277
4278 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4279
4280         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4281         feature in parser only as we do in other cases.
4282         
4283 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4284
4285         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4286         typemanager.cs: A refactoring of params arguments to reuse existing
4287         expressions (params -> array initializer) to emit params argument instead
4288         of specialized handling.
4289         It was required by expression tree implementation and it has other benefits
4290         as well, we now apply same optimization for params arguments as we do for
4291         array initializers.
4292         
4293 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4294
4295         A fix for bug #353526
4296         * generic.cs: A type inference of params arguments may not required any
4297         temporary array creation.
4298         
4299 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4300
4301         A fix for bug #353534
4302         * generic.cs, ecore.cs, expression.cs: A method group type inference is
4303         supported for delegates only.
4304         
4305 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4306
4307         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4308         type for more than 1 candidates.
4309         
4310 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4311
4312         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4313         expressions.
4314         
4315 2008-01-16  Marek Safar  <marek.safar@gmail.com>
4316
4317         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4318         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4319         operator) expressions. 
4320                 
4321 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4322
4323         * statement.cs: Avoid declaring an IL variable for this_variable since it is
4324         not accessed from the generated IL.
4325
4326 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4327
4328         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4329         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4330         statement.cs: The first expression tree implementation drop, mostly
4331         infrastructure work.
4332
4333 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4334
4335         * ecore.cs (IsNestedChild): Refactored.
4336
4337 2008-01-11  Marek Safar  <marek.safar@gmail.com>
4338
4339         * lambda.cs: Don't use a cast on unknown expression statement.
4340
4341 2008-01-10  Geoff Norton  <gnorton@novell.com>
4342
4343         * cs-tokenizer.cs: One more token to distinguish between method and lambda
4344         arguments
4345
4346 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4347
4348         * doc.cs: Report better /doc crash details.
4349         
4350 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4351
4352         A fix for bug #352536
4353         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4354
4355 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4356
4357         A fix for bug #352287
4358         * ecore.cs, expression.cs: Do `this' access checking in all member access
4359         expressions.
4360         
4361 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4362
4363         * rootcontext.cs, driver.cs: Switch to linq mode by default.
4364         
4365         * report.cs: Reset message stacks.
4366         
4367 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4368
4369         * generic.cs (InferInPhases): Correctly calculate params position.
4370         
4371 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4372
4373         * cs-tokenizer.cs: No need to parse full string when parsing lambda
4374         arguments.
4375
4376 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4377
4378         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4379         
4380         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4381         
4382         * driver.cs: Updated --help option.
4383         
4384 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4385
4386         * generic.cs (InferParamsTypeArguments): Removed.
4387         (InferInPhases): Add params type inference.
4388         (LowerBoundInference): Fixed scoring mechanism.
4389         
4390         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4391         
4392 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
4393
4394         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4395         byte array for unsigned "baked" assemblies.
4396
4397 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
4398
4399         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4400         array for assemblies that are not strongnamed.
4401
4402 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4403
4404         A fix for bug #351481
4405         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4406         declaring type for nested generic types.
4407         
4408 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4409
4410         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4411         instead of ToString.
4412         
4413 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4414
4415         A fix for bug #351047
4416         * expression.cs (Binary.ResolveOperator): Allow equality operators between
4417         null and structs only when equality and inequality operators are defined
4418         either as an user-operators or predefined operators.
4419         
4420 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4421
4422         A fix for bug #351047
4423         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4424         
4425 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4426
4427         A fix for bug #351257
4428         * cs-tokenizer.cs: Advance line number for '\r' correctly.
4429         
4430 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4431
4432         A fix for bug #351157
4433         * class.cs (Using): Fixed yet another broken cloning.
4434         
4435         (Block): Put back more sensible default value for statements.
4436         
4437 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
4438
4439         * codegen.cs: Allow AssemblyVersion with only major version component.
4440         Fixes bug #351055.
4441
4442 2007-12-29  Marek Safar  <marek.safar@gmail.com>
4443
4444         A fix for bug #324654
4445         * class.cs: Use FullName property as member name.
4446
4447 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4448
4449         A fix for bug #342117
4450         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4451         constructor constraint.
4452
4453 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4454
4455         A fix for bug #338273
4456         * class.cs (ProbertyBase): Access modifier checks are required for overrides
4457         only.
4458
4459 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4460
4461         A fix for bug #350839
4462         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4463
4464 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4465
4466         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4467         GHOP:
4468         
4469         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4470
4471         * statement.cs: Changed some Hashtables to use HybridDictionaries
4472         instead. It was observed that some HashTables only contained a few
4473         items in the vast majority of cases. Since HybridDictionary is
4474         more efficient on small sets (<10 elements), "known_variables"
4475         from class ExplicitBlock as well as "labels" and "constants " from
4476         class Block were changed to HybridDictionaries. 
4477
4478         Atsai results: (56216kb->54987kb)
4479
4480         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4481
4482
4483 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4484
4485         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4486         GHOP:
4487         
4488         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4489         
4490         * expression.cs: foreach loop to for loop, saved on allocation of
4491         enumerator (59333kb->59141kb)
4492
4493         * statement.cs. Changed foreach loops to for loops, saved on
4494         allocation of enumerator (59141kb->59006kb)
4495
4496         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4497         when constructed with no specified capacity. This was causing a
4498         few ArrayLists to allocate more memory than they would potentially
4499         need in the Block class and MemberCache class. Setting the
4500         ArrayLists to construct with a capacity of 1 saves some
4501         memory. (56216kb->55585kb)
4502
4503 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4504
4505         A fix for bug #347189 (2nd issue)
4506         * expression.cs (MemberAccess): Nested type can be found in base non-generic
4507         type.
4508
4509 2007-12-27  Miguel de Icaza  <miguel@novell.com>
4510         
4511         * report.cs: Do not use colors if stdout and stderr are not a
4512         terminal.
4513
4514 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4515
4516         A fix for bug #346998
4517         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4518         overloads.
4519
4520 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4521
4522         A fix for bug #343465
4523         * class.cs: Explicit method name for nested types uses dots only.
4524
4525 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4526
4527         A fix for bug #343707
4528         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4529
4530 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4531
4532         * ecore.cs: Report type inference errors only when arguments count matches
4533         parameter count.
4534         
4535         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4536         
4537         * expression.cs, report.cs: New warning.
4538         
4539         * typemanager.cs: Catch anonymous method type too.
4540
4541 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4542
4543         A fix for bug #346379
4544         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4545
4546 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4547
4548         A fix for bug #347359
4549         * expression.cs (Invocation): Don't resolve already resolved expression.
4550
4551 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4552
4553         A fix for bug #347189
4554         * class.cs (FixedField): Use non-dependent code only in the define phase.
4555
4556 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4557
4558         A fix for bug #348076
4559         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4560
4561 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4562
4563         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4564         discovered extension methods.
4565
4566 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4567
4568         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4569         method.
4570
4571 2007-12-21  Miguel de Icaza  <miguel@novell.com>
4572
4573         * report.cs (ErrorMessage): Add support for using colors on
4574         terminals that support it. 
4575
4576 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4577
4578         * ecore.cs: Use information about expanded params for error reporting.
4579
4580 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4581
4582         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4583         and logic for params overloads.
4584         
4585 2007-12-15  Miguel de Icaza  <miguel@novell.com>
4586
4587         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4588         as this is also created from the parser.  Fixes #349034
4589
4590 2007-12-12  Miguel de Icaza  <miguel@novell.com>
4591
4592         * statement.cs (Throw.CloneTo): it is valid to have empty
4593         expressions for throw. 
4594
4595 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4596
4597         * cs-parser.jay: Set delegate constraint parsing region correctly.
4598
4599 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4600
4601         A fix for bug #345467
4602         * typemanager.cs (IsEqual): Compare generic parameters position only.
4603         
4604 2007-11-28  Marek Safar  <marek.safar@gmail.com>
4605
4606         * expression.cs (BaseAccess): Type arguments can be null.
4607
4608 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4609
4610         * statement.cs (Block.Resolve): Ensure flow-branching tree is
4611         consistent even when an error has occured.
4612         (Switch.Resolve): Likewise.
4613
4614 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4615
4616         A fix for bug #334505
4617         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4618         overrides.
4619         
4620 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4621
4622         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
4623         refactorings required to resolve extension methods correctly when mixing
4624         generics and non-generics members.
4625         
4626 2007-11-20  Marek Safar  <marek.safar@gmail.com>
4627
4628         A fix for bug #342584
4629         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4630         conversion.
4631         
4632 2007-11-19  Marek Safar  <marek.safar@gmail.com>
4633
4634         A fix for bug #342512
4635         * delegate.cs: Use delegate argument expression when is available. Don't
4636         emit virtual call when class is sealed.
4637         
4638 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4639
4640         A fix for bug #325423
4641         * assign.cs (FieldInitializer): Use resolved expression for emit.
4642         
4643         * class.cs: Print less confusing error message.
4644         
4645 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4646
4647         * cs-tokenizer.cs: Removed GMCS ifdefs.
4648         
4649         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4650         mcs.
4651         
4652         * cs-parser.jay: Disabled nullable check.
4653         
4654         * generic-mcs: Copied more generic stuff.
4655                 
4656 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4657
4658         * gcs-parser.jay: Merged to cs-parser.jay.
4659         
4660         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4661         * *.csproj, *.sources: Updated to use only jay parser file.
4662
4663 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4664
4665         * gcs-parser.jay: Added nullable and default expression feature checks.
4666         
4667 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4668
4669         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4670         it fixes many TODOs and hidden bugs.
4671         
4672         * expression: Removed duplicate error check.
4673
4674 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4675
4676         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4677         implicitly type local variable only when it is used in a declaration.
4678
4679 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4680
4681         * attribute.cs: Use CS0612 for empty strings.
4682
4683 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4684
4685         * lambda.cs, statement.cs: Contextual return may act as a statement.
4686
4687 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4688
4689         A fix for a regression cause by #324222
4690         * class.cs: Don't report unused even when it implements an interface.
4691         
4692 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4693
4694         A fix for bug #341205
4695         * ecore.cs, expression.cs: Method group expression cannot do static
4696         method access with an instance reference check before overloading takes
4697         a place.
4698         
4699 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4700
4701         A fix for bug #325359
4702         * class.cs: Use predictable name for automatically generated property.
4703         
4704 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4705
4706         A fix for bug #324996
4707         * expression.cs (Is): Handle case where D is nullable and T is not
4708         correctly.
4709         
4710         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4711         
4712 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4713
4714         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4715         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4716         Flush small error reporting changes.
4717         
4718 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4719
4720         A fix for bug #324996
4721         * expression.cs: Rewrote Is expression implementation to work with
4722         generics, nullable types, anonymous method. A const result expression 
4723         uses existing infrastructure instead of custom not fully-featured one.
4724         
4725 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4726
4727         A fix for bug #340202
4728         * class.cs: Consider generics for volatile field.
4729
4730 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4731
4732         A fix for bug #335594
4733         * expression.cs: Use conversion rules when handling string addition.
4734         
4735 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4736
4737         A fix for bug #336651
4738         * expression.cs: Fixed a crash when probing is on.
4739         
4740 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4741
4742         A fix for bug #324242
4743         * covert.cs: Added a conversion from any nullable-type with an 
4744         underlying enum-type to the type System.Enum.
4745         
4746 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4747
4748         A fix for bug #324222
4749         * class.cs: Report all non-used event fields.
4750         
4751 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4752
4753         A fix for bug #325161
4754         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4755         qualifier for generic types.
4756         
4757 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4758
4759         A fix for bug #322971
4760         * expression.cs, ecore.cs: Added intermediate result value check for
4761         indexers. 
4762         
4763 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4764
4765         A fix for bug #324754
4766         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4767         when it was requested.
4768
4769 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4770
4771         A fix for bug #325101
4772         * expression.cs: Do type not value comparison for `is' expression.
4773
4774 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4775
4776         A fix for bug #320236
4777         * convert.cs: Don't apply user conversion on underlying target type.
4778
4779 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4780
4781         * expression.cs: Don't use unresolved expression for error reporting.
4782  
4783 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4784
4785         A fix for bugs #337712, #324490
4786         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4787         overloading resolution too.
4788         
4789         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4790         the process consistent and more robust.
4791         
4792         * expression.cs, linq.cs, report.cs: Update.
4793
4794 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4795
4796         A fix for bug #332909
4797         * attribute.cs: Resolve attributes in correct context using error
4798         handling procedure.
4799         
4800         * rootcontext.cs: Define Obsolete attribute members as core members.
4801         
4802 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4803
4804         * statement.cs: Removed unused methods.
4805         
4806 2007-10-31  Wade Berrier  <wberrier@novell.com>
4807
4808         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4809         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4810         during 'make dist')
4811
4812 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4813
4814         A fix for bug #338102
4815         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4816         methods registered as non-generics.
4817         
4818 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4819
4820         A fix for bugs #337712, #324490
4821         * delegate.cs: Delegate covariance and contravariance is not allowed for
4822         value types.
4823         
4824 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4825
4826         A fix for bug #337719 
4827         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4828         `from' keyword.
4829         
4830 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4831  
4832         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4833
4834 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4835  
4836         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4837         query expressions.
4838
4839 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4840
4841         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4842
4843 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4844  
4845         A fix for bug #334652
4846         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4847         extension methods when we have not found the best candidate in normal
4848         container.
4849
4850 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4851
4852         * AssemblyInfo.cs: Keep up-to-date.
4853
4854 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4855
4856         * Makefile: Fixed generics compiler name.
4857         
4858 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4859
4860         * lambda.test: removed, lambda parsing is done differently.
4861         
4862         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4863
4864 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4865
4866         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4867
4868 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4869
4870         * Makefile, *.sources : All C# compilers are in mcs folder.
4871         
4872         * *.cs: Use existing 2_1 define for smcs.
4873
4874 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4875
4876         A fix for bug #335847
4877         * assign.cs, expression.cs: Couple of changes to avoid creating a
4878         temporary variable for each object initializer assignment statement. It
4879         simplifies struct initialization too, otherwise two temporary variables
4880         would be required.
4881         Implemented optimization of redundant default element initializers.
4882         
4883 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4884
4885         A fix for bug #336766
4886         * expression.cs (Class.CheckBase): Use generic name when method is
4887         generic.
4888         
4889 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4890
4891         A fix for bug #334737
4892         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4893         variable and not variable argument for prepared copies.
4894
4895 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4896
4897         A fix for bug #325110
4898         * class.cs, expression.cs, attribute.cs: Use open generic method when
4899         checking conditional attribute.
4900         
4901 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4902
4903         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4904         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4905         FeatureIsNotAvailable.
4906
4907 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4908
4909         ** C# 3.0 Partial methods
4910         
4911         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4912         methods support. Because of member cache issue with generics only
4913         non-generics partial methods are fully supported.
4914         
4915 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4916         
4917         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4918         generics and to use member cache for member checking. It also improves
4919         performance and fixes remaining overloads issues.
4920         
4921 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4922         
4923         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4924         roottypes.cs, typemanager.cs:
4925                 
4926         A member cache creation logic changed to add members immediately and
4927         not rely on fallback. The member cache is now only prefered way
4928         how to access and find type declaration members. It saves 5 MB of memory
4929         during MWF compilation and makes code ready for more optimizations and
4930         clean-ups, it's also a pre-requirement for partial methods.
4931         
4932 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4933
4934         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4935         handling for generic parameters.
4936
4937 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4938         
4939         * class.cs (FixedField): Removed redundant volatile check.
4940         
4941 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4942         
4943         * class.cs, decl.cs: Fixed overload members verification to do only one
4944         check per possible collision.
4945         
4946 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4947         
4948         A fix for bug #325478
4949         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4950         and create only one disposable flags container.
4951         
4952 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4953         
4954         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4955         * statement.cs (Fixed): Fixed variables cloning.
4956         
4957 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4958         
4959         A fix for bug #333342
4960         * class.cs (EventField): Don't mark value type event as synchronized. 
4961         
4962 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4963         
4964         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4965         inference to identify best candidate method correctly.
4966         (ProperyExpr): A range variable is read only and cannot be modified.
4967         
4968 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4969         
4970         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4971         logic to identify best candidate method correctly.
4972         
4973 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4974         
4975         * location.cs (Equals, GetHashCode): Removed.
4976         
4977 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4978         
4979         * report.cs: Implemented message recorder. It is used mainly for lambda
4980         expressions to capture otherwise swallowed error messages.
4981         
4982         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4983
4984         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4985         and not at the top.
4986         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4987                 
4988         * expression.cs (MemberAccess): Always report lookup failure.
4989         
4990         * location.cs: Implemented Equals, GetHashCode.
4991         
4992         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4993         
4994 2007-10-10  Jb Evain  <jbevain@novell.com>
4995
4996         * codegen.cs: re-enable assembly version check.
4997
4998 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4999         
5000         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
5001         checks.
5002         
5003         * namespace.cs (UsingAlias): Do correct version check.
5004         
5005 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5006         
5007         * expresison.cs, ecore.cs: Issue extension method error message when
5008         appropriate.
5009         
5010         * rootcontext.cs: Added ISO_2 compiler mode option.
5011
5012 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5013         
5014         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
5015          message.
5016         
5017 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5018         
5019         * attribute.cs (GetString, GetBoolean): Work with both literal and
5020         constant.
5021         
5022         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
5023         Moved method overload specific methods to MethodGroupExpr.
5024         
5025         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
5026         it should be less memory consuming.
5027         
5028 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5029
5030         * codegen.cs: remove the assembly version check until the buildbot is
5031         fixed.
5032
5033 2007-10-07  Jb Evain  <jbevain@novell.com>
5034
5035         * attribute.cs (Attribute.GetString): if the value
5036         expression is a StringConstant, return its string value.
5037
5038 2007-10-07  Jb Evain  <jbevain@novell.com>
5039
5040         * typemanager.cs: add `assembly_version_attribute_type`.
5041         * codegen.cs: on attribute emission, check that the
5042         AssemblyVersionAttribute doesn't overflow.
5043
5044 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5045         
5046         A fix for bug #324677
5047         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
5048         parent container of a scope container with currently resolved one. 
5049         
5050 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5051         
5052         A fix for bug #325534
5053         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
5054         only.
5055         
5056 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5057         
5058         A fix for bug #327504
5059         * class.cs (Operator.Define): Refactored implicit and explicit user
5060         operator conversion rules.
5061         
5062 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5063         
5064         A fix for bug #327520
5065         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
5066         
5067 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5068         
5069         A fix for bug #328022
5070         * class.cs (MethodData.Define): Use correct method to check whether
5071         a method implementents an accessor.
5072         
5073 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5074         
5075         A fix for bug #330069
5076         * statement.cs (Fixed.Resolve): Read the first array element only when
5077         an array is instantiated. 
5078         
5079 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5080         
5081         * expression.cs, assign.cs, generics.cs: Print correct operator when
5082         compound assignment is used.
5083         
5084 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5085         
5086         A fix for bug #325841
5087         * expression.cs (ArrayAccess): Use full argument cloning only for
5088         string compound concatenation.
5089         
5090 2007-10-03  Marek Safar  <marek.safar@gmail.com>
5091         
5092         A fix for bug #328774
5093         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5094         assignment.
5095         (PropertyExpr.EmitAssign): Fixed string concatenation compound
5096         assignment.
5097
5098 2007-10-03  Raja R Harinath  <rharinath@novell.com>
5099
5100         Fix #328490
5101         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5102         Event accessibility checks here.  Remove some bogus code that
5103         accidently made GenericMethods work.
5104         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5105
5106 2007-09-25  Marek Safar  <marek.safar@gmail.com>
5107         
5108         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5109         
5110         * statement.cs (Block): Refactored AddVariable to allow error handling
5111         customization.
5112         
5113         * generic.cs: New stub.
5114         
5115 2007-09-23  Marek Safar  <marek.safar@gmail.com>
5116         
5117         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5118         flag.
5119         
5120 2007-09-17  Marek Safar  <marek.safar@gmail.com>
5121
5122         * class.cs: Use partial container to record whether any partial part
5123         contains static field initializer and therefore default contructor has
5124         to be defined.
5125         
5126 2007-09-14  Marek Safar  <marek.safar@gmail.com>
5127
5128         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5129         mono-list when only one of two partial parts has defined accessibility
5130         modifier.
5131         
5132 2007-09-14  Marek Safar  <marek.safar@gmail.com>
5133
5134         A fix for bug #82845
5135         
5136         * class.cs (TypeContainer): Set correct resolve context for all field
5137         initializers.
5138         
5139 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5140
5141         * assign.cs: Fixed a crash when field is resolved twice with an error.
5142         
5143         * codegen.cs: Changed InFieldInitializer to be flag.
5144         
5145         * anonymous.cs, ecore.cs, expression.cs: Update after
5146         IsInFieldInitializer rename.
5147         
5148         * const.cs: Removed unused parameter.
5149         
5150         * class.cs: Changed the way how we resolve and emit field initializers.
5151         The field initilizers have to have access to contructor block to emit
5152         compiler generated code.
5153
5154 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5155
5156         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5157         generics use TypeContainer instead.
5158         
5159 2007-09-12  Marek Safar  <marek.safar@gmail.com>
5160         
5161         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5162
5163         * lambda.cs (ResolveParameters): Use more powerful
5164         InflateGenericArgument.
5165         
5166         * parameters.cs: Better exception message.
5167                 
5168 2007-09-10  Marek Safar  <marek.safar@gmail.com>
5169
5170         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5171         correct expression block type. 
5172         
5173         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5174         
5175         * expression.cs (Invocation): Extracted method group resolve to
5176         DoResolveOverload.
5177         
5178 2007-09-07  Marek Safar  <marek.safar@gmail.com>
5179
5180         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5181         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5182         
5183         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5184         generic extension methods.
5185
5186 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5187
5188         A fix for bug #82676 (Do I get it right now?)
5189         * convert.cs (Binary.ResolveOperator): An interface is converted to the
5190         object before a standard conversion is applied.
5191         
5192 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5193
5194         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5195         #82676.
5196         
5197 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5198
5199         A fix for bug #82676
5200         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5201         non-generic interface types.
5202         
5203 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5204
5205         A fix for bug #82690
5206         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5207         
5208 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5209
5210         A fix for bug #82571
5211         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
5212         modifier for container based methods.
5213         
5214 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5215
5216         A fix for bug #82676
5217         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5218         any interface-type T means to any of interface type T.
5219
5220 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5221
5222         * namespace.cs: We have 2 versions of System.Core assembly.
5223
5224 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5225
5226         A fix for bug #82652
5227         * class.cs (Class.GetClassBases): Compare types and not expressions.
5228
5229 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5230
5231         A fix for bug #82620
5232         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5233         actually never worked before.
5234         (IndexerAccess): Emit prepared arguments before they are modified.
5235         
5236 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5237
5238         A fix for bug #82563
5239         * assign.cs: Revert wrong fix.
5240         
5241         * expression.cs (VariableReference.EmitAssign): Handle ref reference
5242         correctly.
5243         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5244         Instead of ldelema/stdind we have to use temporary variables to handle
5245         cases like String.Concat (params string[]).
5246         
5247 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5248
5249         * class.cs: EmitAttributes to Emit rename.
5250         
5251         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5252         null.
5253         (MemberCore.HasClsCompliantAttribute): Don't depend on 
5254         GetClsCompliantAttributeValue execution.
5255         
5256 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5257
5258         * anonymous.cs: Use shorter type prefix.
5259         
5260         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5261         when exist.
5262         
5263         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5264         variables when probing is on.
5265         
5266         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
5267         unresolved variables.
5268         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5269         handle transparent identifiers.
5270         
5271 2007-08-26  Marek Safar  <marek.safar@gmail.com>
5272
5273         * attribute.cs (IsClsCompliant): Add nullable types test.
5274         
5275 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5276
5277         * doc.cs : catch other types of exception than XmlException to
5278           report CS1570. Fixed bug #82565.
5279
5280 2007-08-23  Marek Safar  <marek.safar@gmail.com>
5281
5282         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
5283         The number of delegate parameters has to match.
5284         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5285         arrays.
5286
5287 2007-08-21  Marek Safar  <marek.safar@gmail.com>
5288
5289         * anonymous.cs (AnonymousMethod): Generate private anonymous method
5290         to fix problem with private arguments.
5291
5292 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5293
5294         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5295         
5296         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
5297         
5298         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5299         empty. Add cloning suport.
5300         
5301         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5302
5303 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5304
5305         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
5306         to create EmptyCast. It handles EmptyConstantCast specialization for
5307         constants.
5308         
5309 2007-08-18  Marek Safar  <marek.safar@gmail.com>
5310
5311         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5312         (EmitArrayArgument): One routine for array arguments.
5313         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
5314         
5315 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5316
5317         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5318
5319 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5320
5321         * anonymous.cs: MemberLookupFinal update.
5322
5323         * class.cs (ConstructorInitializer): Is expression based.
5324         
5325         * delegate.cs: MethodGroupExpr update.
5326         
5327         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
5328         messages.
5329         (Error_MemberLookupFailed): Customizable error override.
5330         (MethodGroupExpr): Keep queried type for later usage.
5331         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5332         resolve.
5333         
5334         * expression.cs: Error_MemberLookupFailed refactoring.
5335         (New.DoResolve): Resolve as much as possible.
5336         (ElementInitializer.Error_MemberLookupFailed): Object initializer
5337         customization for invalid member types.
5338
5339         * statement.cs: MethodGroupExpr update.
5340         
5341 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5342
5343         * modifier.cs (Check): Check all modifiers and not only accessibility
5344         ones.
5345
5346 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5347
5348         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5349         type and not an expression.
5350
5351 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5352
5353         * statement.cs (Catch.Clone): Type and variable can be null.
5354
5355 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5356
5357         A fix for bug #81979
5358         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5359         I am really not sure whether this is the best fix.
5360         
5361         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5362         only once.
5363         
5364 2007-08-14  Marek Safar  <marek.safar@gmail.com>
5365
5366         ** C# 3.0 Object and collection initializers (major re-write)
5367         
5368         * assign.cs (DoResolve): Initializers are not assign related.
5369         
5370         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5371         used during collection or object initialization.
5372         
5373         * expression.cs (Error_InvalidArguments): Add initializers specific
5374         messages. More will come later because it requires some general
5375         refactoring.
5376         (New.DoResolve): Better error handling for unsafe types.
5377         (EmptyExpressionStatement): New class.
5378         (ElementInitializer): An object initializer expression.
5379         (CollectionElementInitializer): A collection initializer expression.
5380         (CollectionOrObjectInitializers): A block of object or collection
5381         initializers.
5382         (NewInitialize): New expression with element/object initializers.
5383         
5384         * statement.cs: Reverted object/collection initializer hacks.
5385         
5386         * typemanager.cs (CSharpName): Filter __arglist type.
5387         
5388 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5389
5390         ** C# 3.0 Anonymous Types (update to the latest standard)
5391         
5392         * expression.cs (Binary.ResolveOperator): Threat all null based types
5393         same.
5394         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5395         (AnonymousTypeParameter): Updated.
5396         
5397         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5398         (AnonymousTypeClass): New anonymous type container.
5399         
5400         * class.cs (AddField): Return operation result.
5401         
5402         * generic.cs: Another empty TypeArguments overload.
5403         
5404         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5405         are stored at top of normal hierarchy.
5406         
5407         * typemanager.cs (CSharpName): Filter anonymous types.
5408         
5409 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5410
5411         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5412         as single Concat call. How could we miss that :-(
5413         
5414 2007-08-08  Marek Safar  <marek.safar@gmail.com>
5415
5416         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5417         
5418 2007-08-07  Miguel de Icaza  <miguel@novell.com>
5419
5420         * expression.cs: Fix the previous commit, the creation of the
5421         arguments array list needs also to be conditional on the arguments
5422         not being null.
5423
5424         * class.cs: Add a little bit of help to help narrow down problems.
5425
5426         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5427         not try to copy in that case. 
5428
5429         * driver.cs: When building SMCS, include a new different set of
5430         default assemblies here.   Do this here so we can control whether
5431         to include the default assemblies with /noconfig.
5432
5433 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5434
5435         A fix for bug #81979
5436         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5437         only.
5438
5439 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5440
5441         A fix for bug #82300
5442
5443         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5444         we are in probing scope.
5445
5446 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5447
5448         A fix for bug #82301
5449
5450         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5451         (Statement.CloneTo): Clone and not map children blocks.
5452
5453 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5454
5455         A fix for bug #82299
5456
5457         * expression.cs (LocalVariableReference.CloneTo): Remap local info
5458         variable too.
5459         
5460         * statement.cs (Statement.CloneTo): Clone variables before statements
5461         to allow remaping of local variables.
5462
5463 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5464
5465         A fix for bug #82296
5466
5467         * anonymous.cs,
5468         * report.cs: Log crash details for future clone problems.
5469         
5470         * statement.cs (Return.Clone): Don't clone non-existent expression.
5471
5472 2007-08-03  Raja R Harinath  <harinath@gmail.com>
5473
5474         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5475         (Class.AddBasesForPart): Move CS0537 check here from ...
5476         * cs-parser.jay (class_declaration): ... here.  Move calling of
5477         'AddBasesForPart' to ...
5478         (class_bases): ... here.
5479         (struct_declaration, interface_declaration): Update to changes.
5480
5481 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5482
5483         A fix for bug #81923
5484
5485         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5486         conversion is allowed.
5487
5488 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5489
5490         A fix for bug #81564
5491
5492         * ecore.cs (EventExpr): Add IsBase handling.
5493
5494         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5495         too.    
5496         
5497 2007-08-02  Raja R Harinath  <harinath@gmail.com>
5498
5499         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5500         * cs-parser.jay: Some whitespace cleanups.
5501         (current_delegate): New.
5502         (type_name): New.
5503         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5504         a dummy code block, and use 'type_name' instead of 'member_name'.
5505         (interface_declaration, class_declaration): Likewise.
5506         (delegate_declaration): Likewise.  Rearrange slightly and use
5507         'current_delegate'.
5508         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5509         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
5510
5511 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5512
5513         A fix for bug #82039
5514
5515         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5516         available.
5517
5518         * typemanager.cs (CSharpName): Split to string overload.
5519
5520 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5521
5522         * expression.cs,
5523         * report.cs: Updated warning CS0472.
5524
5525 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5526
5527         A fix for bug #82181
5528         * cs-parser.jay,
5529         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5530
5531 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5532
5533         A fix for bug #82277
5534         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5535
5536 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5537
5538         ** C# 3.0 Type Inference (major bits are working)
5539         
5540         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5541         (.ImplicitStandardConversionExists): Uses compatible.
5542         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5543         (.InferReturnType): New method.
5544         (.Compatible): Refactored.
5545         (.ResolveParameters): Uses factory to create resolved parameters.
5546         (.CompatibleMethod): Add probing mode support.
5547         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5548         clearly distinguish between 2 different operations.
5549         (LambdaMethod): Moved to lambda.cs.
5550         (AnonymousMethod): Removed unused fields and methods.
5551         (AnonymousDelegate): Simplified.
5552         
5553         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5554         
5555         * convert. cs (ImplicitConversionStandard): Compatible works differently.
5556         
5557         * delegate.cs (Delegate): New mehods to reduce code duplication.
5558         (.GetConstructor): New method.
5559         (.GetInvokeMethod): New method.
5560         (DelegateCreation): Updated.
5561         
5562         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5563         does not exist.
5564         (OverloadResolve): Made probing little bit faster.
5565         
5566         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5567         when probing is on.
5568         
5569         * generic.cs (TypeInferenceContext): Dummy implementation.
5570         
5571         * iterators.cs: Updated after Resolve/Define rename.
5572         
5573         * lambda.cs (LambdaExpression)
5574         (.ResolveParameters): Handles both type of arguments and type inference too.
5575         
5576         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5577         (InflateTypes): Updated.
5578         
5579         * support.cs (InflateTypes): Changed signature and updated.
5580         
5581         * typemanager.cs (LookupMemberCache): Better dynamic type check.
5582         (MemberLookup_FindMembers): More MS tricks.
5583         (GetParameterData): Ditto.
5584         (GetDelegateParameters): Uses quick path for dynamic types.
5585         
5586 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5587
5588         * class.cs (MethodData.Define): EmitContext is required for generic stuff
5589         only.
5590
5591 2007-07-31  Marek Safar  <marek.safar@gmail.com>
5592
5593         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5594         syntax.
5595         
5596 2007-07-26  Jb Evain  <jbevain@novell.com>
5597
5598         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5599         which takes a boolean 'report_errors', similar to the GetMethod.
5600         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5601         in .net 2.1, do not report errors here.
5602
5603         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5604         System.Runtime.CompilerServices.RequiredAttributeAttribute and
5605         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5606         in .net 2.1.
5607
5608         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5609         of the type InternalsVisibleToAttribute before the first call
5610         to CoreLookupType which is allowed to fail (third boolean parameter
5611         to true). Because, during the resolution for a type that is not
5612         immediately found, we try to check if the type is not defined in
5613         a friend assembly, and to do so, we need the
5614         InternalVisibleToAttribute.
5615
5616 2007-07-23  Miguel de Icaza  <miguel@novell.com>
5617
5618         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5619         feature that allows structs to be compared against null and inline
5620         the result as true or false.
5621
5622         Notice that the same code is not permitted inside a generic block
5623         of code that would do:
5624
5625         class Foo<T> where T : struct {
5626             bool Eval (T x)
5627             {
5628                  return x == null;
5629             }
5630         }
5631
5632         It is only allowed if the type of T is not bound (no where
5633         clause).   In my opinion, this CSC 2 behavior is broken but people
5634         seem to be using it (IronRuby does, a few bug reports on bugzilla
5635         have it and some people have complained about it).
5636
5637         All of the users that depend on this behavior have code that is
5638         very likely broken. 
5639         
5640         * report.cs (Warning, Error): make these take object arguments,
5641         not strings, as that allows us to take advantage of Format.
5642
5643 2007-07-20  William Holmes  <billholmes54@gmail.com>
5644
5645         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
5646           Left member variable for the Count.
5647         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
5648           MemberName.CountTypeArguments to avoid a NRE. 
5649
5650         This code is contributed under the MIT X11 license
5651
5652 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5653
5654         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5655
5656 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5657
5658         * doc.cs : generic method arguments are written as ``x while generic
5659           type arguments are `x. Combined with the previous change, fixed bug
5660           #79706.
5661
5662 2007-07-18  Raja R Harinath  <rharinath@novell.com>
5663
5664         Fix #82120
5665         * expression.cs (Binary.ResolveOperator): When converting
5666         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5667
5668 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5669
5670         * doc.cs : when T: or whatever x: is specified, it does not really
5671           check the doc comment's syntax correctness. Fixed bug #82006.
5672
5673 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5674
5675         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5676         LambdaExpression better.
5677         
5678         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5679         
5680         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5681         
5682         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5683         as it can be generated.
5684         
5685         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5686         modifiers.
5687         
5688         * lambda.cs (LambdaExpression): Refactored to share same code with
5689         AnonymousMethodExpression.
5690         
5691 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5692
5693         * anonymous.cs (MakeName): Include host name for easier debugging.
5694         (LambdaMethod): New class for lambda spcecific stuff.
5695         
5696         * attribute.cs: Set EmitContext return type.
5697
5698         * class.cs: Set EmitContext return type.
5699         
5700         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5701         with null/void meaning.
5702         
5703         * iterators.cs (ContainerType): Implemented.
5704         
5705         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5706         
5707         * statement.cs (Return): Updated to lambda expressions.
5708         (Block.CloneTo): Parent can be null.
5709                 
5710 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5711
5712         A fix for bug #81917
5713         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5714         
5715         * class.cs (FixedField): Check whether field is in unsafe scope.
5716
5717         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5718         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5719
5720         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5721         FieldExpr.
5722         
5723         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5724                 
5725 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5726
5727         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5728         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5729         from Report class.
5730
5731 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5732
5733         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5734         
5735 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5736
5737         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5738         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5739         
5740         * codegen.cs(EmitContext): Add ProbingMode flag.
5741         
5742         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5743         
5744         * driver.cs: For now set both warning values.
5745         
5746         * ecore.cs (SimpleName): Name is readonly.
5747         (MethodGroup.OverloadResolve): One quick path for probing.
5748         
5749         * expression.cs (Unary): Set Oper r/o.
5750         (Binary): Set Oper r/o.
5751         (ParameterReference): Set few instance variables as r/o.
5752         (ParameterReference.DoResolveBase): Don't capture aruments when 
5753         the probing is on.
5754         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5755         (Arglist): arguments are private.
5756         (SizeOf): type is private and r/o.
5757         (MemberAccess): arguments are private.
5758
5759         * report.cs: Enhanced reporting on/off capabilities.
5760         
5761         * lambda.cs: Uses ec.IsInProbingMode.
5762         (ContextualReturn): Derives from return.
5763         
5764         * rootcontext.cs: For now set both warning values.
5765         
5766         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5767         copy if one exists.
5768         (Return.Resolve): Don't die immediately.
5769         (Block.Resolve): Speed-up probing.
5770         (Block.CloneTo): Clone only child blocks.
5771
5772 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5773
5774         * iterators.cs: reverted Miguel's latest change (r81925) as it
5775         breaks the build in System.
5776
5777 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5778
5779         * iterators.cs (Yield.CheckContext): Check for the iterator type
5780         also here as we can call into Yield even in codepaths that are not
5781         directly checked by
5782         (MethodOrOperator is the only path that was checked).
5783
5784         In addition to the standard check, use a more specific check for
5785         constructors to report a more verbose error. 
5786
5787 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5788
5789         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5790         report the warning and continue 
5791
5792         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5793         values on the stack on the call to Emit.   Use EmitStatement if
5794         possible, or using Emit + Pop if not possible.   Fixes #82064
5795
5796 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5797
5798         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5799         avoid try...finally in some cases.
5800
5801 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5802
5803         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5804         
5805         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5806         instead of method. Re-use standard error handling.
5807         (ConstructorInitializer.Emit): Simplified.
5808         
5809         * delegate.cs: Updated after Invocation.EmitCall change.
5810         
5811         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5812         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5813         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5814         method and don't permanently changing input arguments.
5815         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5816         is resolved it has one of the candidates is the best one which is later
5817         used to emit. Removed a few unused method.
5818         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5819
5820         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5821         (Binary.ResolveOperator): Ditto.
5822         (ConditionalLogicalOperator.DoResolve): Ditto.
5823         (Invocation): Uses method group.
5824         (Invocation.DoResolve): Simplified.
5825         (Invocation.EmitCall): Removed useless is_static.
5826         (Invocation.Emit): Delegate to method group.
5827         (Invocation.EmitStatement): Simplified.
5828         (New): Uses method group.
5829         (MemberAccess.DoResolve): Don't destroy original expression.
5830         
5831         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5832         
5833 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5834
5835         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5836         
5837         * anonymous.cs,
5838         * lambda.cs: Add custom error message type.
5839
5840 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5841
5842         * lambda.cs: Simplified little bit.
5843         
5844         * parameter.cs: Introduced ImplicitLambdaParameter.
5845         (Parameters.CreateFullyResolved): New factory instead of ctor.
5846         
5847         * anonymous.cs,
5848         * class.cs,
5849         * delegate.cs: Updated parameter creation.
5850         
5851 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5852
5853         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5854         arguments.
5855         
5856         * generic.cs: Synchronized with gmcs.
5857         
5858 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5859
5860         * class.cs (Indexer): Check return type as soon as possible.
5861         
5862         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5863         members too.
5864         
5865         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5866         
5867         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5868         
5869         * parameter.cs (Parameter): Use expression type when it is available.
5870         
5871         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5872         method modifier for the first parameter only.
5873
5874 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5875
5876         A fix for bug #81938
5877         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5878         
5879         * constant.cs: Tide up an exception message.
5880
5881 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5882
5883         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5884         an uninitialized variable is used.
5885         
5886         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5887
5888 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5889
5890         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5891         not found error handling.
5892
5893         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5894         simplified.
5895         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5896         (ArrayCreation.DoResolve): Simplified.
5897         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5898         its own resolve process.
5899         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5900
5901 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5902
5903         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5904         more error details.
5905         
5906 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5907
5908         * cs-tokenizer.cs: Removed var related stuff.
5909         
5910         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5911         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5912         a type and a keyword at same time.
5913         
5914         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5915         matches to "var".
5916         
5917         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5918         implicitly typed arrays, more changes will follow.
5919         
5920         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5921         
5922 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5923
5924         * ecore.cs (VarExpr): Removed Handled field.
5925         
5926         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5927         build-in assign functionality.
5928         (ForEach.Resolve): Removed all implicitly typed local variable code and
5929         simplified.
5930         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5931         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5932
5933 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5934
5935         * assign.cs: Removed implicitly typed local variable check.
5936         
5937         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5938         referencing implicitly typed local variable.
5939         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5940         variable here.
5941         
5942         * statement.cs (Fixed): Removed unsupported implicitly typed local
5943         variable code.
5944
5945 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5946
5947         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5948
5949 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5950
5951         A fix for bugs #81855 and #76274
5952         * attribute.cs (AttachTo): Always set owner for global attributes to
5953         prefined owner.
5954         
5955         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5956         usefull too.
5957         
5958         * cs-parser.jay: Assembly and module attributes must precede all other
5959         elements except using clauses and extern alias declarations.
5960
5961 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5962
5963         A fix for bug #81748
5964         * cs-tokenizer.cs,
5965         * expression.cs: More checks for non ISO-1 features.
5966
5967 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5968
5969         A fix for bug #81807
5970         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5971         present inside switch statement and it is required by nullable check.
5972
5973 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5974
5975         A fix for bug #81840
5976         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5977         when type matching fails.
5978         
5979         * namespace.cs: Tiny error message change.
5980
5981 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5982
5983         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5984         reporting. Added automatic property check.
5985         
5986         * class.cs: Updated after CheckAbstractAndExtern relocation.
5987         (AEventPropertyAccessor.GetSignatureForError): Customized.
5988         
5989 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5990
5991         * class.cs (DefineBaseTypes): Base type can be undefined.
5992         
5993         * ecore.cs (TypeLookup): Minor refactoring.
5994         (DoResolveAsTypeStep): Removed redundant check.
5995
5996         * namespace.cs (Lookup): Removed redundant check.
5997                 
5998         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5999         ResolveAsTypeTerminal step.
6000         (BootstrapCorlib_*): Simplified.
6001         (PopulateCoreType): Core types can be now external.
6002
6003 2007-06-07  Marek Safar  <marek.safar@gmail.com>
6004
6005         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
6006          verification only.
6007          (InferTypeArguments): Infers anonymous expression type arguments.
6008          (Compatible): Split to Compatible and InferTypeArguments. 
6009         
6010         * lambda.cs: Updated.
6011
6012 2007-06-08  Marek Safar  <marek.safar@gmail.com>
6013
6014         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
6015
6016 2007-06-07  Raja R Harinath  <harinath@gmail.com>
6017
6018         Fix #80477, cs0135-2.cs, cs0135-3.cs
6019         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
6020         names to the "known" variables list.
6021         (Block.CheckInvariantMeaningInBlock): Handle the fact the
6022         parameter names are also "known".
6023         (Block.CheckError136): Remove.
6024         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
6025         null.
6026
6027 2007-06-07  Marek Safar  <marek.safar@gmail.com>
6028
6029         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
6030
6031 2007-06-06  Marek Safar  <marek.safar@gmail.com>
6032
6033         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
6034         internal error not an user error.
6035          
6036         * expression.cs (IsApplicable): Refactored to make debugging easier.
6037
6038         * support.cs: More tricks for non-mono runtimes.
6039         
6040         * typemanager.cs (CoreLookupType): Made public.
6041         (InitSystemCore): All linq specific stuff moved to linq.cs
6042
6043 2007-06-05  Marek Safar  <marek.safar@gmail.com>
6044
6045         * typemanager.cs (CSharpSignature): One more missing build-in types
6046         replacement.
6047         More tricks for non-mono runtime.
6048
6049 2007-06-05  Raja R Harinath  <harinath@gmail.com>
6050
6051         * statement.cs (Block.CheckError136_InParents): Remove.
6052         (Block.AddVariable): Use GetParameterInfo instead.
6053         (ToplevelBlock.ProcessArguments): Likewise.
6054
6055 2007-06-04  Raja R Harinath  <rharinath@novell.com>
6056
6057         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
6058         information too.
6059         (ToplevelBlock.GetParameterInfo): Split out of ...
6060         (ToplevelBlock.GetParameterRefernce): ... this.
6061         (ToplevelBlock.ParameterMap): Remove.
6062         * expression.cs (ParameterReference): Update to use
6063         ToplevelParameterInfo.
6064
6065         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
6066         regression.
6067
6068         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
6069         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
6070
6071         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
6072         (ToplevelBlock.ProcessParameters) ... here.
6073         (ToplevelBlock..ctor): Invoke it.
6074
6075         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
6076         new parameters.
6077
6078         * statement.cs (IKnownVariable): New interface.
6079         (LocalInfo): Implement it.
6080         (ToplevelParameterInfo): New class.
6081         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
6082         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
6083         GetKnownVariableInfo.
6084
6085 2007-06-03  Raja R Harinath  <harinath@gmail.com>
6086
6087         Partly speed up CS0136 error checks.
6088         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
6089         'recurse' parameter.
6090         (Block.DoCheckError136): Only check errors in parameters.  Move
6091         local variable checks ...
6092         (Block.AddVariable): ... here, and ...
6093         (ToplevelBlock.ResolveMeta): ... here.
6094
6095 2007-06-02  Raja R Harinath  <harinath@gmail.com>
6096
6097         * statement.cs (Block.IsChildOf): Remove.
6098
6099         * statement.cs (Statement.Clone): Move special case code ...
6100         (Block.CloneTo): ... here.
6101
6102 2007-05-29  Raja R Harinath  <rharinath@novell.com>
6103
6104         * statement.cs (ToplevelBlock.container): Remove field.  It's
6105         redundant with 'Parent'.
6106         (ToplevelBlock.ContainerBlock): Remove accessor.
6107         (ToplevelBlock..ctor): Update to changes.  Register anonymous
6108         child with parent here, ...
6109         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
6110         current_block.
6111         (start_anonymous): Don't save current_block.
6112         (top_current_block): Remove.
6113
6114         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6115         (Block.Resolve): Update to changes.
6116         (Block..ctor): Move setting of "correct" 'Toplevel'
6117         and 'Explicit' fields to ...
6118         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6119
6120 2007-05-27  Raja R Harinath  <harinath@gmail.com>
6121
6122         Kill Block.Implicit
6123         * statement.cs (Block.Implicit): Remove.
6124         (Block): Update to changes.
6125         * flowanalysis.cs: Likewise.
6126
6127         Mildly speed up CheckInvariantMeaningInBlock
6128         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6129         Recursively call AddKnownVariable to all enclosing blocks.
6130         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6131         Remove recursive calls.
6132         (Block): Update to changes.
6133
6134         New ExplicitBlock invariants
6135         * statement.cs (Block.Explicit): New field.  It points to the
6136         immediately enclosing non-implicit block.
6137         (Block..ctor): Maintain the invariant.
6138         * cs-parser.jay: Take advantage of invariant.
6139
6140         Introduce ExplicitBlock
6141         * statement.cs (ExplicitBlock): New.
6142         (ToplevelBlock): Derive from it.
6143         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6144         sense of flag.
6145         (Block.Implicit): Update to changes.
6146         * cs-parser.jay: Update to changes.
6147
6148         Remove unused field
6149         * codegen.cs (EmitContext.IsLastStatement): Remove.
6150         * statement.cs (Block.DoEmit): Update to changes.
6151
6152 2007-05-25  Raja R Harinath  <rharinath@novell.com>
6153
6154         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6155         modifying current_block directly.
6156
6157 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
6158         
6159         * class.cs: Implemented automatic properties (C# 3.0)
6160           Thanks to Marek for the help.
6161
6162 2007-05-23  Raja R Harinath  <rharinath@novell.com>
6163
6164         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6165         variable as assigned, note also that all its components are
6166         assigned too.
6167         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
6168
6169 2007-05-19  Marek Safar  <marek.safar@gmail.com>
6170
6171         * anonymous.cs, class.cs: Emit Compiler generated attribute when
6172         member is marked as compiler generated.
6173         
6174         * decl.cs (MemberCore): Refactored ModFlags into property.
6175
6176         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6177         (Check): Check only accessibility modifiers.
6178
6179 2007-05-18  Raja R Harinath  <rharinath@novell.com>
6180
6181         Track all assignable slots in one bit array
6182         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6183         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
6184         logic from VariableMap constructor here.  Use the same 'offset'
6185         variable that's later used for computing offsets of local
6186         variables.
6187         * flowanalysis.cs (UsageVector.parameters): Remove.
6188         (UsageVector): Update to changes.
6189         (VariableMap): Remove.
6190
6191         Avoid creating ParameterMap in every block
6192         * statement.cs (Block.ParameterMap): Move ...
6193         (ToplevelBlock.ParameterMap): ... here.
6194         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6195         only once.
6196         * flowanalysis.cs (FlowBranching.param_map): Remove.
6197         (FlowBranching.UsageVector): Update to changes.
6198         (FlowBranchingToplevel.CheckOutParameters): Likewise.
6199
6200         * statement.cs (Block.CloneTo): Clone Toplevel field too.
6201
6202         * expression.cs (ParameterReference): Distinguish between block
6203         where parameter was referenced and declared.
6204
6205 2007-05-18  Marek Safar  <marek.safar@gmail.com>
6206
6207         * flowanalysis.cs, statement.cs: Put back improved error handling.
6208
6209 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
6210         
6211         * assign.cs:
6212         * expression.cs:
6213           Imporved object and collection initialization (C# 3.0).
6214
6215 2007-05-15  Marek Safar  <marek.safar@gmail.com>
6216
6217         A fix for bug #81380
6218         * expression.cs (Is.DoResolve): Only value types have constant `is'
6219         behaviour.
6220
6221 2007-05-15  Raja R Harinath  <rharinath@novell.com>
6222
6223         * statement.cs (ToplevelBlock.child): Remove.
6224
6225 2007-05-15  Raja R Harinath  <harinath@gmail.com>
6226
6227         Rationalize ResolveMeta: refactoring
6228         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
6229         out constant handling code into ...
6230         (Block.DoResolveConstants): ... this.
6231
6232         Rationalize ResolveMeta: kill local_map
6233         * statement.cs (Block.local_map, Block.LocalMap): Remove.
6234         (Block.AssignableSlots): New.
6235         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
6236         for locals -- move code from VariableMap here.  Avoid unnecessary
6237         allocations.
6238         * flowanalysis.cs (FlowBranching.local_map): Remove.
6239         (FlowBranching..ctor): Use Block.AssignableSlots.
6240         (VariableMap): Remove unused constructors.
6241
6242 2007-05-11  Raja R Harinath  <rharinath@novell.com>
6243
6244         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6245
6246 2007-05-11  Marek Safar  <marek.safar@gmail.com>
6247
6248         * typemanager.cs (IsFriendAssembly): Should not be called for building
6249         assembly.
6250
6251 2007-05-09  Marek Safar  <marek.safar@gmail.com>
6252
6253         * literal.cs (NullConstant): Print null in all cases.
6254         
6255         * expression.cs (Binary.ResolveOperator): Implemented delegate
6256          comparison based on C# 2.0 changes.
6257
6258 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
6259
6260         This code is contributed under the MIT X11 license
6261         
6262         The following enables support for several C# 3.0 language features:
6263         
6264         * cs-tokenizer.cs: Added support for the "var" keyword.
6265         
6266         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6267           Added VarExpr class to facilitate type inferencing.
6268         
6269         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6270           to support anonymous types.
6271         
6272         * assign.cs: Added support for type inferencing and initialization.
6273         
6274         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6275         
6276         * expression.cs: Added implicit array support to ArrayCreation.
6277           Added 5 types and 1 interface:
6278           
6279           IInitializable                Implementing classes can inject initializing
6280                                         statements after object instantiation.
6281           
6282           Initializer                   Stores data for object initialization.
6283           
6284           AnonymousType                 An expression for anonymous types.
6285           
6286           AnonymousTypeParameter        Stores data about an anonymous type's field.
6287           
6288           NewInitialize                 An expression for object initialization.
6289           
6290           CollectionInitialize          An expression for collection initialization.
6291         
6292         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6293           statements.
6294
6295 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6296
6297         A fix for bug #81500
6298         * cs-tokenizer.cs: Add special handling for coalescing operator.
6299
6300 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6301
6302         A fix for bug #81529
6303         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6304         its value from base class until it is redefined.
6305
6306 2007-05-02  Raja R Harinath  <rharinath@novell.com>
6307
6308         Fix regression in cs0631-3.cs
6309         * cs-parser.jay (operator_declarator): Add opt_attributes to error
6310         fallback.  Make error fallback catch more cases.
6311
6312 2007-05-01  Miguel de Icaza  <miguel@novell.com>
6313
6314         * cs-parser.jay: Allow parameters in operator declarations to have
6315         attributes. 
6316
6317 2007-04-27  Miguel de Icaza  <miguel@novell.com>
6318
6319         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6320         exists. 
6321
6322         * lambda.cs (ContextualReturn.Resolve): An expression is valid
6323         inside the ContextualReturn, it does not have to be an
6324         ExpressionStatement. 
6325
6326 2007-04-24  Miguel de Icaza  <miguel@novell.com>
6327
6328         * lambda.cs (ContextualReturn.Resolve): if the return type is not
6329         set, set it.
6330
6331 2007-04-23  Miguel de Icaza  <miguel@novell.com>
6332
6333         * anonymous.cs (AnonymousContainer): split the virtual Resolve
6334         method in two methods: ResolveNoDefine and Resolve.
6335
6336         ResolveNoDefine will stop just after ResolveTopBlock has been
6337         called.   
6338
6339         Resolve will then continue by creating a method and issuing the
6340         call to method.Define ().
6341
6342         (AnonymousMethod): Split and implement the new Resolve and
6343         ResolveNoDefine as well.
6344
6345         * lambda.cs (LambdaExpression): Split the anonymous method
6346         resolution code into a separate routine (CoreCompatibilityTest)
6347         from DoCompatibleTest.
6348
6349         (LambdaExpression.TryBuild): New method, this method tries to
6350         build the LambdaExpression with the given set of types to be used
6351         as the types for the various parameters of the lambda expression. 
6352
6353         If the compilation succeed with the given types, the infered type
6354         of the Anonymous method is returned, otherwise null is returned.
6355
6356 2007-04-23  Marek Safar  <marek.safar@gmail.com>
6357
6358         A fix for bug #81414
6359         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6360
6361 2007-04-22  Miguel de Icaza  <miguel@novell.com>
6362
6363         * cs-tokenizer.cs: Change various identifiers here from the
6364         camelCasing to the recommended Linux-like style for instance
6365         variables from the Coding Guidelines. 
6366
6367 2007-04-19  Martin Baulig  <martin@ximian.com>
6368
6369         * convert.cs
6370         (Convert.ImplicitReferenceConversionCore): Allow conversions from
6371         System.Enum to System.ValueType.
6372
6373 2007-04-13  Martin Baulig  <martin@ximian.com>
6374
6375         Rewrote implicit reference conversions.  We need to distinguish
6376         between implicit reference conversions (13.1.4) and implicit
6377         boxing conversions (13.1.5).
6378
6379         According to the spec, there's an an implicit conversion
6380         "From a one-dimensional array-type S[] to IList<T> and base
6381         interfaces of this interface, provided there is an implicit
6382         reference conversion from S to T."  Note that this does not
6383         include boxing conversions.
6384
6385         * convert.cs
6386         (Convert.ImplicitTypeParameterBoxingConversion): New method.
6387         (Convert.ImplicitReferenceConversion): Split into
6388         ImplicitReferenceConversionCore() and
6389         ImplicitBoxingConversionExist().
6390         (Convert.ImplicitReferenceConversionExists): Use the new
6391         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6392
6393 2007-04-12  Martin Baulig  <martin@ximian.com>
6394
6395         * convert.cs (Convert.ImplicitReferenceConversion): Move the
6396         `TypeManager.null_type' checks up to the top of the method.
6397
6398 2007-04-11  Marek Safar  <marek.safar@gmail.com>
6399
6400         A fix for bug #81350
6401         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6402         extension methods.
6403
6404 2007-04-11  Martin Baulig  <martin@ximian.com>
6405
6406         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6407         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6408         to make this work for generic classes; fixes #79561.
6409
6410 2007-04-11  Martin Baulig  <martin@ximian.com>
6411
6412         * expression.cs (As): Add support for nullable types; fixes #79371.
6413
6414 2007-04-11  Martin Baulig  <martin@ximian.com>
6415
6416         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6417         `type.FullName' is null; fixes #80243.
6418
6419 2007-04-11  Martin Baulig  <martin@ximian.com>
6420
6421         * expression.cs (Invocation.IsApplicable): Don't modify the method
6422         if type inference succeeded, but the method was not applicable.
6423         Fixes #81250.
6424
6425 2007-04-10  Marek Safar  <marek.safar@gmail.com>
6426
6427         A fix for bug #81324
6428         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6429         internal and external namespaces containers.
6430
6431 2007-04-10  Martin Baulig  <martin@ximian.com>
6432
6433         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6434         TypeManager.DropGenericMethodArguments() so we also call
6435         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
6436
6437 2007-04-10  Martin Baulig  <martin@ximian.com>
6438
6439         * iterators.cs (Iterator.CreateIterator): Don't crash if
6440         `method.ReturnType' is null.  This happens if something went wrong
6441         while resolving that typ (we already reported an error in this case).
6442
6443 2007-04-10  Martin Baulig  <martin@ximian.com>
6444
6445         * expression.cs (New.DoResolve): Don't call CheckComImport() on
6446         generic interfaces; report the CS0144 directly.
6447
6448 2007-04-10  Martin Baulig  <martin@ximian.com>
6449
6450         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6451         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6452
6453 2007-04-10  Martin Baulig  <martin@ximian.com>
6454
6455         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6456
6457 2007-04-09  Raja R Harinath  <rharinath@novell.com>
6458
6459         A better fix
6460         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6461         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6462
6463         Fix #81338
6464         * statement.cs (For.Resolve): If resolution fails, use
6465         KillFlowBranching.
6466
6467 2007-04-08  Marek Safar  <marek.safar@gmail.com>
6468
6469         * anonymous.cs (MakeName): Make faster and zero-based.
6470         (VerifyExplicitParameterCompatibility): Back to mode where generic
6471         parameter is ignored.
6472         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6473
6474         * class.cs (EmitType): Method can emit another new method.
6475
6476         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6477
6478         * driver.cs: Updated.
6479
6480         * lambda.cs: Reuse predefined empty parameters.
6481
6482         * parameter.cs: Updated
6483
6484         * support.cs: Implemented InflateTypes.
6485
6486         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6487         (InitSystemCore): Introduced to isolate 3.0 dependencies.
6488
6489 2007-04-03  Martin Baulig  <martin@ximian.com>
6490
6491         Fix #80632.
6492
6493         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6494         version of TypeManager.IsOverride() which also works with generic
6495         types.  
6496
6497 2007-04-03  Martin Baulig  <martin@ximian.com>
6498
6499         Fix #81044.
6500
6501         * convert.cs
6502         (Convert.ExplicitReferenceConversion): We need to cast when
6503         converting from IList<T> to S[].
6504
6505 2007-04-01  Marek Safar  <marek.safar@gmail.com>
6506
6507         * decl.cs (FindExtensionMethods): Consider all candidates with same name
6508         at this level.
6509         
6510         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6511
6512 2007-03-31  Marek Safar  <marek.safar@gmail.com>
6513
6514         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6515         argument and return type inferring.
6516
6517         * codegen.cs (InferReturnType): Flag whether return can be inferred.
6518         (ReturnType): Turned to property.
6519
6520         * statement.cs (Return): Implemented return type inferring.
6521
6522         * support.cs (ReflectionParameters): Use local types if possible.
6523
6524 2007-03-30  Raja R Harinath  <rharinath@novell.com>
6525
6526         * flowanalysis.cs (FlowBranching.Reachability): Remove.
6527         (FlowBranching.UsageVector): Update to changes.
6528
6529         Prepare to kill 'Reachability'
6530         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6531         argument of constructor.
6532
6533 2007-03-29  Raja R Harinath  <rharinath@novell.com>
6534
6535         Prepare to kill 'Reachability'
6536         * flowanalysis.cs (UsageVector.is_unreachable): New.
6537         (UsageVector): Update to maintain 'is_unreachable' in parallel to
6538         'reachability', and verify they're consistent.
6539
6540         Fix #81121
6541         * expression.cs (New.EmitStatement): Handle type parameters here too.
6542
6543 2007-03-29  Martin Baulig  <martin@ximian.com>
6544
6545         Fix #79148.
6546
6547         * anonymous.cs
6548         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6549         CompilerGeneratedClass.
6550         (ScopeInfo.EmitScopeInstance): Make this protected.
6551         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6552         `ec.CurrentAnonymousMethod.Scope == Scope'.
6553
6554         * statement.cs (Block.ScopeInfo): Make this a property.
6555
6556 2007-03-27  Raja R Harinath  <harinath@gmail.com>
6557
6558         Prepare to kill 'Reachability'
6559         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6560         (FlowBranching.UsageVector.Reachability): Remove property.
6561         (FlowBranching.UsageVector.IsUnreachable): New property.
6562         (FlowBranching.UsageVector.ResetBarrier): New.
6563         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6564         * codegen.cs, statement.cs: Update to changes.
6565
6566 2007-03-27  Martin Baulig  <martin@ximian.com>
6567
6568         Fix #81209.
6569
6570         * decl.cs
6571         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6572         generic types.
6573
6574 2007-03-26  Raja R Harinath  <rharinath@novell.com>
6575
6576         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6577         instead of TriState.  Remove all mention of TriState.
6578
6579         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6580         replaced by a boolean.  Add boolean 'is_unreachable' field, check
6581         and maintain invariants.
6582
6583 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6584
6585         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6586
6587 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6588
6589         * expression.cs: Stop using obsolete 2.0 opcodes.
6590
6591 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6592
6593         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6594         one of the latests Martin's fixes.
6595
6596 2007-03-23  Miguel de Icaza  <miguel@novell.com>
6597
6598         * expression.cs: On BigEndian systems, swap the bytes, temporary
6599         solution until we get a new bitconverter class.
6600
6601 2007-03-23  Martin Baulig  <martin@ximian.com>
6602
6603         Fix #81158.
6604
6605         * decl.cs (MemberCache.AddMembers): Add generic methods both as
6606         "Method" and "Method`1".  Normally, a cache lookup is done on the
6607         "Method" form (ie. without the generic arity), but this one makes
6608         lookups on the full form work as well.
6609
6610 2007-03-22  Raja R Harinath  <rharinath@novell.com>
6611
6612         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6613         unused properties.
6614
6615 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
6616         * class.cs: 
6617         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6618         ordered_member_list, to TypeBuilder to store members to be defined
6619         in the order they were parsed in.
6620         - ordered_explicit_member_list contains all properties indexers
6621           and methods that are defined as explicit implementation of an
6622           interface or base class.
6623         - ordered_member_list contains all properties indexers and methods
6624           that are not defined as explicit implementation of an interface
6625           or base class.
6626
6627         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
6628         functionality in these removed classes has been replaced with 
6629         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
6630         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6631
6632         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6633         to CheckForDuplications inside GetMethod and SetMethod Define Method
6634         to handle method property and indexer name conflicts.
6635
6636         Fixes #79434
6637
6638         All code is contributed under the MIT/X11 license.
6639
6640 2007-03-20  Martin Baulig  <martin@ximian.com>
6641
6642         * class.cs (TypeContainer.Interfaces): Removed; they're now
6643         included in `TypeContainer.Types'.
6644
6645 2007-03-20  Martin Baulig  <martin@ximian.com>
6646
6647         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
6648
6649         * class.cs (TypeContainer.CreateType): New public method.  This is
6650         now called before DefineType() to create the TypeBuilders.
6651         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6652         has already been created by CreateType().
6653         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6654         don't resolve our base classes here; this has been moved into
6655         DefineBaseTypes().  We're now called from CreateType().
6656         (TypeContainer.DefineBaseTypes): New private method; resolve our
6657         base classes here.  We're now called from DefineType().
6658
6659         * rootcontext.cs
6660         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6661         our types first to create all the TypeBuilders.  After that, call
6662         TypeContainer.DefineType() on all the types which'll resolve their
6663         base classes and setup the resolve order.
6664
6665 2007-03-20  Martin Baulig  <martin@ximian.com>
6666
6667         * class.cs (TypeContainer.Enums): Removed; they're now included in
6668         `TypeContainer.Types'.  
6669
6670 2007-03-20  Martin Baulig  <martin@ximian.com>
6671
6672         * class.cs
6673         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6674         (TypeContainer.DoResolveMembers): Call DefineType() on our
6675         `compiler_generated' classes; moved here from DefineNestedTypes().
6676
6677         * rootcontext.cs
6678         (RootContext.ResolveTree): Call ResolveMembers() on all
6679         TypeContainer's in the `type_container_resolve_order'.
6680
6681 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6682
6683         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6684
6685 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6686
6687         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6688         implementation flags.
6689
6690 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6691
6692         * class.cs: More optimizations for type parameters.
6693
6694 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6695
6696         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6697
6698         * ecore.cs, parameter.cs: More common code for both corlibs.
6699
6700         * typemanager.cs (IsGenericMethod): Simplified.
6701
6702 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6703
6704         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6705         'returns'.
6706         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6707
6708         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6709         unconditionally.  Simplify explanation.
6710         (Try.Resolve, Using.Resolve): Likewise.
6711
6712 2007-03-15  Martin Baulig  <martin@ximian.com>
6713
6714         Fix #80731.
6715
6716         * decl.cs (DeclSpace): If we're a partial class, use our
6717         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6718
6719 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6720
6721         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6722         'throws'.
6723         (FlowBranching.UsageVector): Update to changes.
6724         (FlowBranching.MergeSiblings): Likewise.
6725         * statement.cs: Likewise.
6726
6727 2007-03-15  Martin Baulig  <martin@ximian.com>
6728
6729         Fix #79302.
6730
6731         * decl.cs
6732         (MemberCache): Added a special .ctor for type parameters.
6733
6734         * typemanager.cs
6735         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6736         `MemberCache'.  
6737
6738 2007-03-09  Martin Baulig  <martin@ximian.com>
6739
6740         * enum.cs (Enum): Make this a TypeContainer.
6741         (EnumMember): Derive from `Const'.
6742
6743         * const.cs
6744         (Const.DoResolveValue): New protected virtual method; move most of
6745         the functionality of ResolveValue() here so we can override it in
6746         `EnumMember'.
6747         (Const.CreateConstantReference): Make this virtual.
6748
6749         * class.cs (Kind): Add `Kind.Enum'.
6750         (TypeContainer.Emit): Don't emit the enums here; they're already
6751         in the `RootContext.typecontainer_resolve_order'.
6752
6753         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6754         here; they're already in the `typecontainer_resolve_order'.
6755
6756         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6757         TypeManager.DropGenericTypeArguments().
6758
6759         * typemanager.cs
6760         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6761         (TypeManager.IsEnumType): Likewise.
6762         (TypeManager.EnumToUnderlying): Likewise.
6763         (TypeManager.IsEqual): Add support for enums.
6764
6765 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6766
6767         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6768         DefaultParameterValueAttribute to be undefined, say if System.dll
6769         is not referenced.
6770
6771 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6772
6773         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6774         any mscorlib.
6775
6776 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6777
6778         * class.cs, parameter.cs: Unified parameters verification.
6779
6780 2007-03-08  Martin Baulig  <martin@ximian.com>
6781
6782         * cs-parser.jay (constructor_header): Pass the location to the
6783         newly created TopLevelBlock.
6784
6785 2007-03-07  Martin Baulig  <martin@ximian.com>
6786
6787         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6788
6789 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6790
6791         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6792         with the changes from David, fixes the build.
6793
6794 2007-03-05  David Mitchell  <dmitchell@logos.com>
6795
6796         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6797         and its base interfaces to a one-dimensional array type S[],
6798         provided there is an implicit or explicit reference conversion
6799         from S to T.
6800
6801 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6802
6803         * cs-tokenizer.cs: Implemented basic linq grammar.
6804
6805         * driver.cs: Set linq lang version on demand.
6806
6807 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6808
6809         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6810
6811 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6812
6813         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6814         (Fixes #80455)
6815
6816         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6817         here.
6818         Check property and event extern attributes.
6819
6820         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6821         charset.
6822
6823 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6824
6825         A fix for bug #80407
6826         * ecore.cs: Don't report ambiguity error when methods have same parent.
6827
6828 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6829
6830         A fix for bug #80878
6831         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6832
6833 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6834
6835         * attribute.cs: Enable ExtensionAttribute presence test.
6836
6837 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6838
6839         * class.cs: Warn about missing GetHashCode only when Equals is override.
6840
6841         * decl.cs: Check accessibility of type arguments.
6842
6843         * typemanager.cs: Correctly report nullable array.
6844
6845 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6846
6847         * class.cs, report.cs: Capture more details when things go wrong.
6848
6849 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6850
6851         A fix for bug #80650
6852         * cs-parser.jay: Anonymous container starts at constructor declaration
6853         and not at block beginning because it has to be usable in constructor
6854         initializer.
6855
6856         * statement.cs: Use context location and not block one for error reporting.
6857
6858 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6859
6860         A fix for bug #78712
6861         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6862         too.
6863
6864 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6865
6866         A fix for bug #80493 by Atsushi Enomoto
6867         * cs-parser.jay: Ignore invalid attribute target.
6868
6869 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6870  
6871         * cs-tokenizer.cs: Ignore '\0' as white space character.
6872
6873 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6874
6875         * cs-parser.jay: Add support for lambda expressions to the mcs
6876         compiler as well.
6877
6878         * lambda.cs: Only clone when we are probing, not on the final call
6879         (Compatible is the final call). 
6880
6881         * statement.cs (CloneContext): Introduce class to provide block
6882         remapping during clone.
6883
6884         All statements Clone themselves now.
6885
6886         (Clone): special handling for blocks, when we clone a block, we
6887         register the block inside this routine, as children of the block
6888         might trigger a lookup. 
6889         
6890         * expression.cs: Add support for CloneContext in all expressions. 
6891         
6892 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6893  
6894         A fix for bug #80493
6895         * statement.cs: Report ambiguous warning when interfaces are not related.
6896
6897 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6898
6899         C# 3.0 extension methods.
6900
6901         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6902         cannot be used directly.
6903
6904         * class.cs (Class.Emit): Emit extension attribute if any class method
6905         is extension method.
6906         (Method.Define): Add basic extension method validation conditions.
6907         (Method.Emit): Emit extension attribute for method.
6908
6909         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6910         extension method exists. Currently we follow same approach as Microsoft
6911         does, emit even if a method or a class are private but this can change
6912         later.
6913
6914         * cs-parser.jay: Add handling of `this' keyword in method parameters
6915         context.
6916
6917         * decl.cs (DeclSpace.IsStaticClass): New property.
6918         (MemberCache.FindExtensionMethods): Looks for extension methods with
6919         defined name and extension type.
6920
6921         * doc.cs: Updated after OverloadResolve changes.
6922
6923         * driver.cs: Add new soft reference to System.Core.dll.
6924
6925         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6926         (ExtensionMethodGroupExpr): Represents group of extension methods.
6927
6928         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6929         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6930         to MethodGroupExpr and made non-static for easier customization.
6931         (Invocation.DoResolve): Add extension method lookup when no standard
6932         method was found.
6933         (MemberAccess.DoResolve): Try extension methods if no member exists.
6934
6935         * modifiers.cs: Add METHOD_EXTENSION modifier.
6936
6937         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6938         as well as candidate extension type.
6939         (ComputeNamespaces): When assembly constains extension methods registers
6940         them.
6941         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6942         extension method lookup.
6943         (Namespace.LookupExtensionMethod): Looks for extension method in this
6944         namespace.
6945         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6946         find a method which matches name and extensionType.
6947
6948         * parameter.cs (Parameter): Add This modifer.
6949         (HasExtensionMethodModifier): New property.
6950         (Resolve): Add extension parameter check.
6951         (ModFlags): turned to property to exclude this modifier as it is not real
6952         parameter modifier.
6953         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6954
6955         * support.cs (ParameterData): Add ExtensionMethodType.
6956         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6957
6958         * typemanager.cs: Add type and ctor extension attribute type.
6959
6960 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6961
6962         * report.cs (DisableErrors, EnableErrors): used to prevent error
6963         output when we are "trying" to compile various methods with
6964         different types. 
6965
6966         * ecore.cs (Expression): Add Clone method that calls the virtual
6967         CloneTo method.  The current CloneTo method in Expression throws
6968         an exception so we can track down all the places where this must
6969         be implemented (not using abstract, because that would be a lot of
6970         up-front-work before we can start testing the implementation
6971         idea). 
6972
6973         Important: we only need Clone capabilities for expressions created
6974         by the parser, as the expressions we will be cloning are
6975         expressions in the pre-resolved state.   This vastly simplifies
6976         the work required. 
6977         
6978         (SimpleName): Add CloneTo that does nothing.
6979         (EmptyCast): Add CloneTo.
6980         
6981         * expression.cs (Binary): Implement CloneTo.
6982         (Invocation.IsApplicable): Store the current ec in
6983         EmitContext.TempEc and restore it on return.  This is used so we
6984         do not have to sprinkle hundres of methods with an extra
6985         EmitContext, we know that the only user is the lambda expression
6986         ImplicitConversionExists code. 
6987         
6988         (Argument): Add Cloning capabilities.
6989         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6990         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6991         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6992         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6993         IndexerAccess): Add Clone capability.
6994
6995         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6996
6997         (Argument): Add cloning capability.
6998
6999         * assign.cs (Assign): Implement CloneTo.
7000
7001         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
7002         
7003         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
7004         version by calling Convert with the EmitContext (that we are
7005         currently storing in ec, this is not great, but will do for now,
7006         to avoid passing EmitContext parameters to hundreds of functions
7007         that do not need them now).
7008
7009         (SetExpression): Remove, it is not needed.
7010         
7011         (ContextualReturn): Implement CloneTo.
7012
7013         * statement.cs (Statement): Implement cloning infrastructure,
7014         similar to expressions.
7015
7016         (Block): Partial implementation of Clone for statements.
7017
7018         (Return): Implement clone.
7019         
7020         * constant.cs (Constant.CloneTo): New method, does nothing.
7021
7022         * codegen.cs (TempEc): Add a static EmitContext as a temporary
7023         solution, until we decide how to exactly do this.  
7024         
7025 2007-02-14  Marek Safar  <marek.safar@gmail.com>
7026  
7027         A fix for bug #80493
7028         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
7029         a property is override we need to use second accessor.
7030
7031 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7032  
7033         A fix for bug #80418
7034         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
7035         methods.
7036
7037 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7038
7039         Another fix for bug #80749
7040         * pending.cs: Abstract class has priority over interfaces.
7041
7042 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7043
7044         Another fix for bug #80749
7045         * pending.cs: Abstract class has priority over interfaces.
7046
7047 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7048
7049         Another fix for bug #80749
7050         * pending.cs: Abstract class has priority over interfaces.
7051
7052 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7053
7054         Another fix for bug #80749
7055         * pending.cs: Abstract class has priority over interfaces.
7056
7057 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7058
7059         * class.cs Better error message.
7060
7061         * driver.cs: Add shorter versions of -optimize option.
7062
7063 2007-02-13  Martin Baulig  <martin@ximian.com>
7064
7065         * class.cs (Constructor.Emit): Check the return value of
7066         ec.ResolveTopBlock() and return on error.
7067
7068 2007-02-13  Raja R Harinath  <rharinath@novell.com>
7069
7070         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
7071         message to fix error message regression.
7072
7073 2007-02-12  Marek Safar  <marek.safar@gmail.com>
7074
7075         * delegate.cs: Delegate creation expression cannot be of Nullable type.
7076
7077 2007-02-12  Marek Safar  <marek.safar@gmail.com>
7078
7079         A fix for bug #80749
7080         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7081         its parent container.
7082
7083         * class.cs (DefineFieldInitializers): Each initializer can has different
7084         resolve context.
7085
7086         * const.cs: Updated.
7087
7088 2007-02-11  Miguel de Icaza  <miguel@novell.com>
7089
7090         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7091         now all the heavy lifting to check that embedded statements or
7092         expressions have the right form is done in the ContextualReturn.
7093
7094         (ContextualReturn): New class.  
7095
7096         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7097         method that can be invoked to report 201, so we do not replicate
7098         this everywhere.
7099
7100         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7101         
7102         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7103         treating tabs as spaces. 
7104
7105 2007-02-09  Marek Safar  <marek.safar@gmail.com>
7106
7107         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7108         * assign.cs: Use full implicit conversion for right side check.
7109
7110 2007-02-09  Marek Safar  <marek.safar@gmail.com>
7111
7112         * statement.cs (Switch): Switch over boolean type is not standardized.
7113
7114 2007-02-08  Marek Safar  <marek.safar@gmail.com>
7115
7116         A fix for bug #80755
7117         * decl.cs (FindBaseEvent): Don't use method cache for events.
7118
7119 2007-02-07  Marek Safar  <marek.safar@gmail.com>
7120
7121         * cs-parser.jay: Better syntax error handling.
7122
7123         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7124         instead of underlying type value.
7125
7126 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7127
7128         * driver.cs: Check define identifier before is registered.
7129
7130         * namespace.cs: Use existing error message.
7131
7132         * report.cs: New warning.
7133
7134 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7135
7136         A fix for bug #80742
7137         * expression.cs: Delegate Invoke method can be called directly.
7138
7139 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7140
7141         A fix for bug #80676
7142         * class.cs (IsEntryPoint): The Main method can have params modifier.
7143
7144 2007-02-04  Miguel de Icaza  <miguel@novell.com>
7145
7146         * parameter.cs (Parameter, Parameters): Add Clone method.
7147
7148         * anonymous.cs (Compatible): Turn method into virtual method, so
7149         LambdaExpression can implement a different behavior.
7150
7151         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7152         out the basic checking here, so it can be used by
7153         LambdaExpressions.
7154         
7155         * lambda.cs: Introduce "Compatible" function that will do the
7156         heavy lifting.
7157
7158 2007-02-02  Marek Safar  <marek.safar@gmail.com>
7159
7160         * attribute.cs: Unified one error message.
7161
7162         * class.cs (Class): Use type attributes and not properties to test static
7163         class.
7164         (IsEntryPoint): Don's pass local variable.
7165
7166         * convert.cs: Removed duplicate check.
7167
7168         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7169
7170         * driver.cs: Don't crash when soft reference does not exist.
7171
7172         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7173         (UsingEntry): Removed redundant allocation.
7174
7175         * parameter.cs: Add fast path for type parameters.
7176
7177         * support.cs: Don't allocate attribute when it's not used.
7178
7179 2007-01-30  Miguel de Icaza  <miguel@novell.com>
7180
7181         * anonymous.cs
7182         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7183         this into a virtual method, so we can override it in LambdaExpression.
7184
7185         * driver.cs: Improve diagnostics in case of failure. 
7186
7187         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7188         write a function that is slightly more complex and that parses:
7189
7190         type identifier [, type identifier]* )
7191
7192         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7193         this expression:
7194
7195                 (canEmpty ? i >= 0 : i > 0)
7196
7197 2007-01-30  Raja R Harinath  <rharinath@novell.com>
7198
7199         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7200         exception on possibly valid code.
7201
7202 2007-01-29  Raja R Harinath  <rharinath@novell.com>
7203
7204         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7205         Push/PopPosition.
7206         (parse_opt_type_arguments): Remove.  It's almost the same as
7207         parse_less_than.
7208         (parse_namespace_or_typename): Use parse_less_than.
7209
7210 2007-01-28  Miguel de Icaza  <miguel@novell.com>
7211
7212         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7213         this bug took a few hours to find, because the state saved and
7214         restored by PushPosition and PopPosition was ignoring the state of
7215         parse_generic_less_than.
7216
7217         I can also now remove the handling of OP_LT and OP_GT, this solves
7218         the big mistery.
7219         
7220         * cs-tokenizer.cs: store the location for the ARROW token, we use
7221         that in the parser.
7222
7223         (PushPosition, PopPosition): save/restore also `current_token',
7224         restore `parse_generic_less_than' (was missing).
7225
7226         (parse_opt_type_arguments): use parse_type, not
7227         parse_namespace_or_typename to parse types.
7228
7229         * lambda.cs: Empty new file, will eventually have the lambda
7230         expression implementation.
7231
7232         * lambda.test: used to test the internal tokenizer. 
7233
7234         * report.cs (FeatureIsNotISO1): Rename from
7235         FeatureIsNotStandardized, because it was about the language level
7236         (1 vs 2) it was not about standarization.
7237
7238         (FeatureRequiresLINQ): New.
7239
7240         * support.cs (SeekableStreamReader): Only require that the reader
7241         is a TextReader, not a StreamReader, so we can plug StringReader. 
7242
7243         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7244         given position in the input stream the following tokens can be
7245         parsed as a type followed by an identifier.
7246
7247         (is_punct): after a '(' if parse_type_and_parameter returns true,
7248         then return a special token OPEN_PARENS_LAMBDA which is used to
7249         avoid reduce/reduce errors in the grammar for the
7250         lambda_expression rules.
7251
7252         (parse_type): implement a type parser inside the
7253         tokenizer, the parser only returns true or false depending on
7254         whether the input at a given position can be parsed as a type.
7255
7256         (peek_token): new method used during type parsing.
7257
7258 2007-01-28  Raja R Harinath  <rharinath@novell.com>
7259
7260         Fix #80531
7261         * anonymous.cs (ScopeInfo.InflateParameters): New.
7262         (AnonymousContainer.Resolve): Use it to redirect types of
7263         delegate parameters.
7264
7265 2007-01-27  Raja R Harinath  <rharinath@novell.com>
7266
7267         Fix #80530
7268         * expression.cs (Error_InvalidArguments): Don't use two different
7269         messages for CS1503.  Use ExtraInformation and
7270         SymbolRelatedToPreviousError instead.
7271
7272         Fix #80358
7273         * decl.cs (DeclSpace.initialize_type_params): Don't access
7274         'type_params' of a partial class directly.
7275
7276 2007-01-26  Miguel de Icaza  <miguel@novell.com>
7277
7278         * constant.cs: Removed a handful of out-of-range checks that were
7279         not necessary. 
7280
7281 2007-01-25  Marek Safar  <marek.safar@gmail.com>
7282
7283         * expression.cs (CheckUselessComparison): Add additional check for char
7284         constants.
7285
7286         * namespace.cs: Fixed typo.
7287
7288 2007-01-23  Miguel de Icaza  <miguel@novell.com>
7289
7290         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7291         gone, instead we inline the test, preventing the needless casts to
7292         longs, ulongs and doubles for the parameters, avoiding calls to
7293         methods that overchecked stuff, and instead inlined things
7294         nicely. 
7295
7296 2007-01-20  Marek Safar  <marek.safar@gmail.com>
7297
7298         * cs-parser.jay: Better parameter error handling.
7299
7300 2007-01-17  Marek Safar  <marek.safar@gmail.com>
7301
7302         A fix for bug #80368, #80522
7303         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7304         whether array initializer contains constants only.
7305         (ArrayCreation.Emit): Use better formula to decide when
7306         are array initializers for static initialization.
7307         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7308         have to emit even constants otherwise they are pre-initialized.
7309
7310 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
7311             Raja R Harinath  <rharinath@novell.com>
7312
7313         Fix emit order of 'get' vs. 'set'.
7314         * support.cs (Accessors): New.
7315         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7316         Note the order in which accessors are declared in the source.
7317         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7318         Refactored from Property.Define and Indexer.Define.
7319         (PropertyBase.DefineAccessors): New helper that calls the above in
7320         appropriate order as noted by the parser.
7321         (Property.Define, Indexer.Define): Update to changes.
7322         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7323
7324 2007-01-17  Raja R Harinath  <rharinath@novell.com>
7325
7326         Fix cs0029-6.cs and gcs0029-2.cs (regression)
7327         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7328         there's an implicit conversion from the current type to the target
7329         type before converting the underlying constant.
7330
7331 2007-01-16  Marek Safar  <marek.safar@gmail.com>
7332
7333         * const.cs (ResolveValue): Updated after constant conversion was made more
7334         generic.
7335
7336         * constant.cs (GetAttributableValue): constant to object conversion is
7337         used for attributes only.
7338         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7339         constant conversions.
7340         (LongConstant.ConvertImplicitly): Ditto.
7341
7342         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7343         (ImplicitConversionStandard): Handle constant conversion as extra step.
7344         It solves the issue when constant conversion was called indirectly like
7345         inside array initializer and constant folding was skipped.
7346
7347         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7348         this change.
7349
7350         * statement.cs(ImplicitConversionStandard): Updated after constant
7351         conversion was made more generic.
7352
7353 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
7354
7355         * expression.cs (As.DoResolve): Use GenericConstraints instead of
7356         Constraints, solves the problem where the compiler incorrectly
7357         reported that a type parameter was not constrained to a class (Bug
7358         80518)
7359
7360 2007-01-14  Marek Habersack  <grendello@gmail.com>
7361
7362         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7363
7364 2007-01-14  Marek Safar  <marek.safar@gmail.com>
7365
7366         A fix for bug #80368
7367         * assign.cs (FieldInitializer): New class implements field
7368         initializer statement.
7369
7370         * attribute.cs: Update after FieldMember rename.
7371
7372         * class.cs (PropertyBasedMember): New common class for property based
7373         types.
7374         (InterfaceMemberBase): New base class for all members which can be used as
7375         an interface members.
7376         (MethodCore): Moved really common code to InterfaceMemberBase.
7377         (Method.Define): Equal and GetHasCode detection is relevant for methods
7378         only.
7379         (MethodData.Define): Don't assume that public event implements an
7380         interface automatically.
7381         (MethodData.DefineMethodBuilder): Issue an error even if only extern
7382         modifier is used.
7383         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7384         (FieldMember): Merged with FieldBase.
7385         (EventProperty.AEventPropertyAccessor): New specialization to check whether
7386         event extern modifier can be used.
7387         (EventField.EventFieldAccessor): Moved event field specific code here.
7388         (Event.AllowedModifiers): Even event can be extern.
7389         (Event.FindOutBaseMethod): New override specific to events.
7390         (Indexer.parameters): Reintroduce parameters because base class holds
7391         only properties common data.
7392         (Indexer.CheckForDuplications): Indexers are threated as methods so we
7393         need do extra parameters check.
7394
7395         * const.cs: Update after FieldMember rename.
7396
7397         * decl.cs (MemberCache.FindBaseEvent): New method.
7398
7399         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7400         to reflect that indexer is now derived from PropertyBased.
7401
7402         * ecore.cs (GetMemberType): Made public.
7403         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7404         obsolete event.
7405
7406         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7407         
7408         * typemanager.cs (CSharpSignature): Correctly print event accessors.
7409         (RegisterEvent): Removed.
7410         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7411         (GetPrivateFieldOfEvent): Renamed to GetEventField.
7412
7413 2007-01-11  Raja R Harinath  <rharinath@novell.com>
7414
7415         Fix #80249
7416         * statement.cs (CollectionForeach.TryType): Prefer generic
7417         GetEnumerator over non-generic variant.  Fix code to follow comments.
7418
7419 2007-01-09  Raja R Harinath  <rharinath@novell.com>
7420
7421         Fix #80446
7422         * support.cs (ReflectionParameter): Don't use an invalid index on
7423         the generic parameter data.
7424
7425 2007-01-08  Miguel de Icaza  <miguel@novell.com>
7426
7427         * driver.cs: Just add a tiny bit of infrastructure.
7428
7429 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7430
7431         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7432         where field type is struct from current assembly.
7433         
7434         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7435         it is possible.
7436
7437 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7438
7439         A fix for bug #80381
7440         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7441         the core types.
7442
7443         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7444         messages.
7445         (Namespace.LookupType): Always use core types from corlib when speficied.
7446
7447         * report.cs: A new warning.
7448
7449         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7450         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7451         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7452
7453         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7454         (InitCoreTypes): Set expression type of object_type and value_type
7455         immediately after lookup.
7456
7457 2007-01-01  Miguel de Icaza  <miguel@novell.com>
7458
7459         * cs-tokenizer.cs: Accept Pc class characters (Connector
7460         Punctuation) as valid identifiers.  Fixes #78259
7461
7462         * expression.cs (Invocation.DoResolve): Moved the check for the
7463         use of `this' for doing method calls to the Invocation resolution
7464         step, after overload resolution has taken place instead of doing
7465         the check at the low-level `This.DoResolve' level.
7466
7467         The `This.DoResolve'(appens before overload resolution, so it has
7468         no way of knowing if the method that will be called will be
7469         instace or static, triggering an erroneous report for cs0188 (Bug
7470         78113).
7471
7472         We now do the check for instance method invocations after we know
7473         what method will be called.
7474
7475         (This.CheckThisUsage): Move the actual use of this structure
7476         checking into its own method and expose it. 
7477
7478         * Everywhere that called Error_ValueCannotBeConverted: pass a new
7479         EmitContext.
7480
7481         Exceptions: Null.ConvertImplicitly,
7482         Constant.ImplicitConversionRequired as there are too many call
7483         sites for passing the ec. 
7484
7485         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7486         EmitContext, if the value is null, then we do not try to provide
7487         the extra information from the error (If a userdefined conversion
7488         exists, as UserDefinedConversion requires a non null-EmitContext).
7489
7490         Fixes: #80347
7491
7492 2006-12-30  Raja R Harinath  <rharinath@novell.com>
7493
7494         * flowanalysis.cs (MyBitVector): Document some invariants.
7495         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7496         introduced below, and add a couple of others, 
7497
7498 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7499
7500         * attribute.cs (GetMethodObsoleteAttribute): Uses new
7501         GetPropertyFromAccessor and GetEventFromAccessor.
7502         
7503         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7504         overrides non-obsolete one.
7505         (Indexer.Define): Error message has been moved to the parser.
7506
7507         * cs-parser.jay: Better syntax errors handling.
7508
7509         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7510         when an invocation has no arguments.
7511
7512         * ecore.cs: Removed not used caching.
7513
7514         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7515         implementation.
7516
7517         * report.cs: Add a new warning.
7518
7519         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7520
7521         * typemanager.cs (enumeration_type): Removed.
7522         (CSharpSignature): Reuses IsSpecialMethod.
7523         (IsEqual): Hack for MS BCL.
7524         (GetPropertyFromAccessor): New method.
7525         (GetEventFromAccessor): New method.
7526         (IsSpecialMethod): Fixed to handle more cases.
7527
7528 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7529
7530         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7531         Made white spaces array static.
7532
7533         * ecore.cs (RemoveGenericArity): Optimized.
7534
7535         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7536         10 times faster).
7537         (MyBitVector.initialize_vector): Simplified.
7538
7539 2006-12-22  Miguel de Icaza  <miguel@novell.com>
7540
7541         * ecore.cs: Am not entirely happy with this hack, but it seems to
7542         address the issue in 80257 (a small test case for
7543         CreativeDocs.NET). 
7544
7545         I set the MethodGroupExpr.Type to an internal compiler type
7546         (itself in this case) to force the resolution to take place.   Why
7547         it does not take place with a null is beyond me.
7548
7549 2006-12-20  Marek Safar  <marek.safar@gmail.com>
7550
7551         A fix for bug #80288
7552         * expression.cs (ResolveOperator): Consider user defined conversion for
7553         logical and operator too.
7554         (EmitBranchable): Optimization for logical and when full constant folding
7555         could not be applied but one operand is constant.
7556
7557 2006-12-19  Marek Safar  <marek.safar@gmail.com>
7558
7559         * class.cs (GetClassBases): Write 5 times every day, will never use
7560         FullName for error reporting.
7561
7562         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7563
7564 2006-12-19  Martin Baulig  <martin@ximian.com>
7565
7566         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7567         the symbol file info here.
7568
7569 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7570
7571         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7572         of `elseif' is taking then following sections are not taking.
7573         Fixes an issue reported on mono mailing list.
7574
7575 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7576
7577         A fix for bug #80300
7578         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7579         a caller is not taking.
7580
7581 2006-12-18  Raja R Harinath  <rharinath@novell.com>
7582
7583         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7584         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7585         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7586         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7587         * class.cs: Update to changes.
7588
7589 2006-12-17  Marek Safar  <marek.safar@gmail.com>
7590
7591         A fix for bug #79934
7592         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7593         partial container.
7594
7595         * class.cs (ResolveMembers): Register an iterator in current container and
7596         not in shared one.
7597
7598 2006-12-16  Raja R Harinath  <rharinath@novell.com>
7599
7600         Fix test-543.cs
7601         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7602         satisfy a params annotated parameter.
7603
7604 2006-12-16  Marek Safar  <marek.safar@gmail.com>
7605
7606         A fix for bug #77014
7607         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7608         paramters correctly and not rely on hacks in Parameters class.
7609         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7610         at any possition.
7611         (Invocation.VerifyArgumentsCompat): Ditto.
7612         (Invocation.EmitArguments): Changed to correctly emit params arguments at
7613         any possition.
7614
7615         * parameter.cs (HasParams): Don't assume that params is the last one.
7616
7617         * support.cs (ReflectionParameters.ctor): Look for params attribute
7618         correctly.
7619         (ReflectionParameters.ParameterType): Removed hack when we returned last
7620         parameter for out of range parameters.
7621         (ParameterName, ParameterModifier): Ditto.
7622
7623 2006-12-14  Marek Safar  <marek.safar@gmail.com>
7624
7625         A fix for bug #79987
7626         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7627         when assembly is not CLS compliant but type is. I have no idea why is this
7628         allowed.
7629
7630         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7631
7632 2006-12-13  Miguel de Icaza  <miguel@novell.com>
7633
7634         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7635         in struct constructors, they are basically no-ops.
7636
7637 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7638
7639         * cs-tokenizer.cs (Position): Save preprocessor status too.
7640
7641 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7642
7643         A fix for bug #77794
7644         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7645
7646 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7647
7648         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7649         Fixes #69299.
7650         (pp_expr): Report error for an invalid expression.
7651         (handle_preprocessing_directive): Simplified; add more error checking.
7652
7653 2006-12-11  Marek Safar  <marek.safar@gmail.com>
7654
7655         A fix for bug #74939
7656         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7657         directives handling.
7658
7659 2006-12-10  Marek Safar  <marek.safar@gmail.com>
7660
7661         A fix for bugs #80093, and #75984
7662         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7663         logic, it seems to me as it worked before "by coincidence".
7664         (xtoken): Simplified to use reworked handle_preprocessing_directive.
7665         (cleanup): Enabled endif check.
7666
7667 2006-12-09  Marek Safar  <marek.safar@gmail.com>
7668
7669         A fix for bug #80162
7670         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7671         enumerators are never ambiguous.
7672
7673 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7674
7675         Fix #80060
7676         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7677
7678 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7679
7680         A fix for bug #80144
7681         * class.cs (EventProperty.Define): Explicit implementation means
7682         that an even is used.
7683
7684 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7685
7686         Fixes the operators implementation (part II)
7687
7688         * cfold.cs (DoConstantNumericPromotions): Renamed to
7689         DoBinaryNumericPromotions and simplified.
7690         (BinaryFold): Couple of conversion fixes; simplified.
7691
7692         * constant.cs, ecore.cs, literal.cs
7693         (ToType): Renamed to ConvertImplicitly.
7694         (Reduce): Renamed to ConvertExplicitly.
7695
7696         * class.cs, convert.cs: Updated.
7697
7698         * expression.cs: TryReduce doesn't throw an exception.
7699
7700 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7701
7702         A fix for bug #80108
7703         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7704         compatible.
7705
7706 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7707
7708         Fixes unary operators implementation (part I)
7709         Also fixes #80026
7710
7711         * cfold.cs (Error_CompileTimeOverflow): Made internal
7712
7713         * const.cs (IConstant): Changed to use reference to constant and
7714         not constant itself.
7715         Updated IConstant implementations.
7716
7717         * constant.cs (CreateConstant): New factory method.
7718         Updated IConstant implementation.
7719
7720         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7721
7722         * ecore.cs: Updated to use CreateConstantReference.
7723
7724         * enum.cs: Reflects IConstant changes.
7725
7726         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7727
7728         * literal.cs (NullConstant): Change to be independently usable.
7729
7730 2006-11-29  Martin Baulig  <martin@ximian.com>
7731
7732         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7733         we need to emit the scope initializer before calling the base .ctor.
7734
7735         * anonymous.cs: Merged back from the new anonymous methods branch.
7736         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7737
7738         * expression.cs (ParameterReference.DoResolveBase): Create a
7739         "normal" ScopeInfo when capturing parameters rather than using the
7740         root scope; this makes things work with anonymous methods having
7741         parameters.
7742
7743         * statement.cs
7744         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7745
7746 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7747
7748         A fix for bug #79987
7749         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7750         check to a base class.
7751         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7752         only when assembly has missing attribute.
7753         * report.cs: Update.
7754
7755 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7756
7757         * cs-tokenizer.cs: Merged with gmcs version.
7758
7759 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7760
7761         * cs-tokenizer.cs,
7762         * cs-parser.jay: Better error message when partial keyword is misplaced.
7763
7764 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7765
7766         A fix for bug #79810
7767         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7768         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7769         a RuntimeWrappedException by default.
7770
7771 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7772
7773         A fix for bug #79843
7774         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7775         implementation.
7776         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7777
7778 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7779
7780         * driver.cs, namespace.cs: Uses faster IndexOf version.
7781
7782 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7783
7784         A fix for bug #79941
7785         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7786         operators.
7787         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7788         even if internal name is different.
7789         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7790         (UserDefinedConversion): Simplified as the operators cannot be internal.
7791         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7792         conversions.
7793         (MethodLookup): Replaced EmitContext with parentType.
7794         * expression.cs: Updated.
7795
7796 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7797
7798         * driver.cs (BadAssembly): Handle all the ugliness of
7799         DefineDynamicAssembly.
7800
7801 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7802
7803         Address parts of #58244 -- most of what's left is in the runtime
7804         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7805         CS1509 error checks, and handle them for all assembly loads, not
7806         just the first invocation.
7807         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7808         * codegen.cs (AssemblyClass.AddModule): ... here.
7809
7810 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7811
7812         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7813         IEnumerable<T> is ambiguous.
7814
7815 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7816
7817         A fix for bug #67689
7818         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7819         GetEnumerator is ambiguous.
7820
7821         * report.cs: Add new warning.
7822
7823 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7824
7825         A fix for bug #78602
7826         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7827         to protected member can be nested type.
7828
7829 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7830
7831         A fix for bug #78965
7832         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7833         to protected member must derive from current type.
7834
7835 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7836
7837         assign.cs: Reuses error method.
7838
7839         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7840         instead of type for constants.
7841         (Expression.Error_ValueAssignment): Common error method.
7842
7843         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7844         for any assignment.
7845
7846 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7847
7848         A fix for bug #79081
7849         * expression.cs (MemberAccess.DoResolve): Check nested type
7850         accessibility.
7851
7852 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7853
7854         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7855
7856 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7857
7858         A fix for bug #76591
7859         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7860
7861 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7862
7863         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7864         type forwarder of the same type multiple times.
7865
7866 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7867
7868         Fix #78820
7869         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7870         instance as an rvalue, even when we later resolve as an lvalue.
7871
7872 2006-10-25  Martin Baulig  <martin@ximian.com>
7873
7874         * anonymous.cs: Fix #79673.
7875
7876 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7877
7878         A fix for bug #79666
7879         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7880         ignored when is optimized (= default value) as its value is already set.
7881
7882 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7883
7884         A fix for bug #79724
7885         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7886         TypeContainer for type lookup.
7887
7888 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7889
7890         A fix for bug #79231
7891         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7892         * expression.cs (OverloadResolve): Always convert type name for
7893         an error message.
7894         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7895         other member.
7896
7897 2006-10-18  Martin Baulig <martin@ximian.com>
7898
7899         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7900
7901 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7902
7903         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7904         an int32, but requesting an int64 from the conversion
7905
7906 2006-10-12  Martin Baulig  <martin@ximian.com>
7907
7908         * anonymous.cs
7909         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7910         
7911 2006-10-12  Martin Baulig  <martin@ximian.com>
7912
7913         * statement.cs
7914         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7915
7916 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7917
7918         * convert.cs: Remove broken code: I was doing the "Existance"
7919         tests for Implicit conversions.
7920
7921 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7922
7923         * convert.cs: Added one missing case in
7924         ImplicitStandardConversionExists uint64 to intptr.
7925
7926         Fixes #59800
7927         
7928         * typemanager.cs (uintptr_type): another core known type.   
7929
7930         * ecore.cs (OperatorCast): routine used to do cast operations that
7931         depend on op_Explicit.  We could change some of the Decimal
7932         conversions to use this.
7933
7934         This one has a probe mechanism that checks both types for an op_
7935         which it coudl be used to eliminate two classes: CastToDecimal
7936         and CastFromDecimal.
7937
7938         * convert.cs: Implement the conversions documented in #59800
7939         
7940 2006-10-10  Martin Baulig  <martin@ximian.com>
7941
7942         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7943         before RootScope.ResolveMembers().
7944
7945         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7946         `CurrentType' if appropriate.
7947
7948 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7949
7950         A fix for bug #78568
7951         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7952         when contains binary operators.
7953         * cs-parser.jay: Updated.
7954
7955 2006-10-09  Martin Baulig  <martin@ximian.com>
7956
7957         * delegate.cs
7958         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7959         moved that into Define() and also do the other type parameter
7960         checks there.  Fixes #79094.  Added gtest-292.cs.
7961
7962         * expression.cs
7963         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7964         since that doesn't include type parameters; don't use `Ldelema'
7965         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7966
7967 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7968
7969         A fix for #77796
7970         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7971         conversion is allowed.
7972
7973 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7974
7975         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7976         error reporting when no error occurs.
7977
7978 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7979
7980         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7981         does not exist.
7982
7983 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7984
7985         Fix #79584
7986         * class.cs (DefineTypeBuilder): Check circular dependencies before
7987         setting the parent of the TypeBuilder.
7988         (CheckRecursiveDefinition): Don't use 'BaseType', since
7989         it may not be valid until after DefineTypeBuilder.  Use
7990         'base_type' instead.
7991
7992 2006-10-04  Martin Baulig  <martin@ximian.com>
7993
7994         Merged the Anonymous Methods patch.
7995
7996         * anonymous.cs, iterators.cs: The new anonymous methods code.
7997
7998         * statement.cs (Variable): New public abstract class.
7999         (LocalInfo.Variable): New public property.
8000         (LocalInfo.ResolveVariable): New public method.
8001         (Block.Flags): Add `IsIterator'.
8002         (Block.AddVariable): Improved the CS0136 check.
8003         (Block.AnonymousChildren): New public property.
8004         (Block.AddAnonymousChild): New public method.
8005         (ToplevelBlock): Update to use the new anonymous method framework.
8006         (ToplevelBlock.ctor): `container' is now a `Block' and not a
8007         `ToplevelBlock'; this is required to correctly implement the
8008         CS0136 check.
8009         (Fixed, Using): Use `TemporaryVariable' instead of directly
8010         creating the `LocalBuilder'.
8011
8012         * parameter.cs (Parameter.ResolveVariable): New public method.
8013         (Parameters.ResolveVariable): Likewise.
8014
8015         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
8016
8017         * class.cs (TypeContainer): Replaced the `iterators' list and
8018         corresponding methods with a list of `CompilerGeneratedClass'es.
8019         (TypeContainer.ResolveMembers): New public method.
8020         (Method): `IIteratorContainer' has been replaced by
8021         `IAnonymousHost'.
8022
8023         * expression.cs (VariableReference): New public abstract base
8024         class for `LocalVariableReference', `ParameterReference' and
8025         `This'.
8026
8027         * codegen.cs (EmitContext): Removed `capture_context',
8028         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
8029         (EmitContext.EmitThis): Removed.
8030
8031         * cs-parser.jay: Replace `iterator_container' with
8032         `anonymous_host'.       
8033
8034 2006-10-04  Martin Baulig  <martin@ximian.com>
8035
8036         * generic.cs (GenericMethod): Don't make this abstract.
8037         (Constraints.Clone): Added dummy implementation.
8038
8039 2006-10-04  Raja R Harinath  <harinath@gmail.com>
8040
8041         Fix #79577
8042         * namespace.cs (LookForAnyGenericType): Avoid nullref on
8043         'declspaces'.  Avoid allocating arrays willy-nilly.
8044
8045         Fix #79553
8046         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
8047         cases out of the switch.
8048
8049 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
8050
8051         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
8052         message when non-generic type is used with the type arguments.
8053         * expression.cs: Updated.
8054
8055 2006-09-28  Raja R Harinath  <rharinath@novell.com>
8056
8057         Fix #79013
8058         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
8059         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8060         Change semantics slightly.  Don't insist on having only one
8061         temporary EmptyExpression -- just throttle the creation of new ones.
8062
8063         Fix #79451
8064         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
8065         non-interfaces too.  If no methods are found, don't try to create
8066         a MethodGroupExpr.
8067
8068 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
8069
8070         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
8071         generic type.
8072
8073         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
8074         us produce better error message.
8075
8076 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
8077
8078         * expression.cs (Binary.ResolveOperator): Warn about a side effect
8079         of the `|' operator.
8080
8081         * report.cs: A new warning added.
8082
8083 2006-09-27  Martin Baulig  <martin@ximian.com>
8084
8085         * generic.cs (GenericMethod): Don't make this abstract.
8086
8087 2006-09-27  Martin Baulig  <martin@ximian.com>
8088
8089         * report.cs
8090         (InternalErrorException): Added overloaded ctor taking a params array.
8091
8092 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
8093
8094         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8095         Fixed the cases when same error was reported twice.
8096
8097         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8098         now report symbol information.
8099
8100 2006-09-25  Martin Baulig  <martin@ximian.com>
8101
8102         * class.cs: Completely unified with the gmcs version.
8103
8104 2006-09-25  Martin Baulig  <martin@ximian.com>
8105
8106         * typemanager.cs (TypeManager.IsNullableType): New public function.
8107         (TypeManager.IsNullableTypeOf): Likewise.
8108         (TypeManager.IsNullableValueType): Likewise.
8109
8110         * class.cs (MethodCore): Added the `GenericMethod' argument from
8111         gmcs and also unified all classes derived from `MethodCore' with gmcs.
8112
8113 2006-09-24  Raja R Harinath  <harinath@gmail.com>
8114
8115         * convert.cs: Unify with gmcs version.
8116
8117 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8118
8119         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8120         verify them as well.
8121
8122         * report.cs: New warning.
8123
8124 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8125
8126         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8127         for anonymous block with out argument.
8128
8129 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8130
8131         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8132         not used private events only.
8133
8134 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
8135
8136         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8137
8138         * const.cs (Const.Define): Check for constant type.
8139         (Const.IsConstantTypeValid): Looks for valid constant types.
8140
8141         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8142
8143         * ecore.cs (EmptyConstantCast): New common class for all constant based
8144         EmptyCast(s).
8145
8146         * expression.cs (Is.DoResolve): Handle null constant especially.
8147         (New.DoResolve): Check for new void().
8148         (MemberAccess.DoResolve): Cope with all kind of nulls.
8149
8150         * literal.cs (NullConstant): Uses EmptyConstantCast.
8151         (NullDefault): Based on EmptyConstantCast.
8152         (NullLiteral): Uses EmptyConstantCast.
8153
8154         * statement.cs (Block.ResolveMeta): Check for constant type.
8155
8156 2006-09-22  Martin Baulig  <martin@ximian.com>
8157
8158         * delegate.cs, attribute.cs: Merged with the gmcs versions.
8159
8160 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8161
8162         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8163         not the null type.
8164
8165         Fix part of #79451
8166         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8167         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
8168         code slightly.
8169
8170 2006-09-22  Martin Baulig  <martin@ximian.com>
8171
8172         * ecore.cs: Merged with the gmcs version.
8173
8174         * generic.cs (ConstructedType): New dummy class.
8175         (TypeArguments): Don't make this abstract.
8176
8177         * typemanager.cs
8178         (TypeManager.IsGenericTypeDefinition): New method.
8179         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8180
8181 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8182
8183         * expression.cs (ComposedCast): Check for arrays of TypedReference
8184         before creating the type, not after.
8185
8186 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
8187
8188         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8189         after ToType change.
8190
8191         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8192         when constant must be implicitly convertible.
8193
8194         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8195
8196         * ecore.cs (NullCast): Derives from NullConstant.
8197
8198         * expression.cs (Is.DoResolve): Removed useless variables.
8199         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8200         (New.Constantify): Add enum support.
8201         (MemberAccess.DoResolve): Add warning when accessing null constant or
8202         variable.
8203
8204         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8205         property.
8206
8207         * literal.cs (NullConstant): New abstract class with common
8208         functionality for all null specializations.
8209         (NullDefault): Represents default(X) when result can be
8210         reduced to null.
8211         (NullLiteral): Updated.
8212
8213         * report.cs: Add new warning.
8214
8215 2006-09-21  Martin Baulig  <martin@ximian.com>
8216
8217         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8218
8219 2006-09-21  Martin Baulig  <martin@ximian.com>
8220
8221         * generic.cs (GenericConstraints): New dummy class.
8222         (Constraints): Likewise.
8223         (TypeParameter): Likewise.
8224         (TypeParameterName): Likewise.
8225         (GenericMethod): Likewise.
8226
8227         * typemanager.cs (TypeManager.GetGenericArguments): New method.
8228
8229         * decl.cs: Merged with the gmcs version.
8230
8231 2006-09-21  Raja R Harinath  <rharinath@novell.com>
8232
8233         * generic.cs (TypeParameter): Implement IMemberContainer.
8234         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
8235
8236         * rootcontext.cs: Unify with gmcs version.
8237
8238         * report.cs: Unify with gmcs version.
8239         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8240         from gmcs/generics.cs.
8241         * generics.cs (TypeParameter): New dummy class.
8242
8243         * support.cs: Unify with gmcs version.
8244
8245 2006-09-20  Raja R Harinath  <rharinath@novell.com>
8246
8247         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8248         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8249
8250         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8251         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8252         * mcs.exe.sources: Add generic.cs.
8253
8254         * codegen.cs: Unify with gmcs version.
8255
8256         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8257         (EmitContext): Add GenericDeclContainer implementation.
8258         * decl.cs (MemberCore, DeclSpace): Likewise.
8259         * namespace.cs: Remove #ifdef GMCS_SOURCE.
8260
8261         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8262         MCS TypeManager has a corresponding dummy method.
8263
8264 2006-09-19  Martin Baulig  <martin@ximian.com>
8265
8266         * expression.cs: Completely merged with the gmcs version.
8267
8268 2006-09-19  Martin Baulig  <martin@ximian.com>
8269
8270         * expression.cs (Invocation): Merged with the gmcs version.
8271         (ArrayAccess.GetStoreOpcode): Likewise.
8272
8273 2006-09-19  Martin Baulig  <martin@ximian.com>
8274
8275         * typemanager.cs
8276         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8277         (TypeManager.IsGenericMethodDefinition): Likewise.
8278
8279 2006-09-19  Martin Baulig  <martin@ximian.com>
8280
8281         * typemanager.cs
8282         (TypeManager.IsEqual): Moved the gmcs implementation here.
8283         (TypeManager.DropGenericTypeArguments): Likewise.
8284         (TypeManager.DropGenericMethodArguments): Likewise.
8285         (TypeManager.GetTypeArguments): Moved here from gmcs.
8286         (TypeManager.HasGenericArguments): Likewise.
8287
8288 2006-09-19  Martin Baulig  <martin@ximian.com>
8289
8290         * expression.cs (Binary): Merged with the gmcs version.
8291
8292 2006-09-19  Martin Baulig  <martin@ximian.com>
8293
8294         * expression.cs (Probe, As, Is): Merged with the gmcs version.
8295
8296 2006-09-19  Martin Baulig  <martin@ximian.com>
8297
8298         * typemanager.cs: Merged with the gmcs version.
8299
8300 2006-09-16  Raja R Harinath  <rharinath@novell.com>
8301
8302         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8303         * driver.cs: Likewise.
8304
8305 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
8306
8307         A fix for #79401
8308         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8309         only if parent type is class.
8310         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8311         update.
8312
8313 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
8314
8315         * cs-parser.jay,
8316         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8317         keywords are used.
8318         * typemanager.cs(CSharpName): Converts NullType to null.
8319
8320 2006-09-15  Martin Baulig  <martin@ximian.com>
8321
8322         * typemanager.cs
8323         (TypeManager.GetMethodName): Added mcs implementation.
8324         (TypeManager.IsEqual): Likewise.
8325
8326         * ecore.cs
8327         (SimpleName.RemoveGenericArity): Added dummy implementation.
8328
8329         * pending.cs: Merged with the gmcs version.     
8330
8331 2006-09-15  Martin Baulig  <martin@ximian.com>
8332
8333         * statement.cs: Merge with the gmcs version.
8334
8335 2006-09-15  Martin Baulig  <martin@ximian.com>
8336
8337         * statement.cs (Switch): Merge with the gmcs implementation
8338         (without nullables), which is newer.
8339
8340 2006-09-15  Martin Baulig  <martin@ximian.com>
8341
8342         * statement.cs (Block.Variables): Make this public.
8343         (ToplevelBlock.Parameters): Make this a property.
8344         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8345
8346 2006-09-15  Martin Baulig  <martin@ximian.com>
8347
8348         * namespace.cs: Merge with the gmcs version.
8349
8350 2006-09-15  Martin Baulig  <martin@ximian.com>
8351
8352         * decl.cs (MemberName): Minor code cleanups.
8353
8354 2006-09-15  Martin Baulig  <martin@ximian.com>
8355
8356         * parameter.cs: Merge with the gmcs version.
8357
8358 2006-09-15  Martin Baulig  <martin@ximian.com>
8359
8360         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8361         and an error in mcs.
8362
8363 2006-09-15  Martin Baulig  <martin@ximian.com>
8364
8365         * flowanalysis.cs: Merged from GMCS; added the generics code into
8366         a `GMCS_SOURCE' conditional so we can share this file.
8367
8368 2006-09-08  Martin Baulig  <martin@ximian.com>
8369
8370         * typemanager.cs (TypeManager.interlocked_type): New public field.
8371         (TypeManager.int_interlocked_compare-exchange): New public field.
8372         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8373         enumerator types here and call InitGenericCoreTypes().
8374         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8375         after calling InitEnumUnderlyingTypes().
8376
8377         * rootcontext.cs
8378         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8379         `classes_second_stage'. 
8380
8381 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
8382
8383         * assign.cs, ecore.cs, expression.cs: Share error message text.
8384         * class.cs (FieldMember.Define): Check for varible of static type.
8385         * driver.cs (LoadAssembly): Uses error output for errors.
8386         * statement.cs: Updated.
8387
8388 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
8389
8390         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8391         type instance.
8392
8393 2006-09-07  Martin Baulig  <martin@ximian.com>
8394
8395         * driver.cs
8396         (MainDriver): Revert r62663 from Marek; see #70506 for details.
8397
8398 2006-08-29  Miguel de Icaza  <miguel@novell.com>
8399
8400         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8401         
8402 2006-08-17  Miguel de Icaza  <miguel@novell.com>
8403
8404         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8405         #52019 and #79064, the use of the \uXXXX sequence in source code
8406         to represent unicode characters.
8407
8408 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
8409
8410         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8411         support.
8412         * class.cs, ecore.cs, statement.cs: Merged to one error message.
8413
8414 2006-08-13  Miguel de Icaza  <miguel@novell.com>
8415
8416         * assign.cs: Catch attempts to assign to a method groups in += and
8417         report as 1656
8418
8419 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
8420
8421         A fix for #79056
8422         * cs-parser.jay: Don't destroy current array type by typeof of array's.
8423
8424 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
8425
8426         * class.cs (Method.Define): Issue a warning when generic method looks like
8427         an entry point.
8428         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8429         as well.
8430
8431 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
8432  
8433         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8434         looking for ctor.
8435         * decl.cs (MemberCache.FindMembers): When container is interface we need to
8436         search all base interfaces as a member can be ambiguous.
8437         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8438         Constructor member type filter. 
8439         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8440         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8441         reporting for returned memberinfos.
8442         * report.cs: Updated.
8443         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8444         version to work on all runtimes.
8445         (TypeManager.RealMemberLookup): Removed members filtering.
8446
8447 2006-08-08  Raja R Harinath  <rharinath@novell.com>
8448
8449         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8450         (PropertyExpr.EmitAssign): Likewise.
8451         * expression.cs (Indirection.EmitAssign): Likewise.
8452         (LocalVariableReference.EmitAssign): Likewise.
8453         (ParameterReference.EmitAssign): Likewise.
8454         (Invocation.EmitArguments): Likewise.
8455         (ArrayAccess.EmitAssign): Likewise.
8456         (IndexerAccess.EmitAssign): Likewise.
8457         (This.EmitAssign): Likewise.
8458         (ConditionalLogicalOperator.Emit): Likewise.
8459
8460         Fix #79026
8461         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
8462         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
8463         leave it in after returning it.
8464         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
8465
8466 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
8467
8468         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8469         message.
8470
8471 2006-08-03  Raja R Harinath  <rharinath@novell.com>
8472
8473         Fix cs0146-3.cs and cs0146-4.cs.
8474         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8475         enclosing types don't depend on the current type.
8476
8477 2006-08-02  Raja R Harinath  <rharinath@novell.com>
8478
8479         Fix #77963
8480         * class.cs (TypeContainer.DoDefineMembers): Use
8481         FindBaseMemberWithSameName on Parent, since we're interested in
8482         whether we hide inherited members or not.
8483         (FindBaseMemberWithSameName): Make slightly more robust.
8484
8485         Fix the non-generic testcase from #77396
8486         * decl.cs (DeclSpace.DeclContainer): Remove override.
8487
8488         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8489         declspaces for doppelgangers too.
8490         (UsingEntry): Implement IResolveContext.
8491         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
8492         'this' as the resolve context.
8493         (LocalAliasEntry): Likewise.
8494
8495         Implement parts of #77403
8496         * roottypes.cs (RootDeclSpace): New.  Used to represent the
8497         toplevel declaration space.  Each namespace declaration introduces
8498         a "partial" root declaretion space.
8499         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8500         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8501         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8502         from 'current_namespace.SlaveDeclSpace'.
8503         (namespace_declaration): Likewise.
8504         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8505         check.  It can't happen now.
8506         * decl.cs (DeclSpace.LookupType): Likewise.
8507         * driver.cs (MainDriver): Sanity check.
8508
8509 2006-08-01  Raja R Harinath  <rharinath@novell.com>
8510
8511         * decl.cs (DeclSpace.FindNestedType): Remove.
8512         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8513         LookupTypeContainer to get the container of the nested type.
8514         * class.cs (TypeContainer.FindNestedType): Make non-override.
8515
8516 2006-07-31  Raja R Harinath  <rharinath@novell.com>
8517
8518         * decl.cs (DeclSpace.PartialContainer): Move field from ...
8519         * class.cs (TypeContainer.PartialContainer): ... here.
8520         (TypeContainer.AddBasesForPart): New helper.
8521         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
8522         instead.
8523         * cs-parser.jay (current_class): Convert to DeclSpace.
8524         (struct_declaration, interface_declaration, class_declaration):
8525         Use AddBasesForPart instead of .Bases directly.
8526         * const.cs, iterators.cs: Update to changes.
8527
8528 2006-07-28  Raja R Harinath  <rharinath@novell.com>
8529
8530         * class.cs (TypeContainer.AddMemberType): Rename from
8531         AddToTypeContainer.
8532         (TypeContainer.AddMember): Rename from AddToMemberContainer.
8533         (AddTypeContainer): New.  Combine AddClassOrStruct and
8534         AddInterface.
8535         (AddPartial): Update.  Add 'is_partial' argument.
8536         * roottypes.cs: Update to changes.
8537         * cs-parser.jay (push_current_class): New helper for handling
8538         current_container and current_class.
8539         (struct_declaration, interface_declaration, class_declaration):
8540         Use it.
8541
8542 2006-07-26  Raja R Harinath  <rharinath@novell.com>
8543
8544         * roottypes.cs: Rename from tree.cs.
8545
8546         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8547         * tree.cs (Tree, ITreeDump): Remove types.
8548         * rootcontext.cs (tree, Tree): Remove fields.
8549         (root, ToplevelTypes): New.
8550         * *.cs: Update to rename.
8551
8552         * tree.cs (Tree.RecordDecl): Remove.
8553         (RootTypes.AddToTypeContainer): Record the toplevel type in its
8554         namespace here.
8555         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8556
8557 2006-07-23  Raja R Harinath  <harinath@gmail.com>
8558
8559         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8560         DoFlowAnalysis and OmitStructFlowAnalysis here.
8561         (ec.With): Rename from WithUnsafe and generalize.
8562         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
8563         (ec.WithFlowAnalyis): New.
8564         * ecore.cs, expression.cs, statement.cs: Update.
8565
8566 2006-07-22  Raja R Harinath  <harinath@gmail.com>
8567
8568         * statement.cs (Block.ResolveMeta): Simplify slightly.
8569
8570         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
8571         multiple boolean fields.  Convert InUnsafe, constant_check_state,
8572         check_state to flags.
8573         (CheckState, ConstantCheckState): Update.
8574         (InUnsafe): New read-only property.
8575         (FlagsHandle): Rename from CheckStateHandle and convert to handle
8576         arbitrary flags.
8577         (WithUnsafe): New helper similar to WithCheckState.
8578         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8579         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8580
8581 2006-07-21  Raja R Harinath  <rharinath@novell.com>
8582
8583         Make comparisons use the same IL irrespective of whether they're
8584         in a 'checked' or 'unchecked' context: one of the issues in #78899
8585         * codegen.cs (EmitContext.CheckState): Make read-only property.
8586         (EmitContext.ConstantCheckState): Likewise.
8587         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8588         helper that implement a save/restore stack for CheckState
8589         values.  This is the only way to change check-state.
8590         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8591         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8592         (CheckedExpr.EmitBranchable): New forwarding method.
8593         (UnCheckedExpr): Likewise.
8594         * statement.cs (Block.ResolveMeta): Use WithCheckState.
8595         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8596         (Checked.Resolve, checked.DoEmit): Likewise.
8597
8598 2006-07-20  Miguel de Icaza  <miguel@novell.com>
8599
8600         * anonymous.cs: Cache the resolved anonymous delegate, and return
8601         this so that the ResolveTopBlock is only triggered once, not
8602         twice.
8603
8604         Currently we trigger ResolvetopBlock twice due to a first pass of
8605         argument check compatibility, and a second pass that does the
8606         actual resolution.   
8607         
8608 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8609
8610         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8611         modifiers.
8612         * rootcontext.cs (Reset): Add helper_classes.
8613
8614 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8615
8616         A fix for #78860
8617         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8618         correctly.
8619
8620 2006-07-13  Miguel de Icaza  <miguel@novell.com>
8621
8622         * statement.cs (Lock): Handle expressions of type
8623         TypeManager.null_type specially.  Fixes #78770
8624
8625 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8626
8627         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8628         to an event.
8629
8630 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8631
8632         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8633         for accessors as well.
8634         * ecore.cs (EventExpr): Add AccessorTable.
8635
8636 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
8637
8638         A fix for #78738
8639         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8640         for CS0122 where appropriate.
8641         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8642         level attributes.
8643         (Filter): Assembly can be null in the case of top level attributes.
8644
8645 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
8646
8647         A fix for #78690
8648
8649         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8650         is done at global level.
8651
8652 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8653
8654         A fix for #77002, Implemented TypeForwarder support.
8655
8656         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8657         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8658         * typemanager.cs (): Add type_forwarder_attr_type.
8659
8660 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8661
8662         * report.cs: Add CS0469 warning.
8663
8664 2006-06-21  Martin Baulig  <martin@ximian.com>
8665
8666         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8667         the `try'-block, so we also report CS0016 etc. there.
8668
8669 2006-06-21  Martin Baulig  <martin@ximian.com>
8670
8671         * delegate.cs
8672         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8673
8674 2006-06-21  Martin Baulig  <martin@ximian.com>
8675
8676         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8677         also report CS1686 for parameters.
8678
8679 2006-06-21  Martin Baulig  <martin@ximian.com>
8680
8681         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8682         instead of an error if the value is not implicitly convertible to
8683         the switch types; fixes #77964.
8684
8685 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8686
8687         Fix #78673
8688         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8689         FieldBuilder is null.
8690
8691         Fix #78662
8692         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8693         'left' and 'right' before error-checking.
8694
8695 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8696
8697         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8698         Fixed bug #78601.
8699         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8700         (FieldExpr.DoResolve): likewise.
8701         (PropertyExpr.InstanceResolve): likewise.
8702         (EventExpr.InstanceResolve): likewise. 
8703
8704 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8705
8706         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8707         attribute applicable tests for attribute argument.
8708
8709 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8710
8711         Fix #78079
8712         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8713         (Binary.OverloadResolve_PredefinedIntegral): New.
8714         (Binary.OverloadResolve_PredefinedFloating): New.
8715         (Binary.OverloadResolve_PredefinedString): New.
8716         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8717         Follow the standard more closely, and treat numeric promotions in
8718         terms of overload resolution.
8719         (Binary.CheckShiftArguments): Simplify.
8720
8721 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8722
8723         * flowanalysis.cs (MyBitVector): Simplify representation.
8724         (MyBitVector.Clone): Avoid allocating BitArray.
8725         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8726         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8727         (*): Update.  Change all references to MyBitVector.And and
8728         MyBitVector.Or to &= and |=.
8729
8730 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8731
8732         Fix cs0231-[34].cs.
8733         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8734         to param arguments too.
8735
8736 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8737
8738         * cs-parser.jay: Catch another parsing form for arglist being
8739         followed by other arguments.  Fixes #78313.
8740
8741 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8742
8743         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8744         checking of out parameters to ...
8745         (FlowBranchingToplevel.Merge): ... here.
8746         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8747         set, propagate the origin upward, and only complain if there was
8748         no other error.
8749         (FlowBranchingException.AddContinueOrigin): Likewise.
8750         (FlowBranchingException.AddReturnOrigin): Likewise.
8751         (FlowBranchingException.AddGotoOrigin): Likewise.       
8752
8753 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8754
8755         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8756         unreachable, skip it.
8757         (FlowBranchingException.Merge): Always propagate jumps, even if
8758         the finally block renders subsequent code unreachable.
8759
8760 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8761
8762         Fix #77601
8763         * statement.cs (Goto.Resolve): Move responsibility for resolving
8764         'goto' to FlowBranching.AddGotoOrigin.
8765         (Goto.SetResolvedTarget): New.  Callback to set the
8766         LabeledStatement that's the target of the goto.
8767         (Goto.DoEmit): Use Leave instead of Br when crossing an
8768         unwind-protect boundary.
8769         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8770         LookupLabel and adjust to new semantics.
8771         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8772         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8773         Goto.SetResolvedTarget to update target.
8774         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8775         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8776         AddBreakOrigin & co.  Delay propagation until ...
8777         (FlowBranchingException.Merge): ... this.
8778
8779         * statement.cs (Block.Resolve): Always depend on flow-branching to
8780         determine unreachability.  Kill workaround that originally emitted
8781         only one statement after an "unreachable" label (see infloop in
8782         test-515.cs).
8783
8784         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8785         This is still "wrong", but anything better would probably need a
8786         multi-pass algorithm.
8787         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8788         usage vector.  Force current usage vector to be reachable, to
8789         optimistically signify backward jumps.
8790         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8791         detected.
8792         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8793         detected, return the original salted-away usage vector instead,
8794         updated with appropriate changes.  Print unreachable warning if
8795         necessary.
8796         * statement.cs (Block.Resolve): Don't print unreachable warning on
8797         a labeled statement.
8798
8799 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8800
8801         * driver.cs: Pass filename without path to AssemblyBuilder's 
8802         AddResourceFile. Fixes bug #78407.
8803
8804 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8805
8806         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8807         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8808         (FlowBranching.MergeChild): Overwrite
8809         reachability information from Labeled branchings too.
8810
8811 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8812
8813         * statement.cs (Goto.Resolve): Merge jump origins here ...
8814         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8815
8816         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8817         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8818         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8819         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8820         here, ...
8821         * statement.cs (Goto.Resolve): ... not here.
8822         (Goto.Emit): Remove CS1632 check.
8823
8824 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8825
8826         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8827         error message.
8828
8829 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8830
8831         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8832         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8833         (FlowBranchingException.Label): Likewise.
8834
8835         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8836         given value.
8837         (MyBitVector.Or): Use it to avoid losing information (Count).
8838         (FlowBranching.MergeOrigins): Likewise.
8839
8840         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8841         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8842         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8843         (UsageVector.ToString): Simplify.
8844         (UsageVector.MergeSiblings): Move here from ...
8845         (FlowBranching.Merge): ... here.
8846         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8847         not a MyBitVector.
8848
8849 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8850
8851         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8852         null bitvector is treated as all-true.
8853
8854         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8855         (MyBitVector): Rationalize invariants.  'vector != null' implies
8856         that we have our own copy of the bitvector.  Otherwise,
8857         'InheritsFrom == null' implies all inherited bits are true.
8858
8859 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8860
8861         * statement.cs (LocalInfo): Add IsConstant.
8862         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8863         local variable for constants.
8864
8865 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8866
8867         * flowanalysis.cs (MyBitVector.Empty): New.
8868         (MyBitVector): Don't allow InheritedFrom to be null.
8869         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8870         (UsageVector, FlowBranching): Update to changes.
8871
8872         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8873         recursion.  The 'Parent == null' condition isn't sufficient for
8874         anonymous methods.
8875         (FlowBranching.AddBreakOrigin): Likewise.
8876         (FlowBranching.AddContinueOrigin): Likewise.
8877         (FlowBranching.AddReturnOrigin): Likewise.
8878         (FlowBranching.StealFinallyClauses): Likewise.
8879         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8880         (FlowBranching.CheckOutParameters): Likewise.
8881         (FlowBranchingToplevel): Terminate all the above recursions here.
8882         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8883         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8884
8885         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8886         toplevel block.
8887         (FlowBranchingToplevel): New.  Empty for now.
8888         (FlowBranching.MergeTopBlock): Update.
8889         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8890         branching for the anonymous delegate.
8891         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8892
8893         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8894         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8895         information at the start of the merge.  Reorganize.
8896
8897 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8898
8899         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8900
8901 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8902
8903         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8904         to newly introduced ctor.
8905
8906         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8907         message to one place.
8908         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8909         global namespace.
8910
8911 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8912
8913         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8914
8915         * ecore.cs (Expression.ResolveAsConstant): Updated.
8916
8917         * statement.cs (ResolveMeta): Updated.
8918
8919 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8920
8921         * cs-parser.jay: __arglist cannot be used in initializer.
8922
8923 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8924
8925         A fix for #77879
8926         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8927         private types.
8928
8929 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8930
8931         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8932         (LabeledStatement): Add 'name' parameter.
8933         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8934         (Block.AddLabel): Update to changes.
8935         * cs-parser.jay (labeled_statement): Likewise.
8936
8937         * flowanalysis.cs (BranchingType.Labeled): New.
8938         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8939         (FlowBranchingLabeled): New.  Does nothing for now, but will
8940         eventually handle 'goto' flows.
8941         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8942         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8943         that's terminated ...
8944         (Block.Resolve): ... here.
8945
8946         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8947         (UsageVector.MergeFinallyOrigins): Likewise.
8948         (FlowBranching.InTryOrCatch): Likewise.
8949         (FlowBranching.AddFinallyVector): Likewise.
8950         (FlowBranchingException): Update to changes.
8951
8952         Fix #78290
8953         * statement.cs (Return.Resolve): Move error checking to ...
8954         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8955         (FlowBranchingException): Handle return origins like break and
8956         continue origins.
8957         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8958
8959 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8960
8961         A fix for #76122
8962         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8963         filter.
8964
8965 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8966
8967         A fix for #77543
8968         * class.cs (MethodData.Define): Do public accessor check only when method
8969         implements an interface.
8970
8971 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8972
8973         Remove special handling of 'break'
8974         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8975         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8976         (UsageVector.Break): Remove.
8977         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8978         reachability.
8979         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8980
8981         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8982         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8983
8984 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8985
8986         A fix for #75726
8987         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8988         be the interface member.
8989
8990 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8991
8992         A fix for #60069
8993         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8994         for emitting small (int) values.
8995
8996 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8997
8998         Fix #59427
8999         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
9000         control-flow passes through the 'finally' after merging-in all the
9001         control-flows from 'try' and the 'catch' clauses.
9002
9003         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
9004         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
9005         always true at the only non-recursive entry point.
9006         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
9007         FlowBranchingBreakable.
9008         (FlowBranchingLoop): Remove.
9009         * statement.cs (Return.DoResolve): Update to changes.
9010
9011         Fix #76471, #76665
9012         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
9013         (FlowBranching.CreateBranching): Handle it: create a
9014         FlowBranchingContinuable.
9015         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
9016         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
9017         except that it handles the 'continue' command.
9018         (FlowBranching.UsageVector.MergeOrigins): Rename from
9019         MergeBreakOrigins.
9020         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
9021         except that it overrides AddContinueOrigin.
9022         (FlowBranchingException): Override AddContinueOrigin, similar to
9023         AddBreakOrigin.
9024         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
9025         Create a new branching around the embedded statement.
9026         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
9027         control flow after the embedded statement.
9028         (Continue.Resolve): Move all error checking to AddContinueOrigin.
9029
9030         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
9031         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
9032         FlowBranchingBreakable.
9033         (FlowBranchingSwitch): Remove.
9034
9035         Fix test-503.cs
9036         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
9037         error reporting to ...
9038         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
9039         Rename from 'AddBreakVector'.  Add new location argument.  Return
9040         a bool indicating whether the 'break' crosses an unwind-protect.
9041         (FlowBranchingException.AddBreakOrigin): Add.
9042         (FlowBranchingException.Merge): Propagate 'break's to surrounding
9043         flowbranching after updating with the effects of the 'finally'
9044         clause.
9045         (FlowBranchingBreakable): New common base class for
9046         FlowBranchingLoop and FlowBranchingSwitch.
9047
9048         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
9049         embedded statement.
9050         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
9051
9052 2006-05-02  Raja R Harinath  <rharinath@novell.com>
9053
9054         * statement.cs (Do.Resolve): If the loop is infinite, set the
9055         barrier.
9056         (While.Resolve, For.Resolve): Set a barrier after the embedded
9057         statement.  There's no direct control flow that goes from the end
9058         of the embedded statement to the end of the loop.
9059         * flowanalysis.cs (FlowBranching.Infinite): Remove.
9060         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
9061         above ensure that the reachability is correctly computed.
9062
9063         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
9064         (UsageVector.MergeBreakOrigins): If the current path is
9065         unreachable, treat it as if all parameters/locals are initialized.
9066         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
9067         infinite loops before merging-in break origins.
9068
9069         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
9070         (Reachability.Reachable): Split part into ...
9071         (Reachability.Unreachable): ... this.  Simplify.
9072         (Reachability.IsUnreachable): Use 'Unreachable' instead.
9073
9074         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
9075         (Reachability.SetThrowsSometimes): Likewise.
9076         (FlowBranchingBlock.MergeTopBlock): Don't compare against
9077         TriState.Always, use corresponding property.
9078         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
9079         (Block.Resolve): Likewise.  Remove some redundant checks.
9080
9081 2006-05-02  Raja R Harinath  <harinath@gmail.com>
9082
9083         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
9084         (Reachability.Meet): Don't bother checking AlwaysThrows --
9085         barrier is always set.
9086         (FlowBranchingBlock.Merge): Likewise.
9087
9088 2006-05-01  Raja R Harinath  <harinath@gmail.com>
9089
9090         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9091         checks for unreachable.
9092
9093 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
9094
9095         A fix for #77980
9096         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9097
9098         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9099         whether field is really assigned.
9100
9101 2006-04-30  Raja R Harinath  <harinath@gmail.com>
9102
9103         * flowanalysis.cs (Reachability): Make 4-argument constructor
9104         private.
9105         (Reachability.Meet): Rename from 'And'.  Remove static variant.
9106         (Reachability.Always): Rename from the highly misleading
9107         'Reachability.Never'.
9108         (FlowBranching.Merge): Update to changes.  Mark an impossible
9109         situation with a 'throw'.
9110         (*): Update to changes.
9111
9112 2006-04-29  Raja R Harinath  <harinath@gmail.com>
9113
9114         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9115         Remove 'Undefined'.
9116         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9117         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9118         (*): Update to changes.
9119         * statement.cs: Update to changes.
9120
9121 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
9122
9123         A fix for #78049
9124         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9125
9126 2006-04-28  Raja R Harinath  <harinath@gmail.com>
9127
9128         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9129         dummy UsageVector.
9130
9131         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9132         argument to two arguments: an usage-vector and a bool.  Move call
9133         to FlowBranching.Merge () ...
9134         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9135
9136         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9137         handling of loop and switch reachability to ...
9138         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9139
9140 2006-04-27  Raja R Harinath  <harinath@gmail.com>
9141
9142         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9143         handling to FlowBranchingLoop.InLoop.
9144         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9145
9146 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
9147
9148         A fix for #78115
9149         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9150         anonymous method is allowed from AnonymousContainer here.
9151
9152         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9153
9154 2006-04-24  Raja R Harinath  <rharinath@novell.com>
9155
9156         Fix #78156
9157         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9158
9159 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
9160
9161         A fix for #49011.
9162         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9163         (DoubleConstant.Reduce): Ditto.
9164
9165 2006-04-23  Raja R Harinath  <rharinath@novell.com>
9166
9167         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9168         Remove 'lvalue_right_side' argument.  Move parts to ...
9169         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9170         (LocalVariable.DoResolveLValue): ... these.
9171
9172 2006-04-21  Raja R Harinath  <rharinath@novell.com>
9173
9174         Fix cs1655.cs
9175         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9176         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9177         (LocalVariableReference.DoResolveBase): Use it to implement new
9178         CS1655 check.
9179         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9180         (Argument.Resolve): Simplify.  Move CS1510 check ...
9181         * ecore.cs (Expression.ResolveLValue): ... here.
9182         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9183         (PropertyExpr.DoResolveLValue): Likewise.
9184         (FieldExpr.Report_AssignToReadonly): Likewise.
9185         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
9186         LValueMemberAccess or LValueMemberOutAccess on instance depending
9187         on it.
9188         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9189         DoResolve as appropriate.
9190
9191 2006-04-20  Raja R Harinath  <rharinath@novell.com>
9192
9193         Fix #75800
9194         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9195         implicit conversions on 'out' and 'ref' arguments.
9196
9197         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9198         improve clarity.  Remove dead code.
9199
9200         Fix #66031
9201         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9202         (Catch.Resolve): Resolve VarBlock if it exists.
9203
9204 2006-04-19  Miguel de Icaza  <miguel@novell.com>
9205
9206         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9207         twice, this was some residual code, the enumerator was emitted
9208         properly in the two branche of if later.
9209
9210 2006-04-19  Raja R Harinath  <rharinath@novell.com>
9211
9212         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
9213         cast is never an lvalue.
9214         (Cast.DoResolve, Cast.ResolveRest): Combine.
9215         (Argument.Emit): Simplify slightly.  Move 'Expr is
9216         IMemoryLocation' check ...
9217         (Argument.Resolve): ... here.
9218         (Argument.Error_LValueRequired): Remove.  Inline into only user.
9219
9220         Simplifications.  Fix cs0191-2.cs
9221         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9222         CS1649 and CS1651 to ...
9223         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
9224         the actual selection of the error code and message to a lookup
9225         table.  Add a dummy return value to simplify callsites.
9226         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9227         readonly fields of other instances of the same type.  Move CS0197
9228         warning from ...
9229         * expression.cs (Argument.Resolve): ... here.  Simplify code.
9230         Ensure that ec.InRefOutArgumentResolving is only set during LValue
9231         resolution of an out or ref argument.  The code simplification
9232         above uses this invariant.
9233
9234 2006-04-18  Raja R Harinath  <rharinath@novell.com>
9235
9236         Possibly fix #77752.  Fix cs1690-[4-7].cs.
9237         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9238         CheckMarshallByRefAccess.  Drop parameter.
9239         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
9240         warning.
9241         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9242         InstanceExpression.
9243         * report.cs (AllWarnings): Add CS1690.
9244         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9245         for ref access too.
9246         (LocalVariableReference.DoResolveBase): Update.
9247
9248 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9249
9250         * class.cs (MethodOrOperator): Moved common parts from method class.
9251         detect obsolete attributes.
9252         (Method.Define): Simplified as it reuses code from base.
9253         (Constructor.ValidAttributeTargets): Fixed issue found during
9254         refactoring.
9255         (Destructor.ValidAttributeTargets): Fixed issue found during
9256         refactoring.
9257         (Operator): Finished refactoring set off by #78020. Operator class is now
9258         ordinary method class.
9259
9260         * anonymous.cs: Updated.
9261
9262         * decl.cs (DeclSpace): Add IsGeneric
9263
9264 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9265
9266         * class.cs (Constructor.Emit): Don't emit the attributes twice.
9267
9268 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9269
9270         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9271         detect obsolete attributes.
9272         (Method.CreateEmitContext): Moved to MethodOrOperator.
9273
9274 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9275
9276         A fix for #78048.
9277         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9278         customized exception to make crash detection easier.
9279         (MethodOrOperator): Started to work on new base class for methods and
9280         operators.
9281         (Method): Derives from MethodOrOperator.
9282         (Constructor.Emit): Emits its own attributes.
9283         (AbstractPropertyEventMethod.Emit): Ditto.
9284         (Operator): Derives from MethodOrOperator, will refactor fully in extra
9285         patch.
9286         (Operator.Emit): It's temporary more tricky than should be.
9287         
9288         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9289
9290         * report.cs (InternalErrorException): Add ctor with inner exception.
9291
9292 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
9293
9294         A fix for #76744.
9295         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9296         only not visible.
9297
9298 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
9299
9300         A fix for #77916.
9301         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9302         array.
9303
9304 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9305
9306         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9307         attribute is present and Guid not.
9308         (Interface.ApplyAttributeBuilder): Ditto.
9309
9310         * attribute.cs: Add error message.
9311
9312 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9313
9314         A fix for #78020.
9315
9316         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9317         sources (it's composite) so hold them in extra array as they are used in
9318         Emit phase only. It worked in the previous versions by mistake.
9319         (Attribute.Emit): Emit attribute for more owners when exist.
9320
9321         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9322         it has now different behaviour.
9323
9324 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
9325
9326         * constant.cs (Constant.IsDefaultInitializer): New method.
9327
9328         * class.cs: Updated.
9329
9330         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9331         re-initialize default values. It saves KBs almost for every assembly.
9332         Thanks Zoltan for the idea.
9333         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9334         (ArrayCreation.DoResolve): Resolve only once.
9335         (ArrayCreation.Emit): Emit static initializer only when it is faster.
9336         (ArrayCreation.GetAttributableValue): Cope with optimized values.
9337
9338 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
9339
9340         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9341         From #77961.
9342
9343 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9344
9345         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9346         in an embedded statement too.
9347
9348 2006-04-01  Raja R Harinath  <rharinath@novell.com>
9349
9350         Fix #77958
9351         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9352
9353 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9354
9355         A fix for #77966.
9356
9357         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9358         was not specified.
9359
9360         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9361
9362 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
9363
9364         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9365         phase.
9366
9367         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9368         LocalTemporary change.
9369
9370         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9371         TypeContainer.
9372         (ClassOrStruct.DefineFieldInitializers): Implemented static field
9373         initializers optimization.
9374         (ClassOrStruct.TypeAttr): Moved from modifiers.
9375         (Constructor.CheckBase): Don't crash when static ctor has parameters.
9376         (FieldBase.ResolveInitializer): Resolves initializer.
9377         (FieldBase.HasDefaultInitializer): New property.
9378
9379         * cs-parser.jay: Removed message.
9380
9381         * expression.cs (CompilerGeneratedThis): New specialization.
9382
9383         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9384
9385 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
9386
9387         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9388
9389 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9390
9391         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9392         be now EnumConstants only.
9393
9394 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9395
9396         * attribute.cs, driver.cs: Reset more caches.
9397
9398 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9399
9400         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9401
9402 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9403
9404         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9405         for easier reuse. Updated all overrides.
9406         (IntegralConstant): New base class for all integral constants.
9407         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9408         of the constant range, report custom error.
9409         (UIntConstant.Reduce): Fixed uint conversion.
9410
9411         * ecore.cs, literal.cs: Reduce updates.
9412
9413 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9414
9415         A fix for #75813.
9416
9417         * class.cs (Constructor.Define): Removed extra if for default ctors.
9418         A patch from Atsushi Enomoto.
9419
9420 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9421
9422         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9423         GetAttributableValue.
9424
9425         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9426         when required.
9427
9428         * convert.cs (ImplicitConversionRequired): Error message moved to
9429         DoubleLiteral.
9430
9431         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9432         automatic implicit conversion of an output value.
9433         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9434
9435         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9436         conversion.
9437         (TypeOf.GetAttributableValue): Add extra handling for object type.
9438
9439         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9440         special error message.
9441
9442 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
9443
9444         * class.cs (Constructor.Emit): Don't crash when struct ctor is
9445         InternalCall.
9446         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9447         compatible with MS runtime.
9448
9449 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
9450
9451         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9452         attribute arguments here.
9453
9454         * class.cs (Indexer.Define): The check was moved to attribute class.
9455
9456 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
9457
9458         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9459         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9460         easier.
9461
9462 2006-03-22  Raja R Harinath  <rharinath@novell.com>
9463
9464         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
9465         mcs to keep code differences small.
9466         * attribute.cs (Attribute.GetParameterDefaultValue): New.
9467         * typemanager.cs (parameter_default_value_attribute_type): New.
9468         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
9469         CS1908 check.
9470
9471 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9472
9473         * expression.cs (StringConcat.Append): Reverted back to no warning state.
9474
9475 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9476
9477         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9478
9479         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9480         the blocks too.
9481
9482 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
9483
9484         * doc-bootstrap.cs : fix build.
9485
9486 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9487
9488         * expression.cs (StringConcat.Append): Issue a warning when empty string
9489         is going to append.
9490
9491 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9492
9493         * assign.cs (CompoundAssign.ResolveSource): Removed.
9494
9495         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9496         clean up.
9497
9498         * class.cs (TypeContainer.FindMethods): Removed.
9499         (TypeContainer.CheckMemberUsage): Made static.
9500
9501         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9502
9503         * constant.cs (CheckRange): Removed unused type argument.
9504         (CheckUnsigned): Removed unused type argument.
9505
9506         * cs-parser.jay: Updated after MemberAccess clean up.
9507         Uses Length for empty string test.
9508
9509         * cs-tokenizer.cs: Uses Length for empty string test.
9510         (IsCastToken): Made static.
9511         (is_hex): Made static.
9512         (real_type_suffix): Made static.
9513
9514         * decl.cs (SetupCache): Made static.
9515         (OnGenerateDocComment): Removed unused ds argument.
9516
9517         * delegate.cs (VerifyDelegate): Removed unused argument.
9518
9519         * doc.cs: Uses Length for empty string test.
9520
9521         * driver.cs: Uses Length for empty string test.
9522
9523         * enum.cs (IsValidEnumType): Made static
9524
9525         * expression.cs (EnumLiftUp): Removed unused argument.
9526         (ResolveMethodGroup): Ditto.
9527         (BetterConversion): Ditto.
9528         (GetVarargsTypes): Ditto.
9529         (UpdateIndices): Ditto.
9530         (ValidateInitializers): Ditto.
9531         (MemberAccess.ctor): Ditto.
9532         (GetIndexersForType): Ditto.
9533
9534         * flowanalysis.cs: (MergeFinally): Removed unused argument.
9535
9536         * iterators.cs: Updated after MemberAccess clean up.
9537
9538         * location.cs: Uses Length for empty string test.
9539
9540         * namespace.cs: Uses Length for empty string test.
9541
9542          * report.cs (CheckWarningCode): Made static.
9543
9544         * statement.cs (LabeledStatement): Removed unused argument.
9545
9546         * typemanager.cs (FilterNone): Removed.
9547
9548 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9549
9550         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9551         obsolete.
9552
9553         * class.cs: Updated.
9554
9555 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9556
9557         * cs-parser.jay.cs: __arglist is not allowed for delegates.
9558
9559 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9560
9561         A fix for #77822.
9562
9563         * expression.cs (VerifyArgumentsCompat): Reverted to double error
9564         reporting, it's more tricky than I thought.
9565
9566 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9567
9568         A fix for #77816.
9569
9570         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
9571         host container.
9572         (AnonymousMethod.ImplicitStandardConversionExists): New method.
9573         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9574         Add more error reporting; Fixed issue with params.
9575
9576         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9577
9578         * cs-parser.jay: AnonymousMethod requires host container.
9579
9580         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9581
9582 2006-03-18  Raja R Harinath  <harinath@gmail.com>
9583
9584         * class.cs: Change 'TypeContainer ds' constructor argument to
9585         'DeclSpace parent'.  Some classes were missed below due to
9586         different naming convention.
9587
9588         * class.cs (MemberCore.Parent): Delete.  This makes the
9589         ParentContainer changes below enforceable by the compiler.
9590
9591         Treat pointers to enclosing declaration space as 'DeclSpace', not
9592         'TypeContainer'.
9593         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9594         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9595
9596         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9597         of TypeContainer.
9598         (Block.AddThisVariable): Likewise.
9599         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9600         (AbstractPropertyEventMethod.Emit): Likewise.
9601         (AbstractPropertyEventMethod.EmitMethod): Likewise.
9602         (GetMethod.Define, SetMethod.Define): Likewise.
9603         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9604         (DelegateMethod.EmitMethod): Likewise.
9605
9606         Fix regression test-partial-13.cs.
9607         Rationalize use of PartialContainer.  Ensure that the partial
9608         class semantics can be tied to type-correctness, i.e., any
9609         violation will cause a compile error.
9610         * class.cs, const.cs: Access all fields that belong to class
9611         TypeContainer via ParentContainer.  Arguments of EmitContexts and
9612         Resolve()-like functions still use 'Parent'.
9613
9614         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9615         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9616         (PropertyMethod.CheckModifiers): Remove unused argument.
9617         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9618         DeclSpace.
9619
9620 2006-03-17  Raja R Harinath  <harinath@gmail.com>
9621
9622         Make semantics of PartialContainer simpler.
9623         * decl.cs (DeclSpace.IsPartial): Remove.
9624         * class.cs (TypeContainer.IsPartial): Likewise.
9625         (TypeContainer..ctor): Set PartialContainer to point to self.
9626         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9627         (TypeContainer.FindNestedType): Likewise.
9628         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
9629
9630 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
9631
9632         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9633
9634 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9635
9636         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9637         classes.
9638
9639 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9640
9641         * class.cs (Operator.Define): An error for base conversion was not
9642         reported correctly.
9643
9644 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
9645
9646         * iterator.cs : yield break is allowed in try statement which has
9647           catch clauses. Fixed bug #77767.
9648
9649 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
9650
9651         A fix for #77593, #77574.
9652
9653         * class.cs (MethodCore.CheckBase): Another if for operator.
9654
9655 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9656
9657         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9658         were not resolved
9659
9660         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9661         (DelegateCreation.ImplicitStandardConversionExists): New method for just
9662         conversion test.
9663         
9664         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9665         not needed.
9666
9667         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9668         Updated after another emitcontext usage was clean up. It should help us to
9669         synchronize with gmcs easier.
9670
9671 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9672
9673         A fix for #77353.
9674
9675         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9676         (Event.Define): ditto
9677         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9678
9679         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9680         Removed redundant code and set NewSlot for Invoke method too.
9681
9682         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9683         (Parameters.MergeGenerated): New method. Use this method when you merge
9684         compiler generated argument with user arguments.
9685
9686 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9687
9688         * attribute.cs (ResolveAsTypeTerminal): Removed.
9689
9690         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9691         specialization for predefined types; 30% speed up.
9692         Finally placed obsolete check to right place.
9693         (Expression.ResolveType): Removed.
9694
9695         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9696         Updated after ResolveType was removed.
9697
9698         * expression.cs (Cast.ctor): Check void cast.
9699         (Binary.ResolveAsTypeTerminal): Is never type.
9700         (Conditional.ResolveAsTypeTerminal): Is never type.
9701
9702         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9703
9704 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9705
9706         Fix #77679.
9707         * expression.cs (ParameterReference.DoResolveBase): Change return
9708         type to bool.
9709         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9710         Update.
9711
9712         Fix #77628.
9713         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9714
9715         Fix #77642.
9716         * typemanager.cs (GetFullNameSignature): Don't nullref on
9717         protected accessors.
9718
9719 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9720
9721         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9722         these two separated members to simplify the code.
9723         (Attribute.Resolve): Refactored to use new fields and methods.
9724         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9725         implemented obsolete attribute checking.
9726         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9727         implemented obsolete checking again. It look line never ending quest ;-)
9728         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9729
9730         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9731
9732         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9733
9734         *class.cs (Property.Define): Add RegisterProperty call.
9735
9736         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9737         argument groups (only 2).
9738
9739         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9740         encoding expression to arguments.
9741         (Expression.ExprClassToResolveFlags): Just turned to property.
9742
9743         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9744         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9745         optimized as well as implemented support for zero-length attributes.
9746
9747         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9748         Add caching of PropertyInfo's.
9749
9750 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9751
9752         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9753         error multiple times.
9754
9755 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9756
9757         New partial class implementation.
9758         A fix for #77027, #77029, #77403
9759
9760         * attribute.cs (Attributable): Made attributes protected.
9761
9762         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9763         the replacements of ClassPart and PartialContainer.
9764         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9765         (TypeContainer.AddInterface): Ditto.
9766         (TypeContainer.AddPartial): The main method for partial classes. It checks
9767         for errors and merges ModFlags and attributes. At the end class is added to
9768         partial_parts list.
9769         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9770         required here.
9771         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9772         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9773         from the rest of partial classes.
9774         (TypeContainer.GetClassBases): Simplified.
9775         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9776         DefineType.
9777         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9778         (TypeContainer.HasExplicitLayout): Uses Flags now.
9779         (PartialContainer): Removed.
9780         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9781         (StaticClass): Was merged with Class.
9782         (Class.GetClassBases): class and static class bases are verified here.
9783         (Class.TypeAttr): Added static attributes when class is static.
9784         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9785         (MemberBase): In some cases we need to call parent container for partial
9786         class. It should be eliminated but it's not easy now.
9787
9788         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9789
9790         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9791         partial classed to accumulate class comments.
9792         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9793
9794         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9795
9796         * driver.cs (MainDriver): Tree.GetDecl was removed.
9797
9798         * modifiers.cs (Modifiers): Add partial modifier.
9799
9800         * tree.cs (Tree.decl): Removed.
9801         (RootTypes): Started to use this class more often for root types
9802         specializations.
9803
9804 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9805
9806         A fix for #77615
9807
9808         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9809         external interface does not have an attribute.
9810
9811 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9812
9813         Another prerequisites for new partial classs implementation.
9814         
9815         * attribute.cs (Attribute.Equal): Implemented.
9816         (Attribute.Emit): Changed as attributes can be applied more than twice.
9817         (Attributes.Emit): Check for duplicate attributes here.
9818
9819         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9820         as a parameter, clean-up.
9821
9822 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9823
9824         A fix for #77485
9825
9826         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9827         contains obsolete attribute check which can in some cases look for base
9828         type of current class which is not initialized yet.
9829         (TypeContainer.BaseType): Replacement of ptype.
9830
9831         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9832
9833 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9834
9835         First of prerequisites for new partial classs implemention.
9836         
9837         * attribute.cs (Attributable): Extended by ResolveContext;
9838         Attributes finally have correct context for resolving in all cases.
9839         (AttachTo): Attribute owner is assigned here.
9840
9841         * codegen.cs (IResolveContext): Introduce new interface to hold
9842         all information needed in resolving phase.
9843         (EmitContext): Implements IResolveContext; more clean-up needed here.
9844         
9845         * decl.cs (MemberCore): Implemented IResolveContext.
9846
9847         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9848         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9849         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9850         Refactored to use new IResolveContext instead of EmitContext; cleanup
9851
9852 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9853
9854         * codegen.cs (EmitScopeInitFromBlock): check here the
9855         capture_context, there is no need to make two calls to the
9856         EmitContext. 
9857
9858         * anonymous.cs: Add some debugging messages that might help me
9859         track other instances of this problem in the future (the
9860         regression of test 467).
9861
9862         * cs-parser.jay: track the variable block, as we need to initalize
9863         any captured variables declared in this block for the "catch"
9864         portion of the "Try" statement.
9865
9866         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9867         scope initialization for captured variables. 
9868
9869         Also, move the emit for the variables after the block location has
9870         been marked.
9871
9872 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9873
9874         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9875
9876 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9877
9878         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9879         commit yesterday, the initialization for the roots is necessary.
9880         What is not necessary is the scope activation.
9881
9882 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9883
9884         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9885         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9886         CS0206 checks.
9887         (Argument.Resolve): Remove CS0206 checks.
9888
9889 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9890
9891         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9892         scopes for all the roots, the scopes will now be emitted when the
9893         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9894
9895         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9896         code.  This reduces a lot of existing cruft.
9897         
9898         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9899         that the ScopeInfo is generated as we enter the scope, not at the
9900         time of use, which is what we used to do before.
9901
9902         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9903         every time a Block is about to be emitted if we have a
9904         CaptureContext. 
9905
9906 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9907
9908         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9909         (Reset): Update.
9910         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9911
9912         * typemanager.cs (cons_param_array_attribute): Make private.
9913         (Reset): Set it to null.
9914         (InitCoreHelpers): Don't initialize it.
9915         (ConsParamArrayAttribute): New.  Initialize it as needed.
9916         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9917
9918 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9919
9920         * expression.cs: There might be errors reported during the
9921         selection of applicable methods.  If there are errors, do not
9922         continue execution as it will lead the compiler to crash.
9923
9924 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9925
9926         * expression.cs: Member access is not allowed on anonymous
9927         methods.  Fixes #77402.
9928
9929 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9930
9931         Fix #77401
9932         * cs-parser.jay (VariableDeclaration): Don't set
9933         current_array_type to null.
9934         (field_declaration, event_declaration, declaration_statement):
9935         Set it to null here.
9936
9937 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9938
9939         * typemanager.cs (GenericParameterPosition): New.
9940         * doc.cs: Use it.
9941
9942 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9943
9944         * doc.cs : To process "include" elements, first we should create
9945           another list than XmlNodeList, because it could result in node
9946           removal, which could result in that the XmlNodeList gives up
9947           yielding next node.
9948
9949           (Also made code identical to gmcs again.)
9950
9951 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9952
9953         * ecore.cs: Introduce an error report that we were not catching
9954         before, if not silent, we must report the error.  Gonzalo ran into
9955         it.
9956
9957 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9958
9959         A fix for bug: #76957
9960         
9961         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9962         ComputeMethodHost before creating the method, this is a new
9963         requirement. 
9964
9965         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9966         that this method references (RegisterScope).  The actual scope
9967         where the method is hosted is computed with the ComputeMethodHost
9968         before we create the method.
9969
9970         Moved the Deepest routine here.
9971
9972         (AnonymousContainer.ComputeMethodHost): New routine used to
9973         compute the proper ScopeInfo that will host the anonymous method.
9974
9975         (ScopeInfo): Deal with multiple roots.  The problem was that we
9976         did not have a unique root where all ScopeInfos could be hanged
9977         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9978         of roots.  
9979
9980         Remove AdjustMethodScope which is now computed at the end.  Remove
9981         LinkScope which did a partial link, instead link all ScopeInfos
9982         before code generation from the new "LinkScopes" routine. 
9983
9984         Simplify all the Add* routines as they no longer need to maintain
9985         the tree, they just need to record that they are using variables
9986         from a ScopeInfo.
9987
9988         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9989         routines to produce the forest of ScopeInfo trees.
9990
9991         * class.cs (TypeContainer.AppendMethod): This is just like
9992         AddMethod, but ensures that an interface implementation method
9993         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9994         methods, but at the end.
9995
9996         We use this functionality to ensure that the generated MoveNext
9997         method in the iterator class is resolved/emitted before the
9998         enumerator methods created.   
9999
10000         This is required because the MoveNext method computes the right
10001         ScopeInfo for the method.  And the other methods will eventually
10002         need to resolve and fetch information computed from the anonymous
10003         method. 
10004
10005 2006-01-21  Raja R Harinath  <harinath@gmail.com>
10006             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
10007
10008         Fix rest of #76995.
10009         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
10010         the 'aliases' hash.
10011         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
10012         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
10013
10014 2006-01-18  Raja R Harinath  <rharinath@novell.com>
10015
10016         Fix #76656, cs0231-2.cs.
10017         * cs-parser.jay (formal_parameter_list): Make error case catch
10018         more issues.
10019         (parenthesized_expression_0): Add CS1026 check.
10020         (invocation_expression): Remove unused { $$ = lexer.Location }.
10021
10022 2006-01-17  Raja R Harinath  <rharinath@novell.com>
10023
10024         Fix #76824.
10025         * cs-parser.jay (statement_expression): Don't list out the
10026         individual statement-expressions.  Convert syntax error into
10027         CS0201 check.
10028
10029 2006-01-16  Raja R Harinath  <rharinath@novell.com>
10030
10031         Fix #76874.
10032         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
10033         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
10034         CheckIntermediateModification.
10035         (FieldExpr.DoResolve): Add new two-argument version that
10036         allows us to resolve the InstanceExpression as an lvalue.
10037         The one-argument variant is now just a wrapper.
10038         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
10039         Resolve the lhs as an lvalue if the it has a value type.
10040         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
10041         from Assign.DoResolve.
10042         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
10043         resolved as an lvalue.
10044         (PropertyExpr.DoResolve): Update.
10045         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
10046         has a value type.  Move CS1612 check here from
10047         CheckIntermediateModification.
10048         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
10049         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
10050         'right_side' of a ResolveLValue on an 'out' argument.
10051         (EmptyExpression.LValueMemberAccess): New.  Used as the
10052         'right_side' of a propagated ResolveLValue on a value type.
10053         (LocalVariableReference.DoResolveBase): Recognize
10054         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
10055         Add CS1654 check.
10056         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
10057         EmptyExpression.Null.
10058
10059 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
10060
10061         * typemanager.cs : added IsGenericParameter(). In mcs it always
10062           return false.
10063         * doc.cs : for generic parameters, use GenericParameterPosition,
10064           not FullName.
10065
10066 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
10067
10068         * expression.cs: Fix Console.WriteLine ((this = x).foo);
10069
10070 2006-01-12  Miguel de Icaza  <miguel@novell.com>
10071
10072         This fixes the problem where we used ldfld instead of ldflda to
10073         load the "THIS" pointer on captured parameters, when THIS is a
10074         value type.  See bug #77205.
10075         
10076         * iterators.cs (CapturedThisReference.Emit): Pass false to
10077         EmitThis (we do not need the address).
10078
10079         * codegen.cs (EmitThis): it needs to know whether we need the
10080         address of `this' or not.  This is used by value types.  
10081
10082         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
10083         every other call passes false.
10084
10085 2006-01-12  Raja R Harinath  <rharinath@novell.com>
10086
10087         Fix #77221.
10088         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
10089         GetOverride.
10090         * expression.cs (Invocation.OverloadResolve): Update.
10091         (Invocation.DoResolve): Avoid double resolution of invocation.
10092
10093 2006-01-11  Raja R Harinath  <rharinath@novell.com>
10094
10095         Fix #77180.
10096         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10097         unary negation of floating point types as 0-expr; negation cannot
10098         overflow in floating point types.
10099
10100         Fix #77204.
10101         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10102         on operands of 'void' type.
10103
10104         Fix #77200.
10105         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10106         and ExclusiveOr for boolean constants too.
10107
10108 2006-01-09  Raja R Harinath  <rharinath@novell.com>
10109
10110         Fix #75636.
10111         * expression.cs (Invocation.OverloadResolve): Replace reflected
10112         override methods with their base virtual methods, rather than
10113         skipping over them.
10114         * typemanager.cs (TypeManager.GetOverride): New.
10115
10116 2006-01-05  Jb Evain  <jbevain@gmail.com>
10117
10118         * class.cs (Property.Define, Indexer.Define): do not tag the
10119         properties as SpecialName | RTSpecialName.
10120
10121 2006-01-04  Miguel de Icaza  <miguel@novell.com>
10122
10123         * class.cs (MethodCore.IsDuplicateImplementation): This method was
10124         doing a low-level comparission of parameter types.  It was lacking
10125         a check for __argslist. 
10126
10127 2005-12-30  Miguel de Icaza  <miguel@novell.com>
10128
10129         * expression.cs (ParameterReference.DoResolveBase): Allow
10130         reference parameters if they are local to this block. 
10131
10132         This allows the ref and out parameters of a delegate to be used in
10133         an anonymous method, for example:
10134
10135         delegate void set (out int x);
10136
10137         set s = delegate (out int x){
10138                 x = 0;
10139         };
10140
10141         This is used by functionality introduced late in the C# language.
10142         
10143         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10144         method that take ref and out parameters. 
10145
10146         Fixes #77119 which was a late change in the spec.
10147
10148 2005-12-23  Miguel de Icaza  <miguel@novell.com>
10149
10150         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10151         parent if its the same scope.  Fixes #77060.
10152
10153 2005-12-21  Miguel de Icaza  <miguel@novell.com>
10154
10155         * driver.cs: Report the case of no source files and no -out:
10156         argument provided.
10157
10158 2005-12-20  Raja R Harinath  <rharinath@novell.com>
10159
10160         Fix #77035.
10161         * expression.cs (ComposedCast.GetSignatureForError): Define.
10162
10163 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10164
10165         Fix #76995
10166
10167         * namespace.cs (NamespaceEntry): Add extern_aliases as a
10168         ListDictionary, to contain the ExternAliasEntry entries (in
10169         addition to the NamespaceEntry.aliases hashtable). This field is
10170         shared between the original entry and its doppelganger (bodyless 
10171         copy of it).
10172         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10173         extern_aliases field.
10174         (NamespaceEntry.Lookup): Move the IsImplicit check after the
10175         lookup in extern_aliases.
10176
10177 2005-12-16  Raja R Harinath  <rharinath@novell.com>
10178
10179         Fix #77006.
10180         * class.cs (TypeContainer.Mark_HasEquals): New.
10181         (TypeContainer.Mark_HasGetHashCode): New.
10182         (ClassPart): Override them.
10183         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10184
10185         Fix #77008.
10186         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10187         'parent' argument to the base constructor.
10188
10189         Remove all mention of TypeContainer from decl.cs.
10190         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10191         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10192         (DeclSpace.DeclSpace): Likewise.
10193         (DeclSpace.DefineMembers): Remove unused argument.
10194         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
10195         debugging check -- we don't care if the debug code throws an
10196         InvalidCastException instead of an InternalErrorException.
10197         * class.cs (TypeContainer.DefineMembers): Update to changes.
10198         (TypeContainer.DoDefineMembers): Likewise.
10199         (TypeContainer.GetMethods): Likewise.
10200         (PropertyMember.Define): Likewise.
10201         (MemberBase.Parent): New property that forwards to
10202         MemberCore.Parent, but ensures that we get a TypeContainer.
10203         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10204         (RootContext.PopulateTypes): Likewise.  Remove special case code
10205         for !RootContext.StdLib: DefineMembers is idempotent.
10206
10207 2005-12-14  Miguel de Icaza  <miguel@novell.com>
10208
10209         * convert.cs (ExplicitConversionCore): Check the return value from
10210         ExplicitConversionCore which can return null on failure.  Fixes #76914
10211
10212 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
10213
10214         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10215
10216 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
10217
10218         * doc.cs : The search for referenced namespace was insufficient to
10219           get global one as it used to do. Fixed bug #76965.
10220
10221 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
10222
10223         * doc.cs : check name in cref in the last phase that whether it is
10224           namespace or not.
10225
10226 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10227
10228         * cs-tokenizer.cs : reverted the latest change: it somehow broke
10229           Mono.C5.
10230
10231 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10232
10233         * doc.cs : so it turned out that we cannot skip override check for 
10234           interface members. Fixed bug #76954.
10235
10236 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10237
10238         * cs-tokenizer.cs : fixed bug #75984:
10239           - #warning and #error should not be handled when the source line
10240             is disabled.
10241           - #line is not checked strictly when the source line is disabled.
10242           - #define and #undef is on the other hand checked strictly at any
10243             state.
10244
10245 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
10246
10247         * cs-tokenizer.cs : missing Location (actually, filename) in one of
10248           CS1027 report.
10249
10250 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10251
10252         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10253
10254         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10255         event initializers.
10256         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10257         (FieldBase.Initializer): Initializer is now optional.
10258         (EventField.Define): Only event field can have initializer.
10259
10260         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10261
10262         * const.cs (Const): Reuse initializer.
10263
10264         * cs-parser.jay: Updated after FieldBase changes.
10265         Added current_array_type to simplify array initializers.
10266
10267         * ecore.cs (NullCast.IsDefaultValue): Implemented.
10268
10269         * expression.cs, iterators.cs: Updated.
10270
10271         * namespace.cs (NamespaceEntry): Made UsingFound private.
10272
10273 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10274
10275         * parameterCollection.cs: Obsolete, removed.
10276         * parser.cs: Obsolete, removed.
10277
10278 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10279
10280         Fix #76849.
10281         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10282
10283         * enum.cs (Enum.Define): Set obsolete context here.
10284
10285 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10286
10287         * doc.cs :
10288           - FindDocumentedMember() now expects 1) paramList as null
10289             when "we don't have to check the number of parameters" and
10290             2) Type.EmptyTypes when "there is no arguments".
10291           - Introduced FoundMember struct to hold the exact type which was
10292             used to find the documented member (the above change broke
10293             test-xml-044; it might be better just to use DeclaringType than
10294             what MS does, like this change does, but it depends on usage.)
10295
10296 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10297
10298         * doc.cs : documented member might be from DeclaringType for nested
10299           types. Fixed bug #76782.
10300
10301 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
10302
10303         * anonymous.cs: Have the param code handle leaving copies on the
10304         stack etc. Allows anonymous params to take part in the assignment
10305         code (++, +=, etc). Fixes bug #76550
10306
10307         * expression.cs: Handle the prepare_for_load/leave_copy by passing
10308         it down to the anon code.
10309
10310         * iterators.cs: Use dummy var here
10311
10312         * codegen.cs: Handle new vars
10313
10314 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10315
10316         Fix #76849.
10317         * class.cs (MethodData.Define): Set proper Obsolete context.
10318
10319         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10320         obsolete context.
10321         (FieldExpr.DoResolve): Ditto.
10322
10323 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10324
10325         Fix #76849.
10326         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10327         parent is not obsolete.
10328
10329 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
10330
10331         * doc.cs : (FindDocumentedMember) find parameterless members first
10332           and get CS0419 in the early stage. Fixed first case of bug #76727.
10333
10334 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
10335
10336         Fix #76859.
10337         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10338         no error was reported.
10339
10340         *expression.cs (Binary.DoResolve): left can be null.
10341
10342 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
10343
10344         Fix #76783.
10345         * class.cs (MethodData.Emit): Parameters should be labeled first.
10346
10347 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
10348
10349         Fix #76761.
10350         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10351
10352 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
10353
10354         * attribute.cs (AreParametersCompliant): Moved to Parameter.
10355
10356         * class.cs (MethodCore): Parameter clean up.
10357         (IMethodData): Added ParameterInfo.
10358         (MethodData): Parameter clean up.
10359         (Indexer.Define): Parameter clean up.
10360
10361         * anonymous.cs,
10362         * codegen.cs,
10363         * cs-parser.jay,
10364         * decl.cs,
10365         * doc.cs,
10366         * ecore.cs,
10367         * flowanalysis.cs,
10368         * iterators.cs,
10369         * pending.cs,
10370         * statement.cs,
10371         * typemanager.cs: Parameter clean up.
10372
10373         * delegate.cs (Define): Get rid of duplicated code.
10374
10375         * expression.cs (ParameterReference): Removed useless parameters
10376         and simplified.
10377         (Invocation): Ditto.
10378
10379         * parameter.cs (ParamsParameter): New class, params specialization.
10380         (ArglistParameter): Attemp to separate arglist.
10381         (Parameter): Refactored to be reusable and faster.
10382         (Parameter.Modifier): Made understandable.
10383         (Parameters): Changed to be used as a class for `this' assembly
10384         parameters. Refactored to use new specialized classes.
10385
10386         * support.cs (ParameterData): Added Types property.
10387         (InternalParameters): Deleted.
10388
10389 2005-08-20  Martin Baulig  <martin@ximian.com>
10390
10391         Merging this patch from GMCS to fix #75867.
10392
10393         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10394         scope if we don't already have it.
10395
10396 2005-11-17  Martin Baulig  <martin@ximian.com>
10397
10398         * anonymous.cs
10399         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10400         inherit the scope from our parent.  Fixes #76653.
10401
10402 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10403
10404         * doc.cs : the previous patch does not actually fix the bug.
10405           PropertyInfo override check is now implemented and really fixed it.
10406         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10407
10408 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10409
10410         * doc.cs : apply "override filter" also to properties.
10411           Fixed bug #76730.
10412
10413 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10414
10415         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10416           no need to check overrides. For classes, omit those results from 
10417           interfaces since they must exist in the class. Fixed bug #76726.
10418
10419 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10420
10421         * typemanager.cs : (GetFullNameSignature) differentiate indexers
10422           with different parameters. Fixed the second problem in #76685.
10423
10424 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10425
10426         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10427           get expected 'protected' access in CheckValidFamilyAccess()).
10428           Fixed bug #76692.
10429
10430 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10431
10432         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10433           Fixed bug #76705.  CS1569 was incorrectly commented out.
10434
10435 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10436
10437         * doc.cs : use Invocation.IsOverride() to do real override check.
10438         * expression.cs : made Invocation.IsOverride() internal.
10439
10440 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10441
10442         * doc.cs : use TypeManager.FindMembers() instead of (possible)
10443           TypeBuilder.FindMembers() and filter overriden base members out.
10444           Fixed bug #76990.
10445
10446 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10447
10448         * doc.cs : ref/out parameters are represented as '@' (instead of
10449           '&' in type FullName). Fixed bug #76630 (additionally crefs).
10450
10451 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10452
10453         * doc.cs : when there was no '.' in cref to methods in doc comment,
10454           then parameters were missing in the output. Fixed bug #76691.
10455
10456 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10457
10458         * driver.cs : don't output docs when there is an error.
10459           Fixed bug #76693.
10460
10461 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10462
10463         * doc.cs :
10464           Now it should detect indexers. Fixed primary concern in bug #76685.
10465           Fixed CS0419 message to not show the identical member signature in
10466           the message.
10467
10468 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10469
10470         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10471           instead of Type.FindMembers() since it does not handle events.
10472           Fixed bug #71604.
10473
10474 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
10475
10476         * codegen.cs: Fixed typo (speficied -> specified).
10477
10478 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10479
10480         Fix #76369.
10481         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10482
10483 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10484
10485         * attribute.cs: Changed error message.
10486
10487         * cs-tokenizer.cs: One more check.
10488
10489 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10490
10491         * statement.cs (Block.Resolve): Ignore empty statement.
10492
10493 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10494
10495         * report.cs: Made error/warning methods more strict to avoid
10496         their misuse.
10497
10498         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10499         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10500         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10501         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10502
10503 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
10504
10505         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10506         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10507
10508         * class.cs (TypeContainer.IsComImport): New property.
10509         (Constructor.Define): Create proper ctor for ComImport types.
10510
10511         * expression.cs (New.CheckComImport): Fixed.
10512
10513 2005-11-07  Miguel de Icaza  <miguel@novell.com>
10514
10515         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10516         that a parameter has been captured does not mean that we do not
10517         have to do the rest of the processing.  This fixes the second part
10518         of #76592.  If there was another anonymous method capturing
10519         values in the past, the Scope would never be set for the second
10520         method that captured the same parameter.
10521
10522         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10523         properly manipulate the stack.   Second part of fix for #76592.
10524
10525         * expression.cs (New): Add support for invoking "new" on
10526         interfaces that have been flagged with the ComImport attribute and
10527         the CoClass.  Fixes #76637 
10528
10529         * statement.cs (Try.DoEmit): When a variable is captured, do not
10530         try to emit the vi.LocalBuilder variable as it has been captured.
10531         Create a temporary variable and store the results on the
10532         FieldBuilder.  Fixes #76642
10533
10534 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
10535
10536         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10537
10538         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10539
10540         * expression.cs (Binary.DoResolve): Added && optimalization.
10541     
10542         * typemanager.cs (AddUserType): Removed useless argument.
10543
10544 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
10545
10546         * statement.cs (Block.variables): Uses ListDictionary.
10547
10548 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10549
10550         Fix #75969.
10551         * class.cs (PartialContainer.EmitType): Customized to emit
10552         security attributes.
10553         (ClassPart.ApplyAttributeBuilder): Transform security attribute
10554         for partial classes.
10555
10556 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10557
10558         Fix #76599.
10559         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10560         access has to be fixed.
10561         
10562         * typemanager.cs (IsUnmanagedType): Wrong common field type.
10563
10564 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
10565
10566         Fix #76590.
10567         * ecore.cs (NullCast.Reduce): Implemented.
10568
10569         * expression.cs (ArrayCreation.CheckIndices): Correcly check
10570         constant type.
10571         
10572         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10573         properly.
10574         (Foreach.Resolve): Catch null properly.
10575
10576 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10577  
10578         * cs-tokenizer.cs: Warning text fix.
10579
10580         * driver.cs: AllWarningNumbers exposed on public interface.
10581
10582         * report.cs (): Reviewed warning numbers.
10583         (IsValidWarning): Use binary search.
10584
10585 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10586  
10587         * driver.cs: Implemeted resource visibility.
10588         (Resources): New class for code sharing between /res: and
10589         /linkres:
10590  
10591 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
10592
10593         Fix #76568.
10594         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10595         folding.
10596         
10597         * convert (Convert.ImplicitReferenceConversion): NullCast holds
10598         contants only.
10599         
10600         * ecore.cs (NullCast): Child is contant only.
10601         
10602         * literal.cs (NullLiteral.Reduce): null can be converted to any
10603         reference type.
10604
10605 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
10606
10607         * driver.cs: Use Encoding.Default as default code page instead
10608           of ISO-28591.
10609
10610 2005-10-27  Raja R Harinath  <rharinath@novell.com>
10611
10612         Fix #76085.
10613         * expression.cs (Invocation.Error_InvalidArguments): Handle
10614         __arglist parameters.
10615         (Invocation.VerifyArgumentsCompat): Likewise.
10616         * support.cs (ReflectionParameters.GetSignatureForError): Print
10617         __arglist parameters.
10618         (InternalParamters.GetSignatureForError): Likewise.
10619         * parameter.cs (Parameters.GetSignatureForError): Likewise.
10620
10621 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
10622
10623         * attribute.cs (GetPropertyValue): Made public.
10624
10625         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10626         Resolve.
10627         Add new property WrapNonExceptionThrows to handle 2.0 assembly
10628         attribute.
10629         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10630         is not defined.
10631         
10632         * driver.cs: Reflect method name change.
10633         
10634         * statement.cs (Try.Resolve): Warn when try has both general
10635         exception handlers.
10636         
10637         * typemanager.cs: runtime_compatibility_attr_type new predefined
10638         type.
10639
10640 2005-10-26  Raja R Harinath  <harinath@gmail.com>
10641
10642         Fix #76419.
10643         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10644         treat it as an empty parameter list.
10645
10646 2005-10-26  Raja R Harinath  <rharinath@novell.com>
10647
10648         Fix #76271.     
10649         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
10650         ResolveAsTypeStep silent.
10651         * statement.cs (Block.AddConstant): Mark block as used.
10652         (Block.ResolveMeta): Avoid piling on error messages
10653         if a constant initializer resolution fails.
10654
10655 2005-10-25  Raja R Harinath  <rharinath@novell.com>
10656
10657         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10658         Remove.
10659         (NamespaceEntry.VerifyAllUsing): New.
10660         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
10661         behaviour.  Delegates actual resolution of alias to ...
10662         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
10663         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10664         Update.
10665         * driver.cs (Driver.MainDriver): Update.
10666         
10667         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10668         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10669         property.
10670         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10671         Remove.
10672         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10673         RootNamespace.DefineNamespacesForAll.
10674
10675 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10676
10677         * typemanager.cs (assemblies, external_aliases, modules)
10678         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10679         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10680         overhead.  Move resposibility ...
10681         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10682         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10683
10684 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10685
10686         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10687         cached_namespaces.  Improve usage.
10688         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10689         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10690         Move from GlobalRootNamespace and simplify.
10691         (RootNamespace.Global): Make instance variable.
10692         (RootNamespace.RootNamespace): Add "alias name" parameter.
10693         (GlobalRootNamespace): Simplify drastically.
10694         (Namespace.Lookup): Don't use GetNamespace.
10695         * typemanager.cs (GetRootNamespace): Rename from
10696         ComputeNamespaceForAlias.
10697         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10698
10699 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10700
10701         * anonymous.cs (AnonymousContainer): Don't crash when container
10702         doesn't exist.
10703
10704 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10705
10706         * expression.cs (Binary.DoResolve): Warn when comparing same
10707         values.
10708
10709 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10710
10711         Fix #76486.
10712         * expression.cs (Binary.DoResolve): It looks like there are no
10713         convetsion rules in enum context.
10714
10715 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10716
10717         Add support for extern alias qualifiers.
10718         * typemanager.cs: Move some LookupTypeReflection code
10719         to namespace.cs, to have cleaner code. Added some methods
10720         to help us keep track of the extern aliased references.
10721         * driver.cs: Add suport for extern alias assemblies on command
10722         line and check for their warnings/errors. Also keep track of the
10723         extern aliased assemblies.
10724         * namespace.cs: Move the global functionality of Namespace
10725         to GlobalRootNamespace/RootNamespace. Now the global namespace
10726         is GlobalRootNamespace.Globa. Also the code moved from 
10727         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10728         Finally added LocalAliasEntry (AliasEntry before) and
10729         ExternAliasEntry, to handle alias statements.
10730         * cs-parser.jay: Add support in the grammar for extern alias
10731         statement.
10732         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10733         Update callings to Namespace (now in GlobalRootNamespace).
10734
10735 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10736
10737         Fix #76371.
10738         * class.cs (TypeContainer.DefineType): Move updating of
10739         topological sort earlier in the code.
10740         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10741
10742 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10743
10744         Fix #76273.
10745         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10746         
10747         * constant.cs (Constant.TryReduce): Moved from Cast class.
10748         (Reduce): Made little bit more OO and fixed missing conversions.
10749         
10750         * ecore.cs (Reduce): Implemented.
10751         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10752         
10753         * literal.cs (Reduce): Implemented.
10754         
10755         * class.cs: Reverted Miguel's wrong commit.
10756
10757 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10758
10759         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10760
10761 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10762
10763         * cs-parser.jay, expression.cs : CS0214 was missing error location
10764           for constants. Fixed bug #76404.
10765
10766 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10767
10768         Fix #76370.
10769         * convert.cs (ExplicitConversionCore): Fixed object->enum
10770         conversion.
10771
10772 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10773
10774         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10775         InstanceExpression.
10776         (PropertyExpr.EmitCall): Likewise.
10777         * expression.cs (Invocation.EmitArguments): Handle case where
10778         arguments == null.
10779         (Invocation.EmitCall): Avoid allocating temporary variable if
10780         there are no arguments.
10781
10782 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10783
10784         Fix #76323.
10785         * convert.cs (ImplicitConversionStandard): Move conversion of
10786         void* to arbitrary pointer types ...
10787         (ExplicitConversionStandard): .. here.
10788         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10789         error to always print typenames.
10790
10791 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10792
10793         * convert.cs (GetConversionOperator): Rename from
10794         GetConversionOperators.  Move operator selection code from ...
10795         (UserDefinedConversion): ... here.
10796
10797 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10798
10799         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10800         conversion.
10801
10802 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10803
10804         * assign.cs (Assign.DoResolve): Error method changed.
10805
10806         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10807         
10808         * const.cs (ResolveValue): Reset in_transit immediately.
10809         
10810         * constant.cs: Error method changed.
10811         
10812         * convert.cs: Removed useless location parameter.
10813         (ExplicitNumericConversion): Don't do double enum check.
10814         (ExplicitConversionCore): Renamed from ExplicitConversion.
10815         (ExplicitUnsafe): Extracted from ExplicitConversion.
10816         (ExplicitConversion): Uses for error reporting.
10817         
10818         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10819         error messages.
10820         (ResolveBoolean): Uses common error method.
10821         (CastToDecimal): Get rid of ec.
10822         (CastFromDecimal): Optimized.
10823         (ConvCast): Get rid of ec.
10824         
10825         * enum.cs (ResolveValue): Reset in_transit immediately.
10826         (Emit): Return after first error.
10827         
10828         * expression.cs: Convert changes.
10829         
10830         * literal.cs: Error method changed.
10831         
10832         * statement.cs: Error method changed.
10833
10834 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10835
10836         * support.cs (SeekableStreamReader.Position): Don't error out when
10837         the requested position is just beyond the end of the current
10838         buffered data.
10839
10840 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10841
10842         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10843         try to keep in sync with the byte count of the underlying Stream.
10844         However, this limits us to a window size of 2048 characters: i.e.,
10845         the maximum lookahead of our lexer/parser can be 2048 characters.
10846
10847 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10848
10849         Fix #76255.
10850         * driver.cs: Fix compilation files with full root path.
10851
10852 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10853
10854         * report.cs (SymbolRelatedToPreviousError): Format the output so
10855         it does not use an open parenthesis that is never closed. 
10856
10857         * driver.cs: Follow coding guidelines
10858
10859 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10860
10861         Fix #72930.
10862         * const.cs (Const.ResolveValue): Check for assigning non-null
10863         value to reference type.
10864
10865 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10866
10867         * anonymous.cs: Implemented ExprClassName.
10868         
10869         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10870         delegate.
10871         
10872         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10873         check.
10874         
10875         * class.cs (StaticClass.DefineContainerMembers): Report protected
10876         members as error.
10877         
10878         * codegen.cs: if(ed) PRODUCTION.
10879         
10880         * convert.cs (Error_CannotImplicitConversion): Better error
10881         distinction.
10882         
10883         * cs-parser.jay: More error checks.
10884         
10885         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10886         
10887         * driver.cs (CSCParseOption): Enabled wrong option check.
10888         
10889         * ecore.cs (Expression.ExprClassName): Turned to property.
10890         (MemberExpr.CheckIntermediateModification): For checking boxed
10891         value types     modification.
10892         
10893         * statement.cs (Fixed.Resolve): Expression type must be
10894         convertible to fixed type.
10895         (CollectionForeach.GetEnumeratorFilter,TryType):
10896         Small refactoring for easier error checking.
10897
10898 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10899
10900         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10901         attributes.
10902         
10903         * class.cs (GeneratedBaseInitializer): New class for customization
10904         compiler generated initializers.
10905         (MemberBase.DoDefine): Check Obsolete attribute here.
10906         (FieldMember.DoDefine): Ditto.
10907         
10908         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10909         constants.
10910         
10911         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10912         (MemberCore.GetObsoleteAttribute): Removed argument.
10913         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10914         (MemberCore.CheckObsoleteType): New helper.
10915         
10916         * delegate.cs,
10917         * enum.cs,
10918         * statement.cs: Updates after MemberCore changes.
10919         
10920         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10921         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10922         
10923         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10924         obsolete attribute for compiler construct.
10925         (As.DoResolve): Cache result.
10926         
10927         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10928
10929 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10930
10931         Fix #76133.
10932         * expression.cs (This.VerifyFixed): In a value type T, the type of
10933         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10934         value type R, 'this' is treated as a value parameter.
10935
10936 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10937
10938         * statement.cs (Lock): Use the TemporaryVariable class instead of
10939         manually using local variables as those do not work when variables
10940         are captured.
10941
10942         * ecore.cs: Moved the TemporaryVariable class from being a nested
10943         class inside Foreach to be a public class that can be employed in
10944         other places. 
10945
10946 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10947
10948         * cs-parser.jay: interface_accessors replaced by
10949         accessor_declarations.
10950
10951         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10952         location.
10953         
10954         * statement.cs (GotoCase.Resolve): Convert null constant to
10955         null case.
10956         (SwitchLabel.ResolveAndReduce): Ditto.
10957         (SwitchLabel.NullStringCase): Custom null stamp.
10958         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10959         
10960         typemanager.cs (CSharpSignature): Don't skip first argument
10961         for full names.
10962
10963 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10964
10965         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10966
10967         * location.cs (InEmacs): in this mode, do not report column
10968         location as it confuses Emacs.
10969
10970 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10971
10972         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10973         expression.cs, iterators.cs, literal.cs: Store constants and
10974         literals location.
10975         
10976         * class.cs (MemberBase.ShortName): Pass location.
10977         
10978         * cs-parser.jay: Some location fixes.
10979         
10980         * ecore.cs (Expression.Location): Made virtual.
10981
10982 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10983
10984         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10985         if the underlying types are the same, otherwise we need to produce
10986         code that will do the proper cast.
10987
10988         This was exposed by Marek's constant rewrite which produced
10989         invalid code for the call site:
10990
10991         enum X : long { a }
10992         void Method (X v) {}
10993
10994         Method ((X) 5)
10995
10996         This fixes test-49.cs
10997
10998 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10999
11000         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
11001           Type/Object should be allowed as well. Fixed bug #75968.
11002
11003 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
11004
11005         * expression.cs : (Binary.DoResolve): when one is enum constant and
11006           another is constant 0, then return enum one *as enum type*.
11007           Fixed bug 74846.
11008
11009 2005-09-02  Raja R Harinath  <rharinath@novell.com>
11010
11011         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
11012         internal.
11013
11014         Fix #75941.
11015         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
11016         flow-branching for LocalVariableReferences in case we were invoked
11017         from a MemberAccess.
11018         * expression.cs (LocalVariableReference.VerifyAssigned): New.
11019         Carved out of ...
11020         (LocalVariableReference.DoResolveBase): ... this.
11021         (MemberAccess.Resolve): Do the check that was disabled during
11022         SimpleNameResolve.
11023
11024 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
11025
11026         * class.cs :
11027           (PartialContainer.Create): check abstract/sealed/static strictly
11028           but abstract/sealed can exist only at one side. Fixed bug #75883.
11029
11030 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
11031
11032         Fix #75945.
11033         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
11034         specified, don't default to UnmanagedType.I4.
11035
11036 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
11037
11038         * expression.cs : conditional operator should check possibly
11039           incorrect assign expression. Fixed bug #75946.
11040
11041 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
11042
11043         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
11044           Reverting the change. gmcs is much complex than mcs on this matter.
11045
11046 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
11047
11048         * cs-tokenizer.cs : To read another token ahead of the actual 
11049           consumption, use new SavedToken and cache token instead of moving
11050           back the stream with SeekableStreamReader (it seemed problematic).
11051         * cs-parser.jay,
11052           driver.cs : Thus use StreamReader directly.
11053         * support.cs : Thus removed SeekableStreamReader.
11054
11055 2005-08-30  Raja R Harinath  <rharinath@novell.com>
11056
11057         Fix #75934.
11058         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
11059         (ScopeInfo.EmitScopeType): Use it to construct field names from
11060         names of captured locals.
11061
11062         Fix #75929.
11063         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
11064         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11065         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
11066         (ExplicitConversion): Remove enum cases already handled by
11067         implicit conversion.  Move implicit conversion check to the beginning.
11068         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
11069         * expression.cs (ArrayCreation.EmitDynamicInitializers):
11070         Don't treat System.Enum as a struct.
11071
11072 2005-08-30  Jb Evain  <jbevain@gmail.com>
11073
11074         * attribute.cs: handles as expression in parameters.
11075
11076 2005-08-30  Raja R Harinath  <rharinath@novell.com>
11077
11078         Fix #75802.
11079         * class.cs (TypeContainer.VerifyClsName): Don't use a
11080         PartialContainer when verifying CLS compliance.
11081         (AbstractPropertyEventMethod): Set Parent here, ...
11082         (PropertyMethod): ... not here.
11083
11084 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
11085
11086         * attribute.cs : escaped attribute name should not be allowed to be
11087           resolved (e.g. @class as classAttribute). Fixed bug #75930.
11088
11089 2005-08-29  Raja R Harinath  <rharinath@novell.com>
11090
11091         Fix #75927.
11092         * convert.cs (ImplicitStandardConversionExists): Allow zero also
11093         when converting a long constant to unsigned long.
11094         * expression.cs (Invocation.OverloadResolve): Add sanity check to
11095         detect where IsApplicable and VerifyArgumentsCompat disagree.
11096
11097 2005-08-29  Raja R Harinath  <rharinath@novell.com>
11098         and Carlos Alberto Cortez  <carlos@unixmexico.org>
11099
11100         Fix #75848.
11101         * class.cs (TypeContainer.CanElideInitializer): New helper.
11102         (TypeContainer.EmitFieldInitializers): Use it to determine if we
11103         can safely emitting the initializer of a field.
11104
11105 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11106
11107         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11108           allowed inside a switch (without loop). Fixed bug #75433.
11109
11110 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
11111
11112         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11113         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11114
11115 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11116
11117         * driver.cs : kinda reverting the default encoding changes (not exact 
11118           revert since I noticed that "codepage:reset" might not work fine).
11119
11120 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11121
11122         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11123           Location. Now getter and setter store location correctly.
11124           (errors/cs0111-12.cs now reports the expected location.)
11125
11126 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11127
11128         * driver.cs : Use default encoding on the environment.
11129           Removed (now that) extra parameter for SeekableStreamReader.
11130         * support.cs : (SeekableStreamReader) third .ctor() argument for
11131           StreamReader is not required (always true). preamble size could
11132           be acquired in simpler and safe way.
11133
11134 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
11135
11136         * cs-parser.jay: report CS0642 at warning level 3
11137           and report CS0642 for an if else statement also
11138           fixes bug #74745. Patch by John Luke (and a bit
11139           modified by me).
11140           Removed extra CS0642 warning check for "while",
11141           "for" and "fixed".
11142         * statement.cs: In Block.Resolve(), CS0642 check
11143           is reimplemented to check a sequence of an empty
11144           statement and a block.
11145
11146           Both fix bug #66777.
11147
11148 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
11149
11150         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11151         detection until I fix it.
11152         
11153         * cs-tokenizer.cs: Changed error message.
11154         
11155         * cs-parser.jay: Fixed 2 error locations.
11156         
11157         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11158         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11159         properties.
11160         
11161         * enum.cs (GetSignatureForError): Fixed.
11162         
11163         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11164         method detection.
11165         
11166         * class.cs,
11167         * typemanager.cs (RegisterProperty): Removed.
11168         
11169         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11170
11171 2005-08-24  Raja R Harinath  <rharinath@novell.com>
11172
11173         Fix #75874.
11174         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11175         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11176
11177 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11178
11179         * expression.cs : tiny fix is required for not warning positive ulong.
11180           See test-441.cs.
11181
11182 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11183
11184         * expression.cs : add CS0652 check for constant and integral
11185           expression. Fixed bug #53974.
11186
11187 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11188
11189         * expression.cs : in DoNumericPromotions(), check if there is implicit
11190           conversion overload for string (to check CS0034). Fixed bug #52492.
11191
11192 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11193
11194         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11195
11196 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11197
11198         * ecore.cs : report location when it is *not* Null.
11199
11200 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11201
11202         * codegen.cs,
11203           ecore.cs,
11204           flowanalysis.cs,
11205           expression.cs:
11206           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11207           correctly. Fixed bug #75721.
11208
11209 2005-08-23  Raja R Harinath  <rharinath@novell.com>
11210
11211         * support.cs (SeekableStreamReader.Position): Avoid an expensive
11212         loop that performs 'min (pos, char_count)'.
11213
11214         Fix #75862.
11215         * expression.cs (Unary.ResolveOperator): Don't discard implicit
11216         converted value in Operator.OnesComplement.
11217
11218 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
11219
11220         * anonymous.cs: If the anon method is pulled into a helper class,
11221         it needs to be `internal' not `private'. Fixes runtime behavior on
11222         msft. bug #75704
11223
11224 2005-08-20  Martin Baulig  <martin@ximian.com>
11225
11226         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11227         scope if we don't already have it.
11228
11229         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11230         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11231         fixes #75867.
11232
11233 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
11234
11235         Fix #75803
11236         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11237         is a partial class.
11238
11239 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
11240
11241         The big constants rewrite
11242         Fix #75746, #75685 and more
11243         As a side effect saved 1MB for MWF ;-)
11244         
11245         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11246         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11247         enum based for corlib compilation.
11248         
11249         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11250         subtractions.
11251         
11252         * class.cs (FixedField.Define): Use ResolveAsConstant.
11253         
11254         * const.cs (IConstant): Interface constants and enums.
11255         (Const.ResolveValue): New method for constant resolvning.
11256         (ExternalConstant): Constants from imported assemblies.
11257         
11258         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11259         conversion; like enums.
11260         (Constant.ToType): Converts this constant to different type.
11261         (Constant.Increment): Adds 1.
11262         
11263         * convert.cs (ImplicitConversionRequired): Simplified.
11264         
11265         * cs-parser.jay: Create EnumMember directly.
11266         
11267         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11268         
11269         * doc.cs (GenerateEnumDocComment): Removed.
11270         
11271         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11272         (ConvertIntLiteral): Removed.
11273         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11274         
11275         * enum.cs (EnumMember): Implement IConstant.
11276         (Enum.IsValidEnumConstant): Removed.
11277         (Enum.GetNextDefaultValue): Removed.
11278         (Enum.FindMembers): Updated.
11279         (Enum.GenerateDocComment): Iterate enum members.
11280         
11281         * expression.cs (Cast.TryReduce): Handle enums correctly.
11282         (New.Constantify): Made public.
11283         (MemberAccess.DoResolve): Removed contant specific if(s).
11284         
11285         * literal.cs (NullLiteral): Implement new abstract methods.
11286         
11287         * statement.cs (GotoCase.Resolve): Use new constant methods.
11288         (SwitchLabel.ResolveAndReduce): Use new constant methods.
11289         
11290         * typemanager.cs (LookupEnum): Removed.
11291         (IsEnumType): Fixed to work with corlib.
11292         (RegisterConstant): Removed.
11293         (LookupConstant): Removed.
11294         (GetConstant): Changed to work with IConstant.
11295
11296 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
11297
11298         * location.cs : Fixed overflown (>255) column number.
11299
11300 2005-08-03  Raja R Harinath  <rharinath@novell.com>
11301
11302         First cut of the qualified-alias-member feature.
11303         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11304         token.
11305         * cs-parser.jay (DOUBLE_COLON): New token.
11306         (namespace_or_type_name): Add rule for recognizing
11307         qualified-alias-members.
11308         (primary_expression): Likewise.
11309         (element_access): Allow QualifiedAliasMember as a possible
11310         type-bearing expression.
11311         (local_variable_type, local_variable_pointer_type): Likewise.
11312         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
11313         aliases in the current and enclosing namespace declarations.
11314         (NamespaceEntry.UsingAlias): Add CS0440 warning.
11315         * decl.cs (MemberName.is_double_colon): New.
11316         (MemberName.MemberName): Add new constructor for alias-member.
11317         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11318         * expression.cs (QualifiedAliasMember): New expression type.
11319
11320 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11321
11322         * location.cs : it borked when no argument was specified.
11323
11324 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11325
11326         * location.cs : tiny ToString() format fix.
11327
11328 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11329
11330         * statement.cs : oops, it was missing.
11331
11332 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11333
11334         A set of fixes for precise line/column location.
11335
11336         * location.cs :
11337           "token" field now holds a file/line "delta", a line number offset 
11338           from the segment, and a column number. See also:
11339           http://lists.ximian.com/pipermail/mono-devel-list/2004-
11340           December/009508.html
11341           Removed static IsNull. Use instance IsNull property instead.
11342         * cs-tokenizer.cs :
11343           For some tokens it stores Location. For Identifier it stores
11344           LocatedToken which is a pair of string name and location.
11345           Column numbers are adjusted only at getChar().
11346         * report.cs :
11347           Use Location.ToString() for reporting (it now contains column).
11348         * cs-parser.jay :
11349           Largely modified to use LocatedToken instead of
11350           string (IDENTIFIER), and to acquire Location from some tokens.
11351         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11352           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11353           codegen.cs :
11354           Now MemberName holds Location. DeclSpace.ctor() receives Location
11355           as a parameter. Removed extra parameters to all derived classes.
11356           Replaced Location.IsNull() with instance property.
11357         * assign.cs, expression.cs :
11358           Added .ctor() overload that omits Location.
11359         * attribute.cs :
11360           Added "nameEscaped" flag that indicates the identifier was escaped
11361           in the source file. This fixes bug #57047.
11362
11363 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
11364
11365         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11366         New method, looking for lo-case imported cls type.
11367
11368         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11369         here.
11370
11371         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11372
11373         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11374
11375         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11376         all_imported_types.
11377         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11378
11379         Optimized to save 3.5 MB for SWF compilation.
11380
11381 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11382
11383         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11384         (PartialContainer.Create): Moved logic AddToContainer.
11385         (PartialContainer.MarkForDuplicationCheck): Shares name.
11386         
11387         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11388         place.
11389         
11390         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11391         initialization.
11392         (Namespace.GetSignatureForError): New method.
11393         
11394         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11395         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11396
11397 2005-08-01  Raja R Harinath  <rharinath@novell.com>
11398
11399         Fix #75669.
11400         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11401         member lookup rather than qualifier_type, since qualifier_type can
11402         be null.
11403
11404 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11405
11406         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11407         enum member.
11408
11409 2005-07-31  Miguel de Icaza  <miguel@novell.com>
11410
11411         * statement.cs: Copy the local exception into the exception
11412         captured local.  Fixes 75674
11413
11414 2005-07-31  Raja R Harinath  <harinath@gmail.com>
11415
11416         Fix #75658.
11417         * expression.cs (Invocation.OverloadResolve): Don't report error
11418         CS1501 if error CS1502 has been reported.
11419         (New.DoResolve): Delegate CS1501 reporting to
11420         Invocation.OverloadResolve.
11421
11422         Fix #75656.
11423         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11424         invariant-meaning-in-block property in an enclosing block if
11425         necessary.
11426
11427 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
11428
11429         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11430         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11431         (Switch.CheckSwitch): Just save 50kb for SWF.
11432
11433 2005-07-27  Martin Baulig  <martin@ximian.com>
11434
11435         * anonymous.cs (CaptureContext.AddField): Added
11436         `AnonymousContainer am' argument; compute its toplevel scope if
11437         it's not already computed.  Fixes #75649.
11438
11439 2005-07-26  Raja R Harinath  <rharinath@novell.com>
11440
11441         Fix #75628.
11442         * class.cs (Constructor.Emit): Reset block to null if the block
11443         resolve fails.
11444
11445 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11446
11447         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11448
11449 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11450
11451         * class.cs (MethodData.Define): Check whether accessor implementing
11452         interface is public.
11453
11454         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11455
11456 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
11457
11458         Fix #57245
11459         * namespace.cs (LookupType): Moved same type check to...
11460         
11461         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11462         with the same name.
11463
11464 2005-07-21  Raja R Harinath  <rharinath@novell.com>
11465
11466         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11467         already found a typebuilder.
11468         * class.cs (MethodCore.IsDuplicateImplementation): Compare
11469         MemberNames, not strings.
11470
11471         * const.cs (Error_ExpressionMustBeConst): 
11472         Rename from Error_EpressionMustBeConst.
11473         * const.cs, class.cs, statement.cd: Update.
11474
11475 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
11476
11477         Fix #65573
11478
11479         * const.cs (Const.LookupConstantValue): Report missing contant expression
11480         everytime.
11481         (Error_EpressionMustBeConstant): Only one error method.
11482
11483         * class.cs, statement.c: Updated.
11484
11485 2005-07-20  Raja R Harinath  <rharinath@novell.com>
11486
11487         * statement.cs (Block.Flags): Add back HasVarargs.
11488         (Block.flags): Make protected.
11489         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11490
11491         * typemanager.cs (types, typecontainers, user_types): Remove.
11492         (UserTypes, TypeContainers): Likewise.
11493         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11494         (CleanUp, Reset): Update.
11495         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
11496         (GetNestedType): Use Type.GetNestedType.
11497         (CoreLookupType): Take two arguments, the namespace and the
11498         basename of the type.  Update to use the Namespace.Lookup
11499         mechanism.
11500         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11501         (RealMemberLookup): Use IsNestedChildOf instead of playing with
11502         string concatenation and substring matches.
11503         * class.cs, enum.cs, delegate.cs: Update to changes.
11504
11505 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
11506
11507         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11508         Expression and made virtual.
11509
11510         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11511         (ImplicitStandardConversionExists): Fixed `byte' typo ?
11512
11513         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11514
11515         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11516         error message.
11517
11518         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11519         change.
11520
11521 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
11522
11523         Fix #57707
11524         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11525         AssemblyCultureAttribute is not used on executable.
11526
11527         * rootcontext.cs,
11528         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11529
11530 2005-07-16  Raja R Harinath  <rharinath@novell.com>
11531
11532         Fix #60638.
11533         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11534         New.  Reports CS0252/CS0253.
11535         Mostly taken from preliminary patch by Duncak Mak.
11536         (Binary.DoResolveOperator): Store results of operator lookup.
11537         Use them to detect if we need to warn about unintended reference
11538         comparisons.
11539
11540 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11541
11542         Fix #72969.
11543         * namespace.cs (Namespace.Lookup): Add back location parameter.
11544         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
11545         * delegate.cs, ecore.cs, expression.cs: Update to changes.
11546
11547         * codegen.cs (EmitContext.DeclSpace): Make readonly.
11548         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11549         (Namespace.LookupType): ... this.
11550         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11551         of namespaces.
11552         * typemanager.cs (LookupTypeReflection): Remove buggy code that
11553         purported to handle pointers.
11554         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11555         CoreLookupType.
11556
11557 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
11558
11559         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11560         type as namespace.
11561
11562 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11563
11564         * namespace.cs (Namespace.Lookup): Drop location parameter.
11565         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
11566         (NamespaceEntry.Lookup): ... this.
11567         (NamespaceEntry.Error_AmbiguousTypeReference):
11568         Move here from DeclSpace.
11569         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11570         names ...
11571         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11572         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11573         Move to NamespaceEntry.
11574         * delegate.cs, expression.cs: Update to changes.
11575
11576 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
11577
11578         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11579         CheckAttributeType and refactored.
11580         (Attribute.ResolvePossibleAttributeType): Changed to reuse
11581         ResolveAsTypeTerminal error handling.
11582         (ResolveAsTypeTerminal): Introduced because of global attributes extra
11583         handling.
11584         (GetSignatureForError): Print errors in same way.
11585
11586         * class.cs,
11587         * codegen.cs: Reflect attribute GetSignatureForError change.
11588
11589         * ecore.cs,
11590         * expression.cs: Add silent parameter to ResolveAsTypeStep.
11591
11592         * namespace.cs (UsingEntry): Refactored to make fields private.
11593
11594         * assign.cs,
11595         statement.cs: Error_UnexpectedKind has extra parameter.
11596
11597 2005-07-14  Raja R Harinath  <rharinath@novell.com>
11598
11599         * ecore.cs (IAlias): Remove.
11600         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
11601         that implement the interface.
11602         * namespace.cs (Namespace): Likewise.
11603         (Namespace.declspaces): Renamed from 'defined_names'.
11604         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
11605         DeclSpace instead of an IAlias.
11606         * tree.cs (Tree.AddDecl): Update.
11607
11608 2005-07-12  Raja R Harinath  <rharinath@novell.com>
11609
11610         * statement.cs (Block.Flags); Remove HasVarargs.
11611         (Block.HasVarargs): Move to ToplevelBlock.
11612         (Block.ThisVariable, Block.AddThisVariable): Likewise.
11613         (Block.Variables): Make protected.  Initialize variable hashtable
11614         if necessary.
11615         (Block.AddVariable): Update.
11616         (Block.Resolve): Update to changes.
11617         (ToplevelBlock.HasVarargs): New boolean.
11618         (ToplevelBlock.ThisVariable): Move here from Block.
11619         (ToplevelBlock.AddThisVariable): Likewise.
11620         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
11621         * expression.cs (This.ResolveBase): Update to changes.
11622         (ArglistAccess.DoResolve): Likewise.
11623
11624 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11625
11626         Fix #75321
11627         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11628
11629         * class.cs (TypeContainer.VerifyMembers): Distinguish between
11630         not used and not used & assigned.
11631         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11632
11633 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11634
11635         Fix #75053
11636         * expression.cs (Is.DoResolve): null is never provided type.
11637
11638 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
11639
11640         Fix #52496
11641         * cs-parser.jay: Less strict event error rule to catch more errors.
11642
11643 2005-07-08  Martin Baulig  <martin@ximian.com>
11644
11645         Fix test-iter-10.cs - distinguish whether we `yield' in a property
11646         gettter (allowed) or setter (not allowed).
11647
11648         * class.cs (Accessor): Implement IIteratorContainer.
11649         (Accessor.Yields): New public field.
11650         (PropertyBase.PropertyMethod.Define): Handle iterators on a
11651         per-accessor basis.
11652
11653         * cs-parser.jay
11654         (get_accessor_declaration, set_accessor_declaration): Set the
11655         `yields' flag on the accessor, not the property.
11656         (property_declaration): Do the iterators check on a per-accessor
11657         basis and not for the whole property.
11658
11659 2005-07-08  Martin Baulig  <martin@ximian.com>
11660
11661         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11662         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11663
11664 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
11665
11666         Fix #74975
11667         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11668         (ExtractSecurityPermissionSet): Cope with self referencing security
11669         attributes properly.
11670
11671         * driver.cs (SetOutputFile): Made public property OutputFile.
11672
11673 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11674
11675         Fix #75486.
11676         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11677         has_nonstatic_fields.  Make into a FieldBase pointer.
11678         (TypeContainer.AddField): Add CS0282 check.
11679         (TypeContainer.EmitType): Update.
11680
11681 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11682
11683         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11684         compare if they start with __.
11685
11686 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11687
11688         * statement.cs (Switch.SwitchGoverningType): Only look at
11689         UserCasts that don't need implicit standard conversions to one of
11690         the allowed switch types (Fixes test-322.cs).
11691         (LocalInfo.Resolve): Re-enable sanity-test.
11692
11693 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11694
11695         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11696         
11697         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11698         
11699         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11700
11701 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11702
11703         Fix #75472.
11704         * ecore.cs (SimpleName.GetSignatureForError): Add.
11705         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11706         (MemberAccess.GetSignatureForError): Add.
11707
11708 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11709  
11710         The big error and warning messages review.
11711         
11712         * anonymous.cs,
11713         * assign.cs,
11714         * attribute.cs,
11715         * class.cs,
11716         * codegen.cs,
11717         * convert.cs,
11718         * cs-parser.jay,
11719         * cs-tokenizer.cs,
11720         * decl.cs,
11721         * delegate.cs,
11722         * doc.cs,
11723         * driver.cs,
11724         * ecore.cs,
11725         * enum.cs,
11726         * expression.cs,
11727         * flowanalysis.cs,
11728         * iterators.cs,
11729         * literal.cs,
11730         * location.cs,
11731         * modifiers.cs,
11732         * namespace.cs,
11733         * parameter.cs,
11734         * pending.cs,
11735         * report.cs,
11736         * rootcontext.cs,
11737         * statement.cs,
11738         * support.cs,
11739         * tree.cs,
11740         * typemanager.cs: Updated.
11741         
11742         * class.cs: (MethodCore.SetYields): Moved here to share.
11743         (PropertyMethod.Define): Moved iterator setup here.
11744         
11745         * iterators.cs: Add orig_method to have full access to parent
11746         container.
11747
11748 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11749
11750         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11751         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11752         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11753         variable of struct type.
11754         * expression.cs (Unary.ResolveOperator): Update to change.
11755         (Indirection.VerifyFixed): Likewise.
11756         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11757         (ParameterReference.VerifyFixed): Value parameters are fixed.
11758         (This.VerifyFixed): Treat 'this' as a value parameter.
11759         * statement.cs (LocalInfo.IsFixed): Remove.
11760
11761 2005-07-01  Martin Baulig  <martin@ximian.com>
11762
11763         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11764         `ec.EmitThis ()' to get the correct scope.
11765
11766 2005-07-01  Martin Baulig  <martin@ximian.com>
11767
11768         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11769         instance is a ParameterReference; fixes #75299.
11770
11771 2005-07-01  Martin Baulig  <martin@ximian.com>
11772
11773         Reverted Marek's latest patch (r46725):
11774         - it contains structural changes which are neither mentioned in
11775           the ChangeLog nor explained anywhere; for example the additional
11776           argument of EmitContext's and Iterator's .ctor's and the
11777           TypeContainer.DefineMembers() change.
11778         - structural changes like this should go in in seperate patches
11779           and not be hidden in a huge patch which just seems to affect
11780           warnings and errors.
11781           a big and hard to understand patch.
11782         - it breaks iterators and causes regressions, for instance in
11783           test-iter-03.cs.      
11784
11785 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11786
11787         Fix #75412.
11788         * expression.cs (Indexers.map): Remove.
11789         (Indexers.Append): Filter out inaccessible setters and getters.
11790         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11791
11792         Fix #75283.
11793         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11794         Refactored from ...
11795         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11796         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11797         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11798         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11799
11800 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11801
11802         Fix #75322
11803         * class.cs (FieldBase.GetInitializerExpression): One more field
11804         for backup.
11805
11806 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11807
11808         * pending.cs: Do not define a proxy if the base method is virtual,
11809         it will be picked up by the runtime (bug 75270).
11810
11811 2005-06-08  Martin Baulig  <martin@ximian.com>
11812
11813         The big Iterators rewrite :-)
11814
11815         * iterators.cs: Rewrite this to use the anonymous methods framework.
11816
11817         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11818         before the TypeContainers; see 2test-21.cs.
11819
11820         * class.cs
11821         (TypeContainer.DefineType): Don't create a new EmitContext if we
11822         already have one (this only happens if we're an Iterator).
11823         (TypeContainer.Define): Also call Define() on all our iterators.
11824         (Method.CreateEmitContext): Added support for iterators.
11825
11826         * anonymous.cs
11827         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11828         (AnonymousContainer.CreateMethodHost): Moved here from
11829         AnonymousMethod and made abstract.
11830         (AnonymousContainer.CreateScopeType): New abstract method.
11831         (AnonymousContainer.IsIterator): New public property.
11832         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11833         get the ScopeTypeBuilder rather than manually defining it here. 
11834         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11835         iterators here.
11836
11837         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11838         before RootContext.DefineTypes().
11839
11840         * codegen.cs (EmitContext.RemapToProxy): Removed.
11841         (EmitContext.CurrentAnonymousMethod): Changed type from
11842         AnonymousMethod -> AnonymousContainer.
11843         (EmitContext.ResolveTopBlock): Protect from being called twice.
11844         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11845         (EmitContext.EmitThis): Removed the iterators hacks; use the
11846         anonymous methods framework for that.
11847
11848         * statement.cs
11849         (ToplevelBlock.Container): Make this a property, not a field.
11850         (ToplevelBlock.ReParent): New public method; move the
11851         ToplevelBlock into a new container.
11852         (Foreach.TemporaryVariable): Simplify.
11853
11854 2005-06-05  Martin Baulig  <martin@ximian.com>
11855
11856         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11857         (Block.AddTemporaryVariable): New public method; creates a new
11858         `LocalInfo' for a temporary variable.
11859         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11860         variables here.
11861         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11862         non-iterator variables.
11863
11864 2005-06-05  Martin Baulig  <martin@ximian.com>
11865
11866         * statement.cs (Foreach.TemporaryVariable): Create the
11867         LocalBuilder in the Emit phase and not in Resolve since in some
11868         situations, we don't have an ILGenerator during Resolve; see
11869         2test-19.cs for an example.
11870
11871 2005-06-04  Martin Baulig  <martin@ximian.com>
11872
11873         **** Merged r45395 from GCS ****
11874
11875         The big Foreach rewrite - Part II.
11876
11877         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11878         with `PropertyInfo ienumerator_getcurrent'.
11879
11880         * codegen.cs (VariableStorage): Removed.
11881
11882         * statement.cs
11883         (Foreach): Derive from Statement, not ExceptionStatement.
11884         (Foreach.CollectionForeach): New nested class.  Moved all the code
11885         dealing with collection foreach here.
11886         (Foreach.ForeachHelperMethods): Removed.
11887         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11888
11889 2005-05-23  Martin Baulig  <martin@ximian.com>
11890
11891         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11892         don't need to.  Fix #75014.
11893
11894 2005-05-20  Martin Baulig  <martin@ximian.com>
11895
11896         Merged r44808 from GMCS.
11897
11898         * class.cs (TypeContainer.CircularDepException): Removed.
11899         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11900         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11901         (CS0146) and interface (CS0529) dependencies here.
11902
11903 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11904
11905         * expression.cs (Invocation.EmitCall): Fix initialization
11906         'this_call' to reflect current behaviour.  Fix indentation.
11907
11908         * convert.cs (FindMostEncompassedType): Add two trivial special
11909         cases (number_of_types == 0 || number_of_types == 1).
11910         (FindMostEncompasingType): Likewise.
11911
11912 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11913
11914         Some cleanups preparing for the fix of #75283.
11915         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11916         error testing.
11917         (EventExpr.InstanceResolve): Likewise.
11918         (EventExpr.DoResolve): Remove redundant checks.
11919
11920 2005-06-10  Duncan Mak  <duncan@novell.com>
11921
11922         * cs-tokenizer.cs (process_directives): New flag for controlling
11923         the processing of preprocessor directives.
11924         (x_token): After seeing a '#', return Token.NONE instead of going
11925         to handle_preprocessing_directive() when not processing
11926         directives. This avoids unnecessary processing during the token peek in
11927         is_punct().
11928
11929         This fixes #74939.
11930
11931         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11932         the existing error reporting methods instead of Report.Error.
11933
11934         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11935         after Raja's rewrite.
11936
11937 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11938
11939         * class.cs: Small fix.
11940
11941 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11942
11943         Fix #75160.
11944         * class.cs (GetPartialBases): Fix return value check of
11945         part.GetClassBases.
11946
11947 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11948
11949         Ensure that partial classes are registered in their enclosing
11950         namespace.  Initial part of fix of #75160.
11951         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11952         Register declspace with namespace here, not in
11953         DeclSpace.RecordDecl.
11954         * cs-parser.jay: Pass namespace to RecordDecl.
11955         * class.cs (PartialContainer.Create): Likewise.
11956         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11957         called.
11958         * decl.cs (Declspace.RecordDecl): Remove.
11959         * namespace.cs (NamespaceEntry.DefineName): Remove.
11960
11961 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11962
11963         * rootcontext.cs: Reset TargetExt as well.
11964
11965 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11966
11967         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11968         -langversion:ISO-1.
11969
11970 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11971
11972         Fix #75080, cs0119.cs.
11973         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11974         of ...
11975         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11976         allowing ExprClass.Type and ExprClass.Namespace for
11977         ResolveFlags.VariableOrValue.
11978         (Expression.Resolve) [1-argument variant]: Change default resolve
11979         flags based on language version.
11980         (Expression.Error_UnexpectedKind): Use a simple string array
11981         rather than an ArrayList.
11982         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11983         not ExprClass.Type.
11984         (TypeOfVoid.DoResolve): Likewise.
11985         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11986         flags argument -- it always has the same value.
11987
11988 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11989
11990         Fix #75081.
11991         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11992         Use it in the error message.
11993         * assign.cs, expression.cs, statement.cs: Update.
11994
11995 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11996
11997         Fix #75088.
11998         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11999         the "almostMatchedMember" case too.
12000         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
12001         that failed the accessibility checks to 'almost_match'.
12002
12003 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
12004
12005         * attribute.cs: Use internal MethodBuilder methods to set
12006         ExactSpelling and SetLastError on PInvoke methods, instead
12007         of passing them via charset.  Fixes #75060.
12008
12009 2005-05-27  Raja R Harinath  <rharinath@novell.com>
12010
12011         * parameter.cs (Parameter): Remove TODO comment.
12012         (Parameter.DefineParameter): Remove Location parameter.
12013         (Parameters.LabelParameters): Likewise.
12014         * class.cs (Constructor.Emit): Update to change.
12015         (MethodData.Emit): Likewise.
12016         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
12017         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
12018
12019 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
12020
12021         * parameter.cs,
12022           Removed Parameters.Location and added Parameter.Location instead.
12023           Removed Location parameter from Emit() and GetSignature().
12024         * anonymous.cs,
12025           class.cs,
12026           cs-parser.jay,
12027           delegate.cs,
12028           iterators.cs,
12029           statement.cs :
12030           Modified all related calls.
12031
12032 2005-05-26  Raja R Harinath  <rharinath@novell.com>
12033
12034         Improve user-defined conversion handling.
12035         * convert.cs (GetConversionOperators): Rewrite.  Return only the
12036         applicable operators.
12037         (AddConversionOperators): New.  Helper for GetConversionOperators.
12038         (FindMostEncompassedType, FindMostEncompassingType): Verify that
12039         there is only one most encompassed/encompassing type.
12040         (FindMostSpecificSource, FindMostSpecificTarget): Remove
12041         "applicable operator" handling.
12042         (UserConversion): Move cache here from GetConversionOperators.
12043         Directly cache the chosen operator, rather than the whole
12044         MethodGroup.
12045         (ExplicitNumericConversion): Fix buggy implementation of Decimal
12046         case.  Allow conversion of decimal to sbyte and byte too.
12047         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
12048         New static methods.  Used to avoid allocating EmptyExpressions in
12049         convert.cs.
12050
12051 2005-05-24  Duncan Mak  <duncan@novell.com>
12052
12053         * ecore.cs (CastFromDecimal): New class for casting a decimal to
12054         another class, used in Convert.ExplicitNumericConversion.
12055         (CastToDecimal): New class, similar to above, but casts to
12056         System.Decimal, used in Convert.ImplicitNumericConversion and also
12057         in explicit convesion from double/float to decimal.
12058
12059         * convert.cs (ImplicitNumericConversion): Handle implicit
12060         conversions to System.Decimal.
12061         (ExplicitNumericConversion): handle explicit conversions to
12062         System.Decimal.
12063
12064         This fixes #68711.
12065         
12066 2005-05-20  Miguel de Icaza  <miguel@novell.com>
12067
12068         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
12069         know the type at this stage, just break through.   Fixes #75008 
12070
12071 2005-05-19  Martin Baulig  <martin@ximian.com>
12072
12073         * delegate.cs
12074         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
12075         to disable error reporting.
12076
12077         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
12078         here since we don't want to report an error; see the new test-336.cs.
12079
12080 2005-05-19  Raja R Harinath  <rharinath@novell.com>
12081
12082         * statement.cs (ToplevelBlock.GetParameterReference)
12083         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
12084         Move here from class Block.
12085         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
12086         * expression.cs (ParameterReference.DoResolveBase): Likewise.
12087
12088 2005-05-18  Martin Baulig  <martin@ximian.com>
12089
12090         Fix #74978.
12091
12092         * flowanalysis.cs
12093         (FlowBranching.Reachability): Add non-static public And() and Or()
12094         methods.
12095         (FlowBranchingSwitch): New class; do the `break_origins' thing
12096         like in FlowBranchingLoop.
12097         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12098         reachability, not just locals and parameters.
12099         (FlowBranching.MergeChild): Remove some of the hacks for loop and
12100         switch; MergeBreakOrigins() now takes care of that.
12101
12102 2005-05-18  Martin Baulig  <martin@ximian.com>
12103
12104         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12105         a loop and may leave it, reset the barrier; fixes #74974.
12106
12107 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
12108         
12109         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12110         is back.
12111         
12112         * cs-parser.jay: Catch more lexical errors.
12113         
12114         * report.cs: Add one more Error method.
12115         
12116         * rootcontext.cs,
12117         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12118
12119 2005-05-17  Martin Baulig  <martin@ximian.com>
12120
12121         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12122         #70970. 
12123
12124 2005-05-16  Raja R Harinath  <rharinath@novell.com>
12125
12126         Fix test-382.cs.  Emit values of decimal constants.
12127         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12128         Carved out of ...
12129         (TypeContainer.AddField): ... this.
12130         (TypeContainer.EmitFieldInitializers): Allow the list of fields
12131         with initializers to include 'Const's.
12132         (ClassPart.RegisterFieldForInitialization): Forward to
12133         PartialContainer.
12134         * const.cs (Const.Const): Pass initializer to base class.
12135         (Const.Define): In case of decimal constants, register them for
12136         initialization in a static constructor.
12137
12138 2005-05-14  Martin Baulig  <martin@ximian.com>
12139
12140         * statement.cs (Block.Resolve): Correctly handle unreachable code;
12141         do not call ResolveUnreachable() on unreachable statements in
12142         here, see the comment in the source code.
12143
12144 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12145
12146         Fix #74934.
12147         * expression.cs (BinaryResolveOperator): If one of the operands of
12148         an equality comparison is 'null' and the other is a pointer type,
12149         convert the null to a NullPointer.
12150         * convert.cs (ImplicitReferenceConversion): If the expression is a
12151         NullLiteral and the target type is a pointer type, return a
12152         NullPointer instead.
12153         (ImplicitConversionStandard): Likewise.
12154
12155 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
12156         
12157         * cs-parser.jay: Set readonly context based on special constructs.
12158         
12159         * expression.cs (LocalVariableReference.DoResolveBase): Improved
12160         readonly variable error handling.
12161         
12162         * rootcontext.cs (EmitCode): Don't verify members when error
12163         occurred.
12164         
12165         * statement.cs (LocalInfo): Add reaodnly context information.
12166         (SetReadOnlyContext, GetReadOnlyContext): New methods.
12167
12168 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12169
12170         * statement.cs (Block.Resolve): Revert change below.  Modify fix
12171         for #74041 to initialize 'resolved' to false only for explicit
12172         blocks.  Fixes #74873.
12173
12174 2005-05-12  Raja R Harinath  <harinath@gmail.com>
12175
12176         Fix #74920.
12177         * typemanager.cs (unmanaged_enclosing_types): New.
12178         (IsUnmanagedType): Avoid infloops by using
12179         'unmanaged_enclosing_types' to talk with recursive invocations.
12180
12181 2005-05-13  Martin Baulig  <martin@ximian.com>
12182
12183         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12184         instance variable, not a local.  Fix #74873.
12185         (Block.ResolveUnreachable): Set it to true here.
12186
12187 2005-05-11  Duncan Mak  <duncan@novell.com>
12188
12189         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12190         continuing to process for 'arg'.
12191         (handle_preprocessing_directive): Check the argument of the #endif
12192         directive and report error CS1025 if there are any trailing
12193         characters.
12194
12195         According to the C# spec, having even whitespace after the #endif
12196         directive is illegal; however, because we call arg.TrimEnd ()
12197         beforehand, we have the same behavior as csc, allowing whitespace
12198         after the directive.
12199
12200         Fixes #74892.
12201
12202 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
12203
12204         Fix #74863.
12205         
12206         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12207         (Constructor.GetObsoleteAttribute): Implemented correctly.
12208
12209 2005-05-10  Martin Baulig  <martin@ximian.com>
12210
12211         * support.cs (ReflectionParameters.ParameterModifier): Use
12212         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12213         and `ParameterAttributes.In'.  Fixes #74884.
12214
12215 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
12216
12217         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12218         
12219         * expression.cs (Argument.GetParameterModifier): Turned to property.
12220         (Invocation.Error_InvalidArguments): Add more descriptive errors.
12221         
12222         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12223         its C# equivalent.
12224         
12225 2005-05-09  Raja R Harinath  <rharinath@novell.com>
12226
12227         Fix #74852.
12228         * decl.cs (MemberCache.AddMethods): Register override methods,
12229         rather than non-override methods.
12230         * typemanager.cs (RegisterOverride): New.
12231         (IsOverride): Update.
12232
12233 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
12234
12235         Fix #73105.
12236         
12237         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12238         recursive declaration.
12239         
12240         * statement.cs (Block.ResolveMeta): Report any error in resolving.
12241         
12242 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
12243
12244         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12245         
12246         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12247
12248 2005-05-05  Raja R Harinath  <rharinath@novell.com>
12249
12250         Fix #74797.
12251         * decl.cs (DeclSpace.FamilyAccessible): 
12252         Use TypeManager.IsNestedFamilyAccessible.
12253
12254         Fix reopened #64812.
12255         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12256         internal'.
12257
12258 2005-05-04  Raja R Harinath  <rharinath@novell.com>
12259             Abin Thomas  <projectmonokochi@rediffmail.com>
12260             Anoob V E  <projectmonokochi@rediffmail.com>
12261             Harilal P R  <projectmonokochi@rediffmail.com>
12262
12263         Fix #64812.
12264         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12265         allow access to all static members.
12266
12267 2005-05-04  Martin Baulig  <martin@ximian.com>
12268
12269         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12270
12271 2005-05-04  Martin Baulig  <martin@ximian.com>
12272
12273         Fix #74655.
12274
12275         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12276         section at the end; make things work if `default' is not the last
12277         section.        
12278
12279 2005-05-04  Martin Baulig  <martin@ximian.com>
12280
12281         Fix #70400.
12282
12283         * statement.cs (Switch): Replaced the `got_default' field with a
12284         `default_section' one.
12285         (Switch.CheckSwitch): Set `default_section' here.
12286         (Switch.Resolve): If we're a constant switch and the constant is
12287         not found, use the default section.
12288
12289 2005-05-03  Martin Baulig  <martin@ximian.com>
12290
12291         * expression.cs (ArrayAccess.EmitGetLength): New public method.
12292
12293         * statement.cs (Foreach.ArrayForeach): New nested class.
12294         (Foreach.TemporaryVariable): New nested class.
12295         (Foreach.EmitArrayForeach): Removed; this is now in the new
12296         ArrayForeach class.
12297
12298 2005-05-03  Raja R Harinath  <rharinath@novell.com>
12299
12300         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
12301         more conservative.
12302         (VerifyPendingMethods): Revert change below.
12303
12304         * typemanager.cs (IsOverride, RegisterNonOverride): New.
12305         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12306         that used to trigger warning -28.  Remove warning -28.
12307         * expression.cs (Invocation.OverloadResolve): Use
12308         TypeManager.IsOverride to distinguish override methods.
12309
12310         Fix #74773.
12311         * pending.cs (VerifyPendingMethods): If a base type implements the
12312         requested interface, don't bother checking individual methods of
12313         the base type.  As a side-effect, this prevents the creation of
12314         unnecessary proxies.
12315
12316 2005-05-02  Martin Baulig  <martin@ximian.com>
12317
12318         Fix #70182.
12319
12320         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12321         Also `And' the locals if the old vector is null.
12322         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12323         null; in this case we basically reset all the variables.        
12324
12325 2005-05-02  Martin Baulig  <martin@ximian.com>
12326
12327         Fix #74529.
12328
12329         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12330         Added `FlowBranching branching' argument; always `and' the
12331         variables instead of `or'ing them unless we're an infinite loop.
12332
12333         * statement.cs (While.Resolve): Create a new sibling unless we're
12334         infinite.       
12335
12336 2005-05-02  Martin Baulig  <martin@ximian.com>
12337
12338         Fix #70140.
12339
12340         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12341         arguments; use it instead of creating a new TopLevelBlock.
12342         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12343         our ConstructorInitializer.
12344
12345         * statement.cs
12346         (TopLevelBlock.TopLevelBranching): New public property.
12347         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12348         and create our `TopLevelBranching'.
12349
12350         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12351         anonymous method host, use `block.TopLevelBranching' rather than
12352         creating a new branching.
12353
12354 2005-04-20  Miguel de Icaza  <miguel@novell.com>
12355
12356         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12357         a ScopeInfo, if any of the current children is a child of the new
12358         entry, move those children there.
12359
12360 2005-04-30  Martin Baulig  <martin@ximian.com>
12361
12362         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12363         at the beginning of a SwitchSection.  Fix #73335.
12364
12365 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
12366
12367         Fix #74378
12368         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12369         
12370         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12371         (FieldExpr.DoResolve): Obsolete members are ignored for field
12372         initializers.
12373         
12374 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
12375
12376         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12377         of arrays detection.
12378
12379         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12380         verification.
12381         (Field.VerifyClsCompliance): Volatile fields are not compliant.
12382
12383         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12384         arrays report.
12385
12386 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
12387
12388         * cs-parser.jay: Use the prefered version of -unsafe in error
12389         message.
12390
12391 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
12392
12393         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12394         circumstances.
12395
12396 2005-04-20  John Luke  <john.luke@gmail.com>
12397
12398         * driver.cs: fix typo in error message, --outout to --output
12399
12400 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
12401
12402         * codegen.cs (InRefOutArgumentResolving): New field.
12403         
12404         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12405         fields outside contructor.
12406         
12407         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12408         
12409 2005-04-19  Miguel de Icaza  <miguel@novell.com>
12410
12411         * anonymous.cs (CaptureContext.EmitParameterInstance): The
12412         parameter code was not completed ever, so it was not as up-to-date
12413         as local variables.  Must finish it.
12414
12415         The bug fix was to compare the Toplevel of the block, not the
12416         current block.  Thanks for Ben for pointing this out. 
12417
12418 2005-04-19  Raja R Harinath  <rharinath@novell.com>
12419
12420         * decl.cs (AddMethods): Use the declaring type of the problem
12421         method to determine if we want to squash a warning.
12422
12423 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
12424
12425         * attribute.cs: Removed debug output.
12426
12427         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12428         
12429         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12430         Report.Stderr.
12431         
12432 2005-04-18  Raja R Harinath  <rharinath@novell.com>
12433
12434         Fix #74481.
12435         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12436         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12437         all null comparisons against reference types.
12438
12439 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
12440
12441         Fix# 74565
12442         * class.cs (TypeContainer.CircularDepException) New nested
12443         exception class.
12444         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12445         (TypeContainer.DefineType): Removed error, reset InTransit before
12446         exit.
12447         (Class.DefineType): Throw exception when is in Transit.
12448         Catch exception and report error.
12449         (Struct.DefineType): Throw exception when is in Transit.
12450         Catch exception and report error.
12451         (Interface.DefineType): Throw exception when is in Transit.
12452         Catch exception and report error.
12453
12454         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12455         handle nested exception handlers.
12456
12457         * flowanalysis.cs (InTryWithCatch): New method, search for try with
12458         a catch.
12459
12460         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12461         InFinally and InCatch storage.
12462
12463         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12464         (Catch.Resolve): Set and Restore ec.InCatch.
12465         (Try.Resolve): Set and Restore ec.InFinally.
12466         (Try.HasCatch): True when try has catch.
12467
12468 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
12469
12470         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12471           for the same event member, so exclude such cases from warning 419.
12472           Fixed bug #74633.
12473
12474 2005-04-16  Miguel de Icaza  <miguel@novell.com>
12475
12476         * expression.cs (Binary.ResolveOperator): Apply patch from John
12477         Luke to fix bug 59864: operators &, | and ^ on enumerations
12478         require that the same enum type on both sides.
12479
12480         * driver.cs: Add warnings to old flag usage, this is to assist
12481         people who produce Makefiles and hope that the Makefiles will be
12482         used on Windows.
12483
12484         * class.cs (TypeContainer.EmitType): Moved the definition of the
12485         special $PRIVATE$ field from the resolve phase to the Emit phase.
12486         During resolve we do not know if we are a struct with
12487         HasExplicitLayout, we know this only after the attributes for the
12488         type are emitted.
12489
12490         Set the FieldOffset to zero on the dummy field that we create for
12491         the class.   Fixes 74590.
12492
12493 2005-04-16  Raja R Harinath  <rharinath@novell.com>
12494
12495         Fix #73834.
12496         * ecore.cs (PropertyExpr.resolved): New.
12497         (DoResolve): Use it to handle a case of double resolution here.
12498         Handle a case of identical-name-and-type-name.
12499         * expression.cs (ArrayCreation.CheckIndices): Avoid double
12500         resolution by storing the results of expression resolution back
12501         into the "probes" array.
12502
12503 2005-04-15  Raja R Harinath  <rharinath@novell.com>
12504
12505         Fix cs0208-7.cs and cs0208-8.cs.
12506         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12507         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
12508         error reporting to point out the reason a struct is not unmanaged.
12509
12510 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12511
12512         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
12513           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12514
12515 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12516
12517         Fix #74528.
12518         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12519         IdenticalNameAndTypeName here.
12520         (EventExpr.InstanceResolve): Likewise.
12521
12522 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
12523
12524         C# 2.0 DefaultCharSetAttribute implementation
12525         
12526         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12527         which allows us to set GlobalNamespace for every resolve.
12528         (Attribute.ResolveArguments): Cut from Resolve.
12529         (Attribute.GetCharSetValue): Returns CharSet named argument.
12530         (Attribute.DefinePInvokeMethod): Gets default charset from
12531         module settings.
12532         (GlobalAttribute.ResolveAsTypeStep): Override.
12533         (GlobalAttribute.ResolveArguments): Override.
12534         
12535         * class.cs (TypeAttr): Is protected.
12536         
12537         * codegen.cs (ModuleClass.DefaultCharSet): New member.
12538         (ModuleClass.DefaultCharSetType): New memeber.
12539         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12540         
12541         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12542         charset from module.
12543         
12544         * delegate.cs (TypeAttr): Override.
12545         (Delegate.DefineType): Use this TypeAttr.
12546         
12547         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12548         at very early stage (before types are defined) to resolve model
12549         module attributes. It will probably not work with corlib but it
12550         should be ok.
12551         
12552         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12553         charset from module.
12554         
12555         * typemanager.cs (default_charset_type): New type.
12556
12557 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12558
12559         * decl.cs (MemberCache.AddMethods): Don't warn if
12560         System.Object.Finalize has buggy MethodAttributes.
12561
12562         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12563         removed below.
12564
12565 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12566
12567         * doc.cs : detect ambiguous reference to overloaded members.
12568           Fixed bug #71603. MS 1.1 csc does not detect it.
12569
12570 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12571
12572         * doc.cs : delegates must not be referenced with parameters.
12573           Fixed bug #71605.
12574
12575 2005-04-12  Miguel de Icaza  <miguel@novell.com>
12576
12577         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12578
12579 2005-04-10  Miguel de Icaza  <miguel@novell.com>
12580
12581         * driver.cs (MainDriver): Stop processing if the CLS stage found
12582         errors. 
12583
12584         (CompilerCallableEntryPoint.InvokeCompiler): Always
12585         reset after execution;   Take a TextWriter argument for the
12586         output.
12587
12588         * report.cs: Use the error stream instead of hardcoding stderr. 
12589
12590 2005-04-09  Miguel de Icaza  <miguel@novell.com>
12591
12592         * class.cs: Reduce code paths to test, too small of an
12593         optimization to make it worth the extra testing.  Always perform
12594         it. 
12595
12596 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12597
12598         Fix #74510.
12599         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12600         operators that had errors reported on them.
12601
12602 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
12603
12604         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12605         argument types.
12606         (Attribute.Resolve): Add named argument type checking.
12607         
12608         * class.cs (FixedField.Define): Use IsPrimitiveType
12609         
12610         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12611         
12612         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12613         unsafe parameter types.
12614         
12615         * statement.cs (Using.ResolveExpression): Add better error description.
12616         
12617         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12618         
12619 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12620
12621         Fix #74484.
12622         * attribute.cs (Attribute.GetAttributeUsage): Resolve
12623         AttributeUsageAttribute in the emitcontext of the attribute class,
12624         not in the emitcontext of the attributable entity it was attached to.
12625         * cs-parser.jay: Use 'current_class', not 'current_container',
12626         when creating a GlobalAttribute.
12627
12628 2005-04-08  Alp Toker  <alp@atoker.com>
12629
12630         * pending.cs: The fix to #58413 failed to compile methods implementing
12631         interfaces with/without params modifiers and vice versa, even though
12632         params modifiers aren't part of the signature. Make the modifier check
12633         less strict as in csc.
12634
12635 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
12636             Anoob V E  <projectmonokochi@rediffmail.com>
12637             Harilal P R  <projectmonokochi@rediffmail.com>
12638
12639         Fix #58413.
12640         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
12641         modifiers of pending methods.
12642         (PendingImplementation.PendingImplementation): Initialize it.
12643         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12644         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12645         with ParameterData.  Add check for modifiers.
12646         * class.cs (MethodData.Define): Update to changes.
12647
12648 2005-04-07  Raja R Harinath  <rharinath@novell.com>
12649
12650         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12651
12652 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
12653
12654         * class.cs (PropertyMethod.Define): Check private accessor in abstract
12655         property.
12656         
12657         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12658         
12659         * rootcontext.cs,
12660         * typemanager.cs: Registered RequiredAttributeAttribute.
12661         
12662 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
12663
12664         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12665         Warning CS0169 is back at level 3.
12666         (IMethodData.SetMemberIsUsed): New method.
12667         
12668         * decl.cs (IsUsed): New value; moved from FieldBase.Status
12669         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12670         
12671         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12672
12673         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12674         contants.
12675         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12676         is used.
12677         
12678         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12679         is used.
12680         
12681         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12682         to avoid the problems with nested types.
12683
12684 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12685             Anoob V.E  <projectmonokochi@rediffmail.com>
12686             Harilal P.R  <projectmonokochi@rediffmail.com>
12687             Raja R Harinath  <rharinath@novell.com>
12688
12689         Fix #73820.
12690         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12691         attribute.
12692         * typemanager (GetConstructor): Make public.
12693
12694 2005-04-05  John Luke  <john.luke@gmail.com>
12695             Raja R Harinath  <rharinath@novell.com>
12696
12697         Fix #62232.
12698         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12699         struct too.  Return false quicker in a few cases.
12700         (VerifyUnManaged): Use it.
12701
12702 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12703
12704         Fix #74041.
12705         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12706         not 'unreachable_seen'.
12707
12708 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12709
12710         * attribute.cs (Attribute.GetValue): Removed unused.
12711         
12712         * codegen.cs (CodeGen.TrimExt): Removed unused.
12713         
12714         * cs-parser.jay (output): Removed unused.
12715         
12716         * cs-tokenizer.cs (hex_digits): Removed unused.
12717         
12718         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12719         
12720         * expression.cs (Indirection.LoadExprValue): Removed unused.
12721         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12722         
12723         * iterators.cs (Iterator.param_types): Removed unused.
12724         
12725         * statement.cs (Goto.block): Removed unused.
12726         (ToplevelBlock.did): Removed unused.
12727         (Switch.ResolveConstantSwitch): Removed unused.
12728
12729 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12730
12731         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12732         resetting thingy.
12733
12734 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12735
12736         Fix #74232 and cs0208-3.cs.
12737         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12738         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12739         unmanaged type.  Don't use FieldBuilders when 't' is a
12740         TypeBuilder.  Use ModFlags and MemberType fields.
12741         * class.cs (MemberBase.member_type): Rename from MemberType.
12742         (MemberBase.MemberType): New property.  Determines member_type on
12743         demand.
12744         (MemberBase.DoDefine): Don't initialize MemberType here.
12745         (FieldMember.Define): Likewise.
12746
12747 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12748
12749         Fix #74241
12750         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12751         Attributes are emitted there.
12752         
12753 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12754
12755         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12756         keyword in 'partial enum' too.
12757         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12758         is not allowed).
12759         Report from Kamil Skalski <nazgul@omega.pl>.
12760
12761         Fix #74309.
12762         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12763         have partial containers too.
12764
12765         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12766         in block' checks to Block.CheckInvariantMeaningInBlock.
12767         * statement.cs (Block.GetKnownVariableInfo): Make private.
12768         (Block.IsVariableUsedInChildBlock): Remove.
12769         (Block.IsVariableUsedInBlock): Likewise.
12770         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12771         conflicting declaration.
12772         (Block.AddVariable): Make error messages less long-winded and more
12773         specific.  Show location of conflicting declaration.
12774         * parameter.cs (Parameters.Location): New readonly property.
12775
12776 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12777
12778         Clean up semantics of invoking ResolveMemberAccess.
12779         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12780         can have an instance, ensure that we pass in a non-TypeExpression
12781         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12782         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12783         argument.  Update to changes and simplify.
12784         (FieldExpr.Emitinstance): Remove CS0120 check.
12785         (PropertyExpr.EmitInstance): Likewise.
12786         * expression.cs (Argument.Resolve): Likewise.
12787         (Invocation.DoResolve): Update to changes in semantics of
12788         InstanceExpression.
12789
12790 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12791
12792         Fix #74241
12793         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12794         customization.
12795         
12796         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12797
12798 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12799
12800         Fix difference in behaviour with commandline invocation.
12801         * driver.cs (Driver.Reset): New.
12802         (CompilerCallableEntryPoint): Call it.
12803
12804         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12805         variable" warnings if the boolean expression failed to resolve.
12806
12807 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12808
12809         * attribute.cs: Fix the union of several permissions when some of them
12810         are unrestricted (so the result isn't an unrestricted permission set).
12811         Fix #74036.
12812
12813 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12814
12815         * ecore.cs (MemberExpr): New class.  Convert from interface
12816         IMemberExpr.
12817         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12818         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12819         error checks.
12820         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12821         (MethodGroupExpr.IsExplicitImpl): Remove.
12822         (Expression.GetFieldFromEvent): Remove.
12823         (SimpleName.MemberStaticCheck): Remove.
12824         (SimpleName.DoSimpleNameResolve): Update to changes.
12825         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12826         (MemberAccess.IdenticalNameAndTypeName): Remove.
12827         (MemberAccess.error176): Move to MemberExpr.
12828         (MemberAccess.DoResolve): Update to changes.
12829         (BaseAccess.DoResolve): Likewise.
12830
12831 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12832
12833         C# 2.0 Conditional attribute class implementation
12834         
12835         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12836         Analyzes class whether it has attribute which has ConditionalAttribute
12837         and its condition is not defined.
12838         
12839         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12840         (Class.IsExcluded): New method. Search for at least one defined
12841         condition in ConditionalAttribute of attribute class.
12842
12843 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12844
12845         * ecore.cs (PropertyExpr): Derive from Expression, not
12846         ExpressionStatement.
12847         (PropertyExpr.EmitStatement): Remove.
12848
12849 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12850
12851         Fix #74060.
12852         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12853         internal field "value__" of an enum be private.  The examples for
12854         "value__" that I found on MSDN all used FieldAttributes.Private.
12855
12856         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12857         Don't mention IL method attribute names.
12858
12859         Fix #47991.  Remove a TODO.
12860         * statement.cs (Block.Toplevel): Make into a field.
12861         (Block.Parameters): Move into ToplevelBlock.
12862         (Block.known_variables): Rename from child_variable_names.
12863         (Block.Block): Remove variants that take Parameters.  Initialize
12864         'Toplevel' with the immediately surrounding toplevel block.
12865         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12866         LocalInfo parameter.
12867         (Block.GetKnownVariableInfo): New.
12868         (Block.IsVariableNameUsedInChildBlock): Update.
12869         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12870         the block, even though it may not be in scope.
12871         (Block.AddVariable): Remove Parameters parameter.  Use
12872         Toplevel.Parameters instead.
12873         (Block.AddConstant): Remove Parameters parameter.
12874         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12875         (Block.IsParamaterReference): Likewise.
12876         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12877         (ToplevelBlock.Parameters): New.  Moved from Block.
12878         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12879         initialize Parameters to a non-null value.
12880         * cs-parser.jay: Update to changes.
12881         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12882         simple names that mean different things in the same block.  Use
12883         Block.IsVariableNameUsedInBlock.
12884
12885 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12886
12887         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12888         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12889         GetTypeHandle.  It is possible for a reflected type to derive from
12890         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12891         System.Array during mscorlib compilation).
12892         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12893         contain a method_hash, don't create one either.  Don't create a
12894         deep copy of the base cache's method_hash.
12895         (MemberCache.SetupCache): Rename back from DeepCopy.
12896         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12897         already initialized.  If we see an override function, add its
12898         underlying base virtual function to the member_hash too.
12899
12900         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12901
12902 2005-03-26  Raja R Harinath  <harinath@acm.org>
12903
12904         Fix #73038.
12905         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12906         fails to resolve, ensure that the LHS is still resolved as an
12907         lvalue.
12908
12909 2005-03-25  Raja R Harinath  <harinath@acm.org>
12910
12911         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12912         ec.ContainerType.
12913         (Enum.current_ec): Remove.
12914         (Enum.LookupEnumValue): Remove EmitContext argument.
12915         Just uses the one created during DefineType.
12916         (Enum.FindMembers): Update.
12917         * expression.cs (MemberAccess.DoResolve): Update.
12918
12919 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12920
12921         * assign.cs (Assign.DoResolve): Check for CS1717 when
12922         source and target are same (uses Equals).
12923
12924         * expression.cs (LocalVariableReference, ParameterReference,
12925         This): Implemented Equals, GetHashCode.
12926
12927         * statement.cs (Block.GetParameterReference): Removed useless
12928         local variable.
12929
12930 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12931
12932         Fix cs0128.cs
12933         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12934         blocks before deciding whether the error is cs0136 or cs0128.
12935
12936         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12937         (using_alias_directive, using_namespace_directive): Pass
12938         MemberName, not an expression to Namespace.UsingAlias and
12939         Namespace.Using.
12940         (MakeName): Use the MemberName of the namespace.
12941         * namespace.cs (Namespace.MemberName): New.
12942         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12943         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12944         Likewise.
12945         * decl.cs (MemberName.Name): Make readonly.
12946         (MemberName.FromDotted): New "constructor".
12947         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12948         (MemberCore.Name): Compute from MemberName on demand.
12949         (MemberCore.SetMemberName): Provide a way to change the
12950         MemberName.
12951         (MemberCore.AddToContainer): Don't take a fullname parameter.
12952         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12953         fully qualified name of the container to the member name.
12954         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12955         only if the type is a member of the root container.
12956         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12957         MemberName.Left rather than searching for an embedded ".".
12958         (PartialContainer.CreatePart): Update to changes in RootContext.
12959         (MemberBase.ShortName): Turn into a property.  Use
12960         MemberCore.SetMemberName.
12961         (MemberBase.ExplicitInterfaceName): Remove.
12962         (MemberBase.UpdateMemberName): Remove.
12963         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12964         (PropertyBase.SetMemberName): New override.
12965         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12966         (Tree.GetDecl): New.
12967         (Tree.AllDecls): Rename from Decls.
12968         * attribute.cs, enum.cs, report.cs: Update to changes.
12969         * driver.cs (MainDriver): Use MemberName.FromDotted on
12970         RootContext.MainClass.
12971
12972 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12973
12974         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12975         checks.
12976
12977         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12978
12979 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12980
12981         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12982         property accessor modifiers.
12983
12984         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12985         fixed buffer attribute (CS1716).
12986         (PropertyMethod.HasCustomAccessModifier): When property accessor
12987         has custom modifier.
12988
12989         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12990         modifiers.
12991         (PropertyExpr.DoResolveLValue): Add CS0272.
12992
12993 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12994
12995         * convert.cs: When converting to a pointer, use the proper Conv.U
12996         or Conv.I depending on the source data type.
12997
12998         * cs-tokenizer.cs: Make the size for large decimal constants,
12999         fixes #72957.
13000
13001 2005-03-17  Martin Baulig  <martin@ximian.com>
13002
13003         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
13004         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
13005
13006 2005-03-17  Martin Baulig  <martin@ximian.com>
13007
13008         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
13009         to bool so we can return an error condition.
13010         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
13011         returned an error.
13012
13013 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
13014
13015         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
13016         attributes.
13017
13018 2005-03-16  Raja R Harinath  <rharinath@novell.com>
13019
13020         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
13021         Refactor to avoid traversing the list of assemblies, and to avoid
13022         string concatenation.
13023         * typemanager.cs (guid_attr_type): Remove.
13024         (negative_hits, pointers, references): Remove hashes.
13025         (type_hash): New.
13026         (GetConstructedType): New.  Uses type_hash to handle constructed
13027         types (arrays, references, pointers).
13028         (GetReferenceType, GetPointerType): Use it.
13029         (GetNestedType): New.  Uses type_hash to handle nested types of
13030         reflected types.
13031         (LookupType, LookupTypeDirect): Remove.
13032         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
13033         'types' hash and LookupTypeReflection directly.
13034         (params_string, params_object): Use GetConstructedType.
13035         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
13036         top-level types.
13037         (Namespace.Lookup): Use cached_types.
13038         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
13039         provided by old TypeManager.LookupType.
13040         * rootcontext.cs (MakeFQN): Remove.
13041         * decl.cs (DeclSpace.MakeFQN): Likewise.
13042         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
13043         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13044         TypeManager.GetConstructedType.
13045         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
13046
13047 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
13048
13049         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
13050         indexers.
13051
13052         * cs-parser.jay: Reports CS1527 for any namespace element.
13053
13054         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
13055         Added CS0407.
13056
13057         * expression.cs (ParameterReference.IsAssigned): Changed error to
13058         CS0269.
13059         (Error_WrongNumArguments): Moved CS0245 detection here.
13060
13061         * statement.cs (Return.Resolve): Add CS1622 report.
13062
13063 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
13064
13065         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
13066
13067 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
13068
13069         * attribute.cs expression.cs: Get rid of some allocations.
13070
13071 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
13072
13073         * doc.cs : just eliminate the latest change.
13074
13075 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13076
13077         * doc.cs : commented out the latest change. It breaks xml-030.cs
13078
13079 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13080
13081         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
13082           fail. So invoke CreateType() in FindDocumentedType().
13083
13084 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13085
13086         * cs-tokenizer.cs : added IsKeyword().
13087         * doc.cs : Detect keyword incorrectly used as identifier.
13088           Allow identifiers prefixed by @.
13089
13090 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
13091
13092         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13093         It caused exception in namespace resolving (again!).
13094         
13095         * class.cs (Class.ctor): Removed exit.
13096         (PropertyMethod.ctor): ditto.
13097         
13098         * codegen.cs (Codegen.Reset): Reset static data.
13099         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13100         
13101         * cs-tokenizer.cs (Cleanup): Removed.
13102         
13103         * driver.cs (GetSystemDir): Rewrote to one line command.
13104         It caused problem with unloaded dynamic modules.
13105         (UnixParseOption): Removed Exit.
13106         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13107         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13108         Now can be mcs used as library.
13109         
13110         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13111         empty location.
13112         
13113         * location.cs (Reset): Reset static data.
13114         
13115         * namespace.cs (Reset): Reset static data.
13116         
13117         * report.cs (Report.Reset): Reset static data.
13118         
13119         * rootcontext.cs (RootContext.Reset): Reset static data.
13120         
13121         * tree.cs (RootTypes.ctor): Use Location.Null
13122         
13123         * typemanager.cs (TypeManager.Reset): Reset static data.
13124         (CoreLookupType): Removed Exit.
13125         (TypeHandle.Reset): Reset static data.
13126         
13127 2005-03-10  Raja R Harinath  <rharinath@novell.com>
13128
13129         Fix #73516.
13130         * typemanager.cs (ComputeNamespaces): Import namespaces from
13131         referenced modules too.
13132
13133 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13134
13135         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13136         than '.'.
13137
13138 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13139
13140         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13141         enclosing DeclSpace.  This ensures that a name-lookup populates
13142         more caches and there are fewer 'TypeExpression's.  Carve out
13143         nested type lookup into ...
13144         (LookupNestedTypeInHierarchy): ... this.
13145
13146 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13147
13148         Clean up a few partial-class semantics.  
13149         Fixes test-357.cs and cs1618-2.cs.
13150         * cs-parser.jay (struct_declaration): Use 'current_class' as
13151         parent of newly-created struct.  Remove call to Register ().
13152         Use 'pop_current_class' to complete handing the current struct.
13153         (interface_declaration): Likewise.
13154         (class_declaration): Likewise.
13155         (enum_declaration): Use 'current_class' as parent of newly created
13156         enum.
13157         (delegate_declaration): Likewise.
13158         (pop_current_class): New function.  This is used to handle closing
13159         up the 'current_class' and 'current_container', and pointing them
13160         to the enclosing class/container.
13161         (CSharpParser): Initialize 'current_class' too.
13162         * decl.cs (MemberCore): Add check for invariant: a partial
13163         container is not a parsed entity, and thus does not enclose any
13164         parsed members.
13165         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13166         (DeclSpace.BaseTypeExpr): Use it.
13167         (DeclSpace.LookupType): Add check for invariant.
13168         * class.cs (TypeContainer): Add check for invariant: a nested
13169         class should have the same NamespaceEntry as its enclosing class.
13170         (TypeContainer.EmitFieldInitializers): Make virtual.
13171         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13172         MemberCore.
13173         (TypeContainer.Register): Remove.
13174         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13175         null.  Use TypeResolveEmitContext for resolving base types and
13176         interfaces.  Move initialization of Parts.TypeBuilder here from
13177         ...
13178         (TypeContainer.DefineNestedTypes): ... here.
13179         (PartialContainer): Take a Namespace not a NamespaceEntry.
13180         (PartialContainer.Create): Don't use Register.  Call the
13181         appropriate Add... function directly.
13182         (ClassPart): Take both the PartialContainer and the enclosing
13183         class as constructor arguments.
13184         (ClassPart.EmitFieldInitializers): Override.
13185         (ClassPart.PartFindNestedTypes): Remove.
13186         (FieldBase.GetInitializerExpression): Resolve the initializer
13187         expression in the emit context of the enclosing class.
13188         * tree.cs (RootTypes): Remove Register ().
13189         
13190 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
13191
13192         * cs-parser.jay: Removed CS0134.
13193         
13194         * driver.cs: Removed CS1901.
13195         
13196         * expression.cs (SizeOf.DoResolve): Don't report CS0233
13197         for predefined types.
13198
13199 2005-03-07  Duncan Mak  <duncan@novell.com>
13200
13201         * codegen.cs (Save):  Catch UnauthorizedAccessException as
13202         well. Fixes bug #73454.
13203
13204 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
13205
13206         * cs-tokenizer.cs (xtoken): Add CS1035.
13207         
13208         * class.cs (MethodData.Define): Add CS0683.
13209         (FieldMember.ctor): Add CS0681.
13210
13211 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13212
13213         * ecore.cs (SimpleName.DoResolve): Rename from
13214         SimpleName.DoResolveAllowStatic.
13215         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13216         Pass 'intermediate' flag to MemberStaticCheck.
13217         (SimpleName.MemberStaticCheck): Skip "static check" only in case
13218         of "intermediate" lookups via MemberAccess.
13219         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
13220         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13221
13222 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13223
13224         Fix #73394.
13225         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13226         slipped in because of variable names that are identical to a
13227         builtin type's BCL equivalent ('string String;', 'int Int32;').
13228         (PropertyExpr.EmitInstance): Likewise.
13229
13230 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
13231
13232         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13233         
13234         * report.cs (warning_ignore_table): Made public.
13235
13236 2005-03-04  Raja R Harinath  <rharinath@novell.com>
13237
13238         Fix #73282.
13239         * class.cs (MethodData.Emit): Pass 'container' to
13240         container.GetObsoleteAttribute instead of 'container.Parent'.
13241
13242 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
13243
13244         * cs-parser.jay: Add 1534 error test.
13245
13246         * iterators.cs (Yield.CheckContext): Add error 1629.
13247         (Iterator.ctor): Save unsafe modifier.
13248         (MoveNextMethod.DoEmit): Restore unsafe context.
13249
13250         * namespace.cs (UsingAlias): Better error message.
13251
13252 2005-03-03  Dan Winship  <danw@novell.com>
13253
13254         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13255         the warning message [#73219]
13256
13257 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13258
13259         Fix compile with MCS 1.0.0.0.
13260         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13261         w_restore to not depend on string constant folding.
13262
13263 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13264
13265         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
13266         CS0246 check to users who passed 'silent = false'.
13267         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13268         check.
13269         (SimpleName.SimpleNameResolve): Update.
13270         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13271         (MemberAccess.IdenticalNameAndTypeName): Update.
13272         * doc.cs (FindDocumentedTypeNonArray): Update.
13273
13274 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
13275
13276         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13277         * parameters.cs (ComputeAndDefineParameters): Remove.
13278         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13279         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13280         Use GetParameterInfo.
13281
13282 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
13283
13284         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13285
13286 2005-03-02  Raja R Harinath  <rharinath@novell.com>
13287
13288         Unify DeclSpace.LookupType and DeclSpace.FindType.
13289         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
13290         is in charge of defining nested types on demand.
13291         (DeclSpace.LookupType): Use it when the current_type is a
13292         TypeBuilder.  Use LookupTypeDirect for reflected types.
13293         (DeclSpace.FindType): Remove.
13294         (DeclSpace.LookupInterfaceOrClass): Likewise.
13295         (DeclSpace.DefineTypeAndParents): Likewise.
13296         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13297         DeclSpace.LookupType.
13298         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13299         * typemanager.cs (LookupType): Simplify.
13300         (AddUserType): Remove type from negative_hits.
13301         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13302         * class.cs (TypeContainer.FindMembers): Move handling of nested
13303         types ...
13304         (TypeContainer.FindMembers_NestedTypes): ... here.
13305         (TypeContainer.FindNestedType): Implement override.
13306         (ClassPart.FindNestedType): Delegate to PartialContainer.
13307         (ClassPart.PartFindNestedType): Looks up the nested types of the
13308         part alone.
13309
13310 2005-03-02  Martin Baulig  <martin@ximian.com>
13311
13312         * class.cs (TypeContainer.DoDefineMembers): We also need a default
13313         static constructor in static classes.
13314
13315 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
13316
13317         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13318         sizeParamIndex is not specified.
13319
13320 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
13321
13322         Fix #73117
13323         * report.cs (WarningMessage.IsEnabled): Missing null check.
13324
13325 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13326
13327         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13328         in the fields and not in the properties.
13329
13330 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
13331
13332         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
13333         fields as well.
13334
13335 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13336
13337         * attribute.cs: Small refactoring (improved robustness).
13338         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13339         (ValidateGuid): Removed.
13340         (Resolve): Removed referenced to above mentioned.
13341         (GetAttributeUsage): Made private and changed to work without
13342         class assistance.
13343         (GetIndexerAttributeValue): Don't crash.
13344         (GetConditionalAttributeValue): Ditto.
13345         (GetClsCompliantAttributeValue): Ditto.
13346         (ExtractSecurityPermissionSet): All attributes exceptions are
13347         error 648.
13348         (GetPropertyValue): New helper.
13349         (GetMethodImplOptions): New method.
13350         (DefinePInvokeMethod): Reuse common code. Implemented handling of
13351         some missing properties.
13352         
13353         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13354         (Method.ApplyAttributeBuilder): Updated.
13355         
13356         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13357         exception.
13358
13359 2005-02-28  Raja R Harinath  <rharinath@novell.com>
13360
13361         Fix #73052.
13362         * report.cs (Report.SymbolRelatedToPreviousError): Handle
13363         non-simple types (array, pointer, reference).
13364
13365 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13366
13367         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13368
13369         * class.cs (MethodCore.IsDuplicateImplementation): Special error
13370         for operators.
13371         (Method.CheckBase): Catch wrong destructor here.
13372         (MethodData.Define): Add errors 550, 668.
13373
13374         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13375
13376         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13377
13378         * pending.cs (VerifyPendingMethods): Add error 551.
13379
13380         * typemanager.cs (CSharpName): Next error report helper.
13381
13382 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
13383
13384         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13385         attributes. Removed useless attribute double check.
13386         It saves almost 2MBs for corlib.
13387
13388 2005-02-25  Raja R Harinath  <rharinath@novell.com>
13389
13390         Fix #72924.
13391         * statement.cs (ExpressionStatement.Resolve): Make robust to being
13392         called twice in case of error.
13393
13394 2005-02-23  Chris Toshok  <toshok@ximian.com>
13395
13396         Fix compiler portions of #72827.
13397         * statement.cs (Block.Emit): call Begin/EndScope on the
13398         EmitContext instead of the ILGenerator.
13399
13400         * codegen.cs (EmitContext.BeginScope): new method, call
13401         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13402         we have one.)
13403         (EmitContext.BeginScope): same, but EndScope and CloseScope
13404
13405         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13406         offset and call the superclass's OpenScope(int) with it.
13407         (SymbolWriter.CloseScope): get the current il
13408         offset and call superclass's CloseScope(int) with it.
13409
13410 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
13411
13412         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13413         CS1677 for out and ref as well.
13414
13415         * class.cs (Method.Define): Add error CS1599 detection.
13416         
13417         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13418         
13419         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13420         
13421         * delegate.cs (Delegate.Define): Add error CS1599 detection.
13422         
13423         * support.cs.cs (ModifierDesc): New helper method.
13424
13425 2005-02-23  Raja R Harinath  <rharinath@novell.com>
13426             Abin Thomas  <projectmonokochi@rediffmail.com>
13427             Anoob V E  <projectmonokochi@rediffmail.com>
13428             Harilal P R  <projectmonokochi@rediffmail.com>
13429
13430         Fix #57851, #72718.
13431         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13432         MemberLookup (used for error reporting) actually returns a result.
13433         Fix error report number (122, not 112).
13434
13435 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
13436             Anoob V E  <projectmonokochi@rediffmail.com>
13437             Harilal P R  <projectmonokochi@rediffmail.com>
13438
13439         Fix #71134.
13440         * pending.cs (PendingImplementation.GetAbstractMethods):
13441         Find NonPublic members too.
13442
13443 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
13444
13445         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13446         Fixed error 217.
13447         
13448         * class.cs (MethodCore.CheckMethodAgainstBase):
13449         Add error 239 report.
13450
13451 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13452
13453         Fix #68955.
13454         * expression.cs (Invocation.IsApplicable): Make public.
13455         (Invocation.IsParamsMethodApplicable): Likewise.
13456         * delegate.cs (Delegate.VerifyApplicability): Don't use
13457         Invocation.VerifyArgumentCompat for parameter applicability
13458         testing.  Use Invocation.IsApplicable and
13459         Invocation.IsParamsMethodApplicable.
13460
13461 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13462
13463         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13464         
13465         * class.cs (Operator.Define): Add error 217 report.
13466         
13467 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13468
13469         * namespace.cs (UsingEntry.Resolve): Undo change below.
13470
13471 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13472
13473         Fix #72756.
13474         * ecore.cs (Expression.MemberLookupFailed): Add argument to
13475         disable the error message when the extended MemberLookup also
13476         fails.
13477         (Expression.MemberLookupFinal): Update.
13478         (SimpleName.DoSimpleNameResolve): Update.
13479         * expression.cs (MemberAccess.ResolveNamespaceOrType):
13480         Don't use MemberLookupFinal.
13481         (New.DoResolve): Update.
13482         (BaseAccess.CommonResolve): Update.
13483
13484 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13485
13486         Fix #72732.
13487         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13488         occured previously, don't resolve again.
13489
13490 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13491
13492         Fix #69949
13493         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13494         argument. Call ResolveAttributeUsage for unresolved.
13495         when types doesn't match ctor arguments.
13496         
13497         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13498         for nested attribute classes.
13499         (Class.attribute_usage): Removed.
13500         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13501         for attribute class.
13502         
13503         * ecore.cs (IsAttribute): Removed.
13504         
13505         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13506         
13507         * rootcontext.cs (RegisterAttribute): Removed, attributes are
13508         now normal types.
13509         (attribute_types): Removed.
13510         (EmitCode): Global attributes are emited as the latest.
13511
13512 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
13513
13514         * class.cs (EmitFieldInitializers): Don't emit field initializer
13515         for default values when optimilization is on.
13516         
13517         * constant.cs (Constant.IsDefaultValue): New property.
13518         
13519         * driver.cs: Add /optimize handling.
13520         
13521         * constant.cs,
13522         * ecore.cs,
13523         * literal.cs: Implement new IsDefaultValue property.
13524         
13525         * rootcontext.cs (Optimize): New field, holds /optimize option.
13526
13527 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13528
13529         Fix crasher in re-opened #72347.
13530         * namespace.cs (Namespace.Lookup): Return null if
13531         DeclSpace.DefineType returns null.
13532
13533         Fix #72678.
13534         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13535
13536 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13537
13538         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
13539         now returns null if it cannot resolve to an lvalue.
13540         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13541         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13542         returned null.  Remove check for SimpleName.
13543         (EventExpr.DoResolveLValue): New.
13544         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13545         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
13546         error from ...
13547         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
13548         avoid CS0131 error.
13549         (Unary.ResolveOperator): Move CS0211 check ...
13550         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
13551         CS0131 error.
13552         (Unary.DoResolveLValue): Simplify.
13553         (AddressOf.DoResolveLValue): New.
13554         (ArrayAccess.DoResolveLValue): New.
13555
13556 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
13557
13558         * attribute.cs (Attribute.Resolve): Add arguments casting for
13559         when types doesn't match ctor arguments.
13560
13561 2005-02-16  Raja R Harinath  <rharinath@novell.com>
13562
13563         Fix parts of #63202.
13564         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13565         lookup of operator in base type.  Ensure that all checks happen
13566         when the operator resolves to an "op_..." method.
13567
13568 2005-02-15  Raja R Harinath  <rharinath@novell.com>
13569
13570         Fix #71992.
13571         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13572         'ignore_cs0104' parameter.  Pass it to ...
13573         (NamespaceEntry.Lookup): ... this.
13574         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13575         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13576         (TypeLookupExpression.DoResolveAsTypeStep): Update.
13577         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13578         Update.  Request that cs0104 errors be ignored.
13579         (ComposedCast.ResolveAsTypeStep): Update.
13580
13581 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13582
13583         Fix #59209.
13584         * expression.cs (Invocation.BetterFunction): Remove support for
13585         comparing virtual functions and their overrides.
13586         (Invocation.IsOverride): New.
13587         (Invocation.OverloadResolve): Don't consider 'override' functions
13588         during candidate selection.  Store them in a lookaside list.
13589         If the selected method is a 'virtual' function, use the list to
13590         find any overrides that are closer to the LHS type.
13591
13592 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
13593
13594         * expression.cs (New.DoResolve): Add complex core type reduction.
13595         (New.Constantify): Converts complex core type syntax like 'new int ()'
13596         to simple constant.
13597         
13598 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13599
13600         * decl.cs (EntryType.EntryType): New constructor to create an
13601         updated copy of a cache entry.
13602         (MemberCache.AddMethods): Use it.
13603         (MemberCache.ClearDeclaredOnly): Remove.
13604         (MemberCache.MemberCache): Update.
13605
13606 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13607
13608         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13609         variable.  This one is represents the actual low-level declaration
13610         of the method, as opposed to the semantic level `IsStatic'.   
13611
13612         An anonymous method which is hosted into a static method might be
13613         actually an instance method.  IsStatic would reflect the
13614         container, while MethodIsStatic represents the actual code
13615         generated.
13616
13617         * expression.cs (ParameterReference): Use the new MethodIsStatic
13618         instead of IsStatic.
13619
13620         * anonymous.cs (AnonymousMethod.Compatible): Pass the
13621         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13622         set on the current EmitContext. 
13623
13624         * expression.cs (Cast): Overload DoResolveLValue so we can pass
13625         resolve our casted expression as an LValue.  This triggers the
13626         proper LValue processing that is later required by Assign.
13627
13628         This fixes 72347.
13629
13630         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13631
13632 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
13633
13634         C# 2.0 Fixed buffer implementation
13635
13636         * anonymous.cs: Update after RegisterHelperClass renaming.
13637
13638         * attribute.cs (AttributeTester.fixed_buffer_cache):
13639         Cache of external fixed buffers.
13640         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13641         implementation if field is fixed buffer else null.
13642
13643         * class.cs
13644         (TypeContainer.AddField): Accept FieldMember instead of Field.
13645         (FieldBase.IsFieldClsCompliant): Extracted code from
13646         VerifyClsCompliance descendant customization.
13647         (FixedField): New class handles fixed buffer fields.
13648         (FixedFieldExternal): Keeps information about imported fixed
13649         buffer.
13650         (IFixedField): Make access to internal or external fixed buffer
13651         same.
13652
13653         * cs-parser.jay: Add fixed buffer parsing.
13654
13655         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13656         buffer.
13657
13658         * expression.cs (Indirection): Extended implementation to accept
13659         fixed buffer field.
13660         (PointerArithmetic.Emit): Get element from fixed buffer as well.
13661         (ElementAccess.MakePointerAccess): Get type as parameter.
13662         (DoResolve): Add fixed buffer field expression conversion.
13663         (DoResolveLValue): Ditto.
13664         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13665         (ArrayPtr): Derives from FixedBufferPtr.
13666         (ArrayPtr.Emit): Add extra emit for array elements.
13667
13668         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13669
13670         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13671         for compiler generated types.
13672         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13673
13674         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13675         and consume less memory.
13676         (Fixed.Resolve): Add fixed buffer case.
13677
13678         * typemanager.cs (compiler_generated_attr_ctor,
13679         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13680         (HasElementType): Add our own implementation to work on every
13681         runtime.
13682
13683 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13684
13685         * anonymous.cs (CaptureContext): Track whether `this' has been
13686         referenced.   
13687
13688         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13689         only captured `this' if it was implicitly done (instance
13690         methods/variables were used). 
13691
13692         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13693         `this' must be captured.
13694
13695 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13696  
13697         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13698         is null it means that there has been no need to capture anything,
13699         so we just create a sibling.
13700
13701         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13702
13703         Just a partial fix.  The other half is fairly elusive.
13704         
13705 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13706
13707         Fix #52586, cs0121-4.cs.
13708         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13709         and return a hashtable.
13710         (MemberCache.ClearDeclaredOnly): New.
13711         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13712         the method_hash of a base type too.
13713         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13714         type methods.  Overwrite entries with the same MethodHandle so
13715         that the ReflectedType is correct.  The process leaves in base
13716         virtual functions and their overrides as distinct entries.
13717         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13718         matters since it was boxed in a ArrayList before.
13719         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13720         modifier.
13721         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13722         case of a virtual function and its override (choose the overload
13723         as better).
13724         (Invocation.OverloadResolve): Avoid 'override' members during
13725         'applicable_type' calculation.
13726
13727 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13728
13729         Combine two near-redundant caches.
13730         * typemanager.cs (method_params): Rename from method_internal_params.
13731         (TypeManager.GetParameterData): New.  Replace
13732         Invocation.GetParameterData.
13733         (TypeManager.LookupParametersByBuilder): Remove.
13734         * expression.cs (Invocation.method_parameter_cache): Remove.
13735         (Invocation.GetParameterData): Remove.
13736         Update to changes.
13737         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13738         Update to changes.
13739
13740 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13741
13742         Fix #72015.
13743         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13744         TypeManager.multicast_delegate_type is null, resolve it by looking
13745         up "System.MulticastDelegate".
13746         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13747
13748 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13749             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13750             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13751
13752         Fix cs0164.cs.
13753         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13754         (LabeledStatement.AddReference): New.  Set 'referenced'.
13755         (Goto.Resolve): Use it.
13756
13757 2005-02-05  John Luke  <john.luke@gmail.com>
13758
13759         * driver.cs: remove duplicate -doc line in Usage ()
13760
13761 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13762
13763         * location.cs (Location.AddFile): Fix CS2002 error report.
13764
13765 2005-02-02  Martin Baulig  <martin@ximian.com>
13766
13767         * delegate.cs (Delegate.DefineType): Report an internal error if
13768         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13769         details.        
13770
13771 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13772
13773         Fix a crasher in a variant of #31984.
13774         * const.cs (Constant.CheckBase): New override that defers the
13775         new-or-override check in case the base type hasn't been populated
13776         yet.
13777         (Constant.Define): Ensure the new-or-override check is performed.
13778
13779 2005-02-01  Duncan Mak  <duncan@ximian.com>
13780
13781         * const.cs (LookupConstantValue): Check that `ce' is not null
13782         before calling GetValue ().
13783
13784 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13785
13786         Fix test-334.cs (#69519).
13787         * cs-parser.jay (using_alias_directive): Pass in an expression to
13788         NamespaceEntry.UsingAlias.
13789         (using_namespace_directive): Pass in an expression to
13790         NamespaceEntry.Using.
13791         (namespace_name): Don't flatten to a string.
13792         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13793         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13794         ResolveAsTypeStep.
13795         (NamespaceEntry.UsingEntry): Likewise.
13796         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13797         changes.
13798         (NamespaceEntry.LookupForUsing): Remove.
13799         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13800         names.
13801         (NamespaceEntry.Lookup): Remove support for dotted names.
13802
13803 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13804
13805         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13806         split into two.
13807         (NamespaceEntry.ImplicitParent): Compute on demand.
13808         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13809         parallels the current.
13810         (NamespaceEntry.LookupForUsing): Use it.
13811         (NamespaceEntry.Lookup): If the current namespace-entry is
13812         implicit, don't search aliases and using tables.
13813
13814 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13815
13816         Fix #31984.
13817         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13818         BaseCache here.
13819         (TypeContainer.BaseCache): Compute on demand.
13820         (TypeContainer.FindMembers): Define constants and types if they're
13821         not already created.
13822         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13823         check.
13824         * const.cs (Constant.Define): Make idempotent.
13825
13826 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13827
13828         * pending.cs: Produce better code (no nops produced by using Ldarg
13829         + value).
13830         
13831         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13832         i - 1' it should be arg + 1.
13833
13834         Fixes bug #71819.
13835
13836 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13837
13838         * attribute.cs (Attribute.CheckAttributeType): Make private
13839         non-virtual.
13840         (Attribute.ResolveType): Make virtual.
13841         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13842         handling of RootContext.Tree.Types.
13843
13844 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13845
13846         Update attribute-handling to use the SimpleName/MemberAccess
13847         mechanisms.
13848         * cs-parser.jay (attribute): Pass in an expression to the
13849         constructors of Attribute and GlobalAttribute.
13850         * attribute.cs (Attribute): Take an expression for the name.
13851         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13852         passed in attribute name expression.
13853         (Attribute.CheckAttributeType): Use it.
13854         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13855         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13856         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13857         argument to prevent error messages if the lookup fails.
13858
13859 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13860
13861         * expression.cs (Indirection): Implemented IVariable interface
13862         to support indirection in AddressOf operator.
13863         (PointerArithmetic.Emit): Add optimalization for case where
13864         result can be precomputed.
13865
13866 2005-01-26  Martin Baulig  <martin@ximian.com>
13867
13868         * class.cs (TypeContainer.AttributeTargets): Return the correct
13869         AttributeTargets depending on our `Kind' instead of throwing an
13870         exception; fixes #71632.
13871
13872 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13873
13874         Fix #71257
13875         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13876         constant members.
13877
13878 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13879
13880         Fix #71602.
13881         * expression.cs (MemberAccess.DoResolve): Don't complain with
13882         cs0572 when the LHS of a member access has identical name and type
13883         name.
13884
13885 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13886
13887         Fix #71651, #71675
13888         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13889         CreatePermission.
13890         Create custom PermissionSet only for PermissionSetAttribute.
13891
13892 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13893
13894         Fix #71649
13895         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13896         delegates in static class.
13897
13898 2005-01-24  Martin Baulig  <martin@ximian.com>
13899
13900         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13901         merging an implicit block, just use its reachability.
13902
13903         * statement.cs (Block.Resolve): Make the unreachable code check
13904         work wrt. implicit blocks; see test-337 from #63842.
13905
13906 2005-01-21  Alp Toker  <alp@atoker.com>
13907  
13908         * cs-parser.jay: destructor_declaration's container is PartialContainer
13909         not Class when partial types are used, so use Kind prop instead of
13910         'is'.
13911         
13912 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * cs-parser.jay: Improve error reporting when an interface
13915         declares new types.
13916
13917 2005-01-20  Dick Porter  <dick@ximian.com>
13918
13919         * support.cs: SeekableStreamReader fix from Sandor Dobos
13920         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13921         chars are read.  Fixes bug 70369.
13922
13923 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13924
13925         * cs-parser.jay (catch_clause): Simplify current_block handling
13926         somewhat.
13927
13928 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13929
13930         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13931         code with ImplicitStandardConversion to handle the implicit
13932         conversion of method groups into valid delegate invocations. 
13933
13934         The problem is that in parameter handling we were using this code
13935         path.  Fixes bug #64698
13936
13937 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13938
13939         * cs-parser.jay: Fix several infelicities.
13940         - Avoid assigning to the parser value stack.  Code like 
13941           '$3 = null' is unclean.  Synthesize a value for the code block
13942           instead. 
13943         - Avoid using oob_stack for storing location information.  Use ...
13944         (_mark_): ... this.  New (empty) rule.  Saves the current location
13945         in $$.
13946         (foreach_statement): Avoid using oob_stack for current_block
13947         handling.  Use technique used in for_statement and
13948         using_statement.  Synthesize a value for the code block to store
13949         additional intermediate information.
13950
13951 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13952
13953         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13954         of a different type is only allowed to private fields of a
13955         containing type, not on fields of a base class.
13956
13957         See test-174.cs and error cs0122-9.cs
13958
13959 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13960
13961         Fix test-335.cs (bug #58126).
13962         * cs-parser.jay (argument): Split out non-expression parts of the
13963         rule into 'non_simple_argument'.
13964         (invocation_expression): Support parenthesized invocations with
13965         multiple arguments, and with single non-simple arguments.
13966
13967 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13968
13969         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13970         places.
13971
13972 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13973
13974         Fix cs0038-1.cs, cs1640-6.cs.
13975         * ecore.cs (Expression.Resolve): Remove special-case for
13976         SimpleName in error-handling.
13977         (Expression.almostMatchedMembers): Relax access permission to
13978         protected.
13979         (Expression.MemberLookupFailed): Handle duplicates in
13980         almostMatchedMembers list.
13981         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13982         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13983         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13984         overload if the passed in MemberInfo is a MethodBase.
13985
13986 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13987
13988         Fix #70749
13989         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13990         for non-CAS & merge permission sets properly.
13991
13992 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13993
13994         Improve standard-compliance of simple name and member access 
13995         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13996         * ecore.cs (FullNamedExpression): New abstract base class 
13997         for Namespaces and TypeExpressions.
13998         (ResolveFlags.SimpleName): Remove.
13999         (SimpleName): Remove support for dotted names.
14000         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
14001         DeclSpace.FindType and DeclSpace.LookupType.
14002         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
14003         (Expression.ExprClassName): Make member function.
14004         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
14005         a namespace.  Remove creation of dotted "SimpleName"s.
14006         (MemberAccess.DoResolve): Likewise.
14007         * decl.cs (DeclSpace.Cache): Make private.
14008         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
14009         (DeclSpace.FindType): Update.
14010         (DeclSpace.LookupType): Move here from RootContext.  Return a 
14011         FullNamedExpression.
14012         * namespace.cs (Namespace): Derive from FullNamedExpression
14013         so that it can be part of expression resolution.
14014         (Namespace.Lookup): Return an FullNamedExpression.
14015         (NamespaceEntry.LookupAlias): Lookup aliases only in current
14016         namespace.
14017         * rootcontext.cs (NamespaceLookup): Remove.
14018         (LookupType): Move to DeclSpace.
14019         * attribute.cs (CheckAttributeType): Update.
14020         * doc.cs (FindDocumentedType): Remove allowAlias argument.
14021         (FindDocumentedTypeNonArray): Likewise.
14022
14023 2005-01-11  Raja R Harinath  <rharinath@novell.com>
14024
14025         Fix cs0509.cs, cs1632.cs.
14026         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
14027         is the same as IsInterface.
14028         (TypeContainer.GetClassBases): Likewise.
14029         * statement.cs (LabeledStatement.ig): New field.
14030         (LabeledStatement.LabelTarget): Save ILGenerator which created the
14031         label.
14032         (LabeledStatement.DoEmit): Check that the label was created with
14033         the same ILGenerator.
14034
14035 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
14036
14037         Fix #71058
14038         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
14039         accessors to its properties.
14040
14041         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
14042         from accessors to property.
14043         
14044 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
14045
14046         Fix #70722
14047         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
14048         only for overrides.
14049         
14050 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
14051
14052         * attribute.cs: Check for null and empty strings.  
14053
14054         I have lost another battle to Paolo.
14055
14056 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
14057
14058         Fix #70942
14059         * class.cs (PropertyMethod): Set Parent field in ctors.
14060         (SetMethod.InternalParameters): Add unsafe switch hack.
14061         Override MarkForDuplicationCheck where it is appropriate.
14062
14063         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
14064         It says whether container allows members with the same name.
14065         Base default is no.
14066         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
14067         Removed is_method parameter.
14068
14069 2005-01-06  Duncan Mak  <duncan@ximian.com>
14070
14071         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
14072         because the previous change led to incorrect reporting of CS1032
14073         ("Cannot define/undefine preprocessor symbols after first token in
14074         file"). Instead of using `tokens_seen' as the only flag that
14075         triggers CS1040, introduce `comments_seen'. This new flag is used
14076         to signify having seen comments on the current line, so it is
14077         unset after a newline.
14078
14079 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
14080
14081         * doc.cs : When searching for a type, find nested type too.
14082           This fixes bug #71040.
14083
14084 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
14085
14086         * doc.cs :
14087           - Warn missing member comment on those classes which also does not
14088             have doc comments. Fixed bug #71041.
14089           - Don't warn missing doc comment on default constructor.
14090             Fixed bug #71042.
14091
14092 2005-01-06  Duncan Mak  <duncan@ximian.com>
14093
14094         * cs-tokenizer.cs (xtoken): After handling traditional C-style
14095         comments, set `tokens_seen' to true. This allows us to detect
14096         misplaced preprocessor directives (i.e. not at the beginning of
14097         the a line, nor after whitespaces). In that case, report error
14098         CS1040. This fixes bug #56460.
14099
14100         * cs-parser.jay (interface_member_declaration): Add checks for
14101         IsExplicitImpl, and report CS0541 error if an interface member is
14102         defined as an explicit interface declaration.
14103
14104 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
14105
14106         Fix #70817
14107         * class.cs (PropertyMethod): Set Parent field in ctors.
14108         (SetMethod.InternalParameters): Add unsafe switch hack.
14109         
14110         * decl.cs (MemberCore.Parent): Cannot be readonly.
14111
14112 2005-01-06  Raja R Harinath  <rharinath@novell.com>
14113
14114         * decl.cs (DeclSpace.ResolveType): Remove.
14115         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14116         Merge in code from ...
14117         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
14118         * class.cs, enum.cs: Update to changes.
14119
14120 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * anonymous.cs: Ensure that we init the scope of our parent if it
14123         has not been initialized yet.
14124
14125 2004-12-30  Duncan Mak  <duncan@ximian.com>
14126
14127         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14128         if field.FieldBuilder is null. Fixes #70758.
14129
14130         * convert.cs: Fixed some typos and updated some of the comments.
14131         (ImplicitStandardConversionExists):
14132         (TryImplicitIntConversion): If `target_type' is an interface and
14133         the type of `ic' implements this interface, return true or a new
14134         BoxedCast instead of null. This fixes #70468.
14135
14136 2004-12-29  Duncan Mak  <duncan@ximian.com>
14137
14138         * expression.cs (Argument.Emit): Check that Expr is
14139         IMemoryLocation before casting to it, and report CS1510 otherwise.
14140
14141         This fixes #70402.
14142
14143 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
14144
14145         * statement.cs (Block.ThisVariable): remove the recursion here, to
14146         make the --profile more sane.
14147
14148 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
14149
14150         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14151         assembly, by JB Evain.
14152
14153 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14154
14155         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
14156           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14157         "parent" refers to enclosing type/class.  "base" refers to superclass.
14158
14159 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14160
14161         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14162         Ensure that we only have GlobalAttributes.
14163         * attribute.cs (Attribute.Emit): Make non-virtual.
14164         (GlobalAttribute.Emit): Remove.
14165         (Attribute.Resolve): Make virtual.
14166         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
14167         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14168         the argument. Don't create one.
14169         (Attribute.GetObsoleteAttribute): Likewise.
14170         (Attribute.GetClsCompliantAttributeValue): Likewise.
14171         * class.cs, decl.cs: Update to changes.
14172
14173 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
14174
14175         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14176         
14177         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14178         
14179         * statement.cs (Foreach.Resolve): Add error 186 report.
14180
14181 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
14182
14183         * expression.cs (Conditional.DoResolve): Add warning 429.
14184         
14185         * statement.cs (If.Resolve): Add warning 665.
14186
14187 2004-12-16  Raja R Harinath  <rharinath@novell.com>
14188
14189         New invariant: RootContext.Tree.Types.NamespaceEntry == null
14190         except when in the parser, and in GlobalAttribute.
14191         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14192         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14193         RootContext.Tree.Types.NamespaceEntry once work is done.
14194         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
14195         and resets RootContext.Tree.Types.NamespaceEntry.
14196
14197 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
14198
14199         * cs-parser.jay: Don't create a block for every variable.
14200
14201 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
14202
14203         * location.cs: Provide extra information.
14204
14205         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14206         variables from the captured environment, it is the ldarg_0.
14207
14208 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14209
14210         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14211         find a conclusion.
14212         
14213         * class.cs: Changed warning level for 169 to avoid developer
14214         displeasure from warning flooding. It will be changed back when they
14215         fix most of current BCL warnings.
14216         
14217         * RootContext.cs: Pushed default WarningLevel to 3.
14218         
14219         * statement.cs: Removed unused variable.
14220
14221 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14222
14223         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14224         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14225         Add error 502 report.
14226         (StaticClass.DefineType): Add error 441 report.
14227         (Class.AllowedModifiersProp): New virtual property as temporary
14228         extension to AllowedModifiers.
14229         (Class.DefineType): Add error 418 report. Moved ModFlags check here
14230         to share implementation with StaticClass and don't call virtual
14231         methods from ctor.
14232         
14233         * driver.cs (MainDriver): Add error 1558 test.
14234
14235         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14236         report. Moved error 36 test here.
14237
14238         * statement.cs (Throw.Resolve): Add error 724 report.
14239
14240         * typemanager.cs: Add out_attribute_type core type.
14241         
14242 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
14243
14244         * class.cs (TypeContainer.VerifyClsCompliance): Add error
14245         3018 report.
14246         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14247
14248         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14249         3017 report.
14250         
14251         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14252
14253         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
14254         Add error 3023 report.
14255         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14256
14257         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14258         implementation.
14259
14260 2004-12-12  John Luke  <john.luke@gmail.com>
14261
14262         * driver.cs (AddArgs): take -- into account when
14263         adding arguments, fixes bug 65710 
14264
14265 2004-12-12  Martin Baulig  <martin@ximian.com>
14266
14267         * expression.cs (Unary.TryReduceNegative): Added support for
14268         SByteConstant and ByteConstant.
14269         (Unary.Reduce): Check error values from TryReduceNegative().
14270
14271 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
14272
14273         * attributes.cs (Attribute.Resolve): Avoid multiple error report
14274         and report exception as error 182.
14275
14276 2004-12-10  Raja R Harinath  <rharinath@novell.com>
14277
14278         * driver.cs (Main): Fix message when there are warnings.
14279
14280 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
14281
14282         * delegate.cs: Fixed my fix from yesterday, sorry about that.
14283
14284 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
14285
14286         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
14287         Reduced number of warnings.
14288         
14289         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14290
14291 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
14292
14293         * driver.cs: Removed message.
14294
14295         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14296
14297 2004-12-08    <vargaz@freemail.hu>
14298
14299         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14300
14301 2004-12-08  Martin Baulig  <martin@ximian.com>
14302
14303         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14304         instead of a CS3002 for properties and indexer.
14305
14306 2004-12-08  Martin Baulig  <martin@ximian.com>
14307
14308         * decl.cs (MemberName.ToString): Make this work again.
14309
14310 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
14311
14312         * attribute.cs (Resolve): Add error 591 detection.
14313
14314         * class.cs (FieldMember.Define): Add error 1547 detection.
14315         (Indexer.Define): Add error 620 detection.
14316         (Operator.Define): Add error 590 detection.
14317
14318         * ecore.cs: Missing argument for error 79.
14319
14320         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14321         detection.
14322
14323 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
14324
14325         Fix #70106
14326         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14327         only.
14328
14329 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
14330
14331         * cs-parser.jay : handle doc comments on implicit/explicit operators.
14332           Some operator comments were suppressed.
14333         * doc.cs : Implicit/explicit operator name in doc comments are like
14334           "op_Explicit(type)~returnType", so added suffix handling.
14335
14336 2004-12-07  Martin Baulig  <martin@ximian.com>
14337
14338         * decl.cs
14339         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14340         (MemberCore.GetClsCompliantAttributeValue): Likewise.
14341         (DeclSpace.ec): New protected field; store the EmitContext here.
14342         (DeclSpace.EmitContext): New public property; moved here from
14343         `TypeContainer'.
14344         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14345         EmitContext.
14346
14347         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14348         (Enum.Emit): Don't create a new EmitContext.
14349
14350         * delegate.cs (Delegate.DefineType): Always create the
14351         EmitContext.
14352
14353         * iterators.cs (Iterators.DefineIterator): Create a new
14354         EmitContext and store it in `ec'.
14355
14356 2004-08-24  Martin Baulig  <martin@ximian.com>
14357
14358         * typemanager.cs
14359         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14360         this for accessibility checks.
14361         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14362         IsNestedFamilyAccessible.
14363         (TypeManager.IsSubclassOf): New method, do what the name actually
14364         says.   
14365
14366 2004-12-06  Raja R Harinath  <rharinath@novell.com>
14367
14368         Fix crash on cs0657-17.cs.
14369         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14370         Use RootContext.Tree.Types, not 'new RootTypes ()'.
14371         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14372         the case where the NamespaceEntry gets overwritten.
14373
14374 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
14375
14376         Fixed #69195, #56821
14377         * ecore.cs (ResolveBoolean): Tiny refactoring.
14378
14379         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14380         of right expression resolving when left is false constant and
14381         operator is LogicalAnd OR true constant and operator is LogicalOr.
14382
14383         * statement.cs (ResolveUnreachable): Always reports warning.
14384
14385 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * class.cs: Distinguish between 1721 and 1722 (just a little help
14388         for the programmer).
14389
14390 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
14391
14392         * delegate.cs: Only allow this on new versions of the language. 
14393
14394 2004-12-02  Duncan Mak  <duncan@ximian.com>
14395
14396         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14397         Expression class.
14398         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14399         here as a static method. Take an additional bool out parameter
14400         `must_do_cs1540_check' for signaling to InstanceResolve.
14401         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14402         member field from PropertyExpr class and made it an argument of
14403         the method instead.
14404         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14405         check for MarshalByRefObject, and report CS0122 instead of CS1540.
14406         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14407         and `remove_accessor' as well as InstanceResolve: report CS0122
14408         where applicable.
14409
14410         Fixes #70129.
14411
14412 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14413
14414         Fix test-327.cs, test-328.cs, and put in early infrastructure
14415         for eventually fixing #52697.
14416         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14417         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14418         from other methods.
14419         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14420         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14421         (VerifyUsing, error246): Update.
14422         * rootcontext.cs (RootContext.NamespaceLookup): Just use
14423         'NamespaceEntry.LookupNamespaceOrType'.
14424
14425 2004-12-03  Martin Baulig  <martin@ximian.com>
14426
14427         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14428         method as our child, call AnonymousMethod.Compatible() on it.
14429
14430 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14431
14432         Disable XML documentation support in 'basic' profile.
14433         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14434         Redirect XmlElement to System.Object.
14435         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14436         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14437         * mcs.exe.sources: Add doc-bootstrap.cs.
14438         * doc-bootstrap.cs: New file.  Contains empty stub implementation
14439         of doc.cs.
14440
14441 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
14442
14443         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14444           comments are allowed.
14445
14446 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14447
14448         * delegate.cs: Add checks for subtypes in paramaters and return values
14449         in VerifyMethod () to add support for Covariance/Contravariance
14450         in delegates.
14451         
14452 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
14453
14454         * report.cs: Remove extra closing parenthesis.
14455
14456         * convert.cs (Error_CannotImplicitConversion): If the name of the
14457         types are the same, provide some extra information.
14458
14459         * class.cs (FieldBase): Use an unused bit field from the field to
14460         encode the `has_offset' property from the FieldMember.  This saves
14461         a couple of Ks on bootstrap compilation.
14462
14463         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14464         method as our child, return the AnonymousMethod resolved
14465         expression.
14466
14467         * expression.cs (New.DoResolve): Allow return values from
14468         NewDelegate to also include AnonymousMethods.
14469
14470         Fixes #70150.
14471
14472 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
14473
14474         Fix bug #70102
14475         * attribute.cs (Resolve): Improved implementation of params
14476         attribute arguments.
14477
14478         * support.cs (ParameterData): Add HasParams to be faster.
14479
14480 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
14481
14482         all things are for /doc support:
14483
14484         * doc.cs: new file that supports XML documentation generation.
14485         * mcs.exe.sources: added doc.cs.
14486         * driver.cs:
14487           Handle /doc command line option.
14488           Report error 2006 instead of 5 for missing file name for /doc.
14489           Generate XML documentation when required, after type resolution.
14490         * cs-tokenizer.cs:
14491           Added support for picking up documentation (/// and /** ... */),
14492           including a new XmlCommentState enumeration.
14493         * cs-parser.jay:
14494           Added lines to fill Documentation element for field, constant,
14495           property, indexer, method, constructor, destructor, operator, event
14496           and class, struct, interface, delegate, enum.
14497           Added lines to warn incorrect comment.
14498         * rootcontext.cs :
14499           Added Documentation field (passed only when /doc was specified).
14500         * decl.cs:
14501           Added DocComment, DocCommentHeader, GenerateDocComment() and
14502           OnGenerateDocComment() and some supporting private members for
14503           /doc feature to MemberCore.
14504         * class.cs:
14505           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14506         * delegate.cs:
14507           Added overriden DocCommentHeader.
14508         * enum.cs:
14509           Added overriden DocCommentHeader and GenerateDocComment().
14510
14511 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
14512
14513         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14514         unwrapping the enumeration values, chain to
14515         DoConstantNumericPromotions again, so we can promote things to the
14516         fundamental types (takes care of enums that are bytes, sbytes).
14517
14518         Fixes bug #62054.
14519
14520 2004-12-01  Raja R Harinath  <rharinath@novell.com>
14521
14522         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14523         Fix long-standing bug in type-lookup.  Use FindType instead of
14524         LookupType when ec.ResolvingTypeTree.
14525         (Attribute.ResolveType, Attribute.Resolve)
14526         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14527         Update to changes.
14528         (Attributes.Search): Remove internal version.  Update.
14529         (Attributes.SearchMulti): Update.
14530         (Attributes.GetClsCompliantAttribute): Remove.
14531         (Attributes.GetIndexerNameAttribute): Remove.
14532         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14533         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14534         * class.cs (Indexer.Define): Likewise.
14535
14536 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
14537
14538         Fix bug #68790
14539         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14540         MarshallByReference members access.
14541
14542         * expression.cs: Use CheckMarshallByRefAccess;
14543         Better error CS0197 message.
14544
14545         * report.cs: Print whole related error message.
14546
14547 2004-11-30  Raja R Harinath  <rharinath@novell.com>
14548
14549         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14550         the current directory to help debugging.
14551
14552 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14553
14554         * class (GetClassBases): Better error 60 report.
14555         (EventProperty): Disabled warning 67 detection.
14556
14557 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14558
14559         Fix bug #60324
14560         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14561
14562         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14563         precise values.
14564
14565 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14566
14567         Fix bug #49488
14568         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14569
14570         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14571
14572 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
14573
14574         * attribute.cs (Attribute.Resolve): Refine error reporting and
14575         report a cs0117 if the identifier does not exist, to distinguish
14576         from 0617 which is a miss-use of the actual identifier.
14577
14578         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14579         between cs0070 and cs0079.
14580
14581         * class.cs (MemberBase.DoDefine): When reporting a wrong
14582         accessibility level, we use MethodCore to compare instead of
14583         Method (this was a regression in some refactoring effort).
14584
14585         So now we correctly report cs0056 again.
14586
14587         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14588         testing the target_type (which was known to be object_type) and
14589         not the source type (which is anonymous_method).
14590
14591         Fixed reporting of error cs1660.
14592
14593         * expression.cs (UserCast.Source): Expose the underlying cast.
14594
14595         * statement.cs (Switch.SwitchGoverningType): Sort the list of
14596         allowed types to find a match to int32 first (most common).
14597
14598         In addition, it ignores any ImplicitUserConversions that did an
14599         internal implicit conversion (as the switch statement allows only
14600         one integral conversion to exist).
14601
14602         * class.cs (PartialContainer.Create): rename `name' to
14603         `member_name' for clarity.  Then replace the string calls with a
14604         call to MemberName.GetPartialName, as now using
14605         MemberName.ToString is an error (this is due to the side effects
14606         it had, that were fixed in the past).
14607
14608         This will restore the error reporting on a number of partial class
14609         errors that were missusing this (and getting an exception as a
14610         results, which is now just a plain textual warning, because
14611         yyparse debug output would crash otherwise).
14612
14613 2004-11-26  Raja R Harinath  <rharinath@novell.com>
14614
14615         * Makefile (PROGRAM_INSTALL_DIR): Remove.
14616
14617 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14618
14619         * rootcontext.cs (LookupType): Make sure to cache lookups that
14620         don't give us a negative result. This saves about 5% of corlib
14621         compilation time.
14622
14623 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * report.cs (AbstractMessage.Print): messages are sent to stderr
14626
14627         * class.cs (TypeContainer.GetClassBases): It is an error to have a
14628         non-interface in the list of interfaces (at this point, either
14629         parent was properly set, or a base class is being listed in the
14630         interfaces section).
14631
14632         This flags error 1722, and resolves the crash from bug 69259.
14633
14634 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14635
14636         * statement.cs (Using.EmitExpressionFinally): make this work right
14637         for valuetypes. Fixes 69926.
14638
14639 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14640
14641         * const.cs (Const.ChangeType): Cope with the "0 literal can be
14642         converted to an enum" here, before we try to change the underlying
14643         type.  This code exists, but it is a different code path than the
14644         one used while encoding constants.
14645
14646         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14647         old bug: when converting from the null literal to a pointer,
14648         return an EmptyCast, not the NullLiteral.
14649
14650         This fixes #69921, the recent null_type changes probably made this
14651         bug more prominent.
14652
14653         (ImplicitReferenceConversionExists): In addition, resynchronized
14654         the code here, so it matches the same code in
14655         ImplicitReferenceConversionExists for the `from any class-type S
14656         to any interface-type T'.
14657         
14658
14659 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
14660
14661         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14662
14663 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
14664
14665         * cs-parser.jay: Use verbosity accordingly. 
14666
14667 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14668
14669         * expression.cs (Unary.ResolveOperator): Do not report warning;
14670         AddressOf reads from variable.
14671         
14672         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14673
14674 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14675
14676         Fix bug #69462
14677
14678         * attribute.cs (Attributable): Removed CheckTargets.
14679         (Attributes.Emit): Explicit attribute targets are tested here.
14680
14681         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14682         not enabled for interfaces.
14683
14684         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14685         (GetAssemblyName): Ouch next bug there.
14686
14687 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14688
14689         * expression.cs: Error 275 added.
14690         
14691 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14692
14693         Fix bug #69177 (Implemented decimal constant support)
14694
14695         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14696         (BinaryFold): Add DecimalConstant.
14697
14698         * const.cs (Define): Decimal constant 
14699         (is not constant.
14700         (ChangeType): Add decimal type handling.
14701         (LookupConstantValue): Don't set value for decimal type but
14702         emit DecimalConstantAttribute. Needed for constant optimization.
14703
14704         * constant.cs (ToDecimal): New method.
14705         (ConvertToDecimal): New method.
14706         (IntConstant): Implemented ConvertToDecimal.
14707         (DecimalConstant.Emit): Emit optimized version for decimals in
14708         int range.
14709
14710         * expression.cs (ResolveOperator): Changed order of constant
14711         reduction to work correctly with native types which have
14712         overloaded operators.
14713         (ResolveMemberAccess): Extract constant value from attribute
14714         for decimal type.
14715
14716         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14717
14718         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14719         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14720         (ChangeType): Decimal is special.
14721         (TypeToCoreType): Add decimal type.
14722
14723 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14724
14725         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14726         decimal types.
14727
14728 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14729
14730         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14731         test cs1667-5.cs.
14732
14733 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14734
14735         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14736
14737         * pending.cs (PendingImplementation): Grab only interfaces.
14738
14739 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14740
14741         * statement.cs (ForeachHelperMethods): Add location member and
14742         error 202 detection.
14743
14744 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14745
14746         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14747         automatically handled by executable.make.
14748         (PROGRAM): Make profile-specific.
14749
14750 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14751
14752         * expression.cs (DoResolveBase): Fixed wrong warning for out
14753         variables.
14754
14755 2004-11-18  Martin Baulig  <martin@ximian.com>
14756
14757         Merged latest changes into gmcs.  Please keep this comment in
14758         here, it makes it easier for me to see what changed in MCS since
14759         the last time I merged.
14760
14761 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14762
14763         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14764         (TypeHandle.GetMemberCache): New.
14765         (TypeHandle.TypeHandle): Update.
14766         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14767         (TypeManager.LookupParentInterfacesCache):
14768         Rename from LookupInterfaceCache.  Optimize slightly.
14769         (TypeManager.MemberLookup_FindMembers): Update.
14770         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14771         multi-type variant.
14772         (AddCacheContents): Rename from AddHashtable.
14773         * class.cs (TypeContainer.parent_container): Remove.
14774         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14775         (TypeContainer.DoDefineMembers): Don't initialize it.
14776         Update to name changes.
14777         
14778 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14779
14780         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14781         that factors the code to check access modifiers on override.  
14782
14783         (PropertyBase): Use the code here.
14784
14785         Patch from Lluis S'anchez, fixes bug #69361.
14786
14787 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14790         routine that is used to report the use of a captured variable
14791         whose address has been taken.
14792
14793         There are two checks: one when variables are being captured and
14794         the other check is when the address of a variable is taken. 
14795         
14796         (because an anonymous methods might be resolved before *or* after
14797         the address has been taken) and 
14798
14799         * expression.cs (Conditional.DoResolve): Remove the special
14800         casing that Martin added to trueExpr and falseExpr being both
14801         NullLiteral.  We get the right behavior now just by introducing
14802         the null_type into the compiler. 
14803
14804         * convert.cs (ExplicitConversion): Change the code to use
14805         null_type instead of testing `expr is NullLiteral'.
14806         (ImplicitConversionStandard): use null_type too.
14807         (ImplicitReferenceConversionExists): use null_type too.
14808         (ImplicitReferenceConversion): use null_type too.
14809
14810         * literal.cs: The type of `NullLiteral' is now null_type instead
14811         of object_type. 
14812         (Resolve): Set the type here.
14813
14814         * typemanager.cs: Introduce null_type.
14815
14816 2004-11-17  Martin Baulig  <martin@ximian.com>
14817
14818         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14819         direction, like FindMembers() does.  Fixes #69546, testcase is in
14820         test-315.cs.    
14821
14822 2004-11-16  Martin Baulig  <martin@ximian.com>
14823
14824         This is based on a patch from Marek Safar, see bug #69082.
14825         Fixes bugs #63705 and #67130.
14826
14827         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14828         method; create a MemberCache for an interface type and cache the
14829         result.
14830
14831         * decl.cs (IMemberContainer.ParentContainer): Removed.
14832         (IMemberContainer.ParentCache): New property.
14833         (MemberCache.SetupCacheForInterface): Removed.
14834         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14835         to create a cache for an interface's "parent".
14836
14837         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14838         interfaces too.
14839
14840 2004-11-16  Martin Baulig  <martin@ximian.com>
14841
14842         Merged back from gmcs; these changes already went into gmcs a
14843         couple of weeks ago.
14844
14845         * typemanager.cs
14846         (TypeManager.AddUserType): Removed the `ifaces' argument.
14847         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14848         `TypeExpr []'.
14849         (TypeManager.AddUserInterface): Removed.
14850         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14851         `TypeExpr []'.
14852         (TypeManager.GetInterfaces): Likewise.
14853         (TypeManager.GetExplicitInterfaces): Likewise.
14854
14855         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14856
14857         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14858         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14859
14860 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14861
14862         * statement.cs: Avoid adding bools to a hashtable.
14863
14864 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14865
14866         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14867         calling an unsafe method from a safe location.
14868
14869 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14870
14871         Fix #69167
14872         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14873
14874 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14875
14876         * namespace.cs (VerifyUsing): use GetPartialName instead of
14877         ToString. 
14878
14879 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14880
14881         * statement.cs (Return.Resolve): Fix regression in typo: if
14882         `in_exc', we have to request a NeedReturnLabel, this was a typo
14883         introduced in the anonymous method check-in.  Fixes #69131.
14884
14885         * Indexers were using the ShortName when defining themselves,
14886         causing a regression in the compiler bootstrap when applying the
14887         patch from 2004-11-02 (first part), now they use their full name
14888         and the bug is gone.
14889
14890 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14891
14892         * driver.cs: Strip the path from the names of embedded resources. Fixes
14893         #68519.
14894
14895 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14896
14897         Fix error message regression: cs0104-2.cs.
14898         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14899         (AliasEntry.Resolve): Update.
14900         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14901         'silent' flag.
14902         (RootContext.LookupType): Update.
14903
14904 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14905
14906         * cs-parser.jay: Add support for handling accessor modifiers
14907         * class: Add support port accessor modifiers and error checking,
14908         define PropertyMethod.Define as virtual (not abstract anymore)
14909         * ecore.cs: Add checking for proeprties access with access modifiers
14910         * iterators.cs: Modify Accessor constructor call based in the modified
14911         constructor
14912 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14913
14914         * expression.cs (StringConcat): Handle being called twice,
14915         as when we have a concat in a field init with more than two
14916         ctors in the class
14917
14918 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14919
14920         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14921         special case explicit implementations, we should always produce
14922         the .property or .event declaration.
14923         
14924         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14925         since it will not return correct data if people use this
14926         unresolved in the presence of using statements (see test-313).
14927
14928         * class.cs (MethodData.Define): If we are an explicit interface
14929         implementation, set the method name to the full name of the
14930         interface plus the name of the method.  
14931
14932         Notice that using the method.MethodName.GetFullName() does not
14933         work, as it will only contain the name as declared on the source
14934         file (it can be a shorthand in the presence of using statements)
14935         and not the fully qualifed type name, for example:
14936
14937         using System;
14938
14939         class D : ICloneable {
14940                 object ICloneable.Clone ()  {
14941                 }
14942         }
14943
14944         Would produce a method called `ICloneable.Clone' instead of
14945         `System.ICloneable.Clone'.
14946
14947         * namespace.cs (Alias.Resolve): Use GetPartialName.
14948         
14949 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14950
14951         * cs-parser.jay: Add error 1055 report.
14952
14953 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * assign.cs (Assign.DoResolve): Only do the transform of
14956         assignment into a New if the types are compatible, if not, fall
14957         through and let the implicit code deal with the errors and with
14958         the necessary conversions. 
14959
14960 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14961
14962         * cs-parser.jay: Add error 1031 report.
14963
14964         * cs-tokenizer.cs: Add location for error 1038.
14965
14966 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14967
14968         * cs-parser.jay: Add error 1016 report.
14969
14970 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14971
14972         * cs-parser.jay: Add errors 1575,1611 report.
14973
14974 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14975
14976         * cs-parser.jay: Add error 1001 report.
14977
14978 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14979
14980         Fix #68850
14981         * attribute.cs (GetMarshal): Add method argument for
14982         caller identification.
14983
14984         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14985         agument for GetMarshal and RuntimeMissingSupport.
14986
14987 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14988
14989         * attribute.cs (ExtractSecurityPermissionSet): Removed
14990         TypeManager.code_access_permission_type.
14991
14992         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14993
14994 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14995
14996         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14997         for obsolete use of a variable here.   Fixes regression on errors
14998         cs0619-25 and cs0619-26.
14999
15000 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
15001
15002         Fix #62358, implemented security attribute encoding.
15003
15004         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
15005         Tests permitted SecurityAction for assembly or other types.
15006         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
15007         data from SecurityPermissionAttribute to PermisionSet class.
15008
15009         * class.cs (ApplyAttributeBuilder): Added special handling
15010         for System.Security.Permissions.SecurityAttribute based types.
15011
15012         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
15013         special handling for System.Security.Permissions.SecurityAttribute
15014         based types.
15015
15016         * enum.cs (ApplyAttributeBuilder): Added special handling
15017         for System.Security.Permissions.SecurityAttribute based types.
15018
15019         * parameter.cs (ApplyAttributeBuilder): Added special handling
15020         for System.Security.Permissions.SecurityAttribute based types.
15021
15022         * rootcontext.cs: Next 2 core types.
15023
15024         * typemanager.cs (TypeManager.security_permission_attr_type):
15025         Built in type for the SecurityPermission Attribute.
15026         (code_access_permission_type): Build in type.
15027
15028 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
15029
15030         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
15031         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
15032         all of this information into
15033         EmitContext.EmitCapturedVariableInstance.
15034         
15035         * codegen.cs (EmitCapturedVariableInstance): move here the
15036         funcionality of emitting an ldarg.0 in the presence of a
15037         remapping.   This centralizes the instance emit code.
15038
15039         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
15040         then emit a load of this: it means that we have reached the
15041         topmost ScopeInfo: the one that contains the pointer to the
15042         instance of the class hosting the anonymous method.
15043
15044         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
15045         captures to the topmost CaptureContext.
15046
15047 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
15048
15049         * expression.cs (LocalVariableReference): Move the knowledge about
15050         the iterators into codegen's EmitCapturedVariableInstance.
15051
15052 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
15053
15054         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
15055         all code paths return a value from an anonymous method (it is the
15056         same as the 161 error, but for anonymous methods).
15057
15058 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
15059
15060         The introduction of anonymous methods in the compiler changed
15061         various ways of doing things in the compiler.  The most
15062         significant one is the hard split between the resolution phase
15063         and the emission phases of the compiler.
15064
15065         For instance, routines that referenced local variables no
15066         longer can safely create temporary variables during the
15067         resolution phase: they must do so from the emission phase,
15068         since the variable might have been "captured", hence access to
15069         it can not be done with the local-variable operations from the runtime.
15070         
15071         * statement.cs 
15072
15073         (Block.Flags): New flag `IsTopLevel' to indicate that this block
15074         is a toplevel block.
15075
15076         (ToplevelBlock): A new kind of Block, these are the blocks that
15077         are created by the parser for all toplevel method bodies.  These
15078         include methods, accessors and anonymous methods.
15079
15080         These contain some extra information not found in regular blocks:
15081         A pointer to an optional CaptureContext (for tracking captured
15082         local variables and parameters).  A pointer to the parent
15083         ToplevelBlock.
15084         
15085         (Return.Resolve): Catch missmatches when returning a value from an
15086         anonymous method (error 1662).
15087         Invoke NeedReturnLabel from the Resolve phase instead of the emit
15088         phase.
15089
15090         (Break.Resolve): ditto.
15091
15092         (SwitchLabel): instead of defining the labels during the
15093         resolution phase, we now turned the public ILLabel and ILLabelCode
15094         labels into methods called GetILLabelCode() and GetILLabel() that
15095         only define the label during the Emit phase.
15096
15097         (GotoCase): Track the SwitchLabel instead of the computed label
15098         (its contained therein).  Emit the code by using
15099         SwitchLabel.GetILLabelCode ().
15100
15101         (LocalInfo.Flags.Captured): A new flag has been introduce to track
15102         whether the Local has been captured or not.
15103
15104         (LocalInfo.IsCaptured): New property, used to tell whether the
15105         local has been captured.
15106         
15107         * anonymous.cs: Vastly updated to contain the anonymous method
15108         support.
15109
15110         The main classes here are: CaptureContext which tracks any
15111         captured information for a toplevel block and ScopeInfo used to
15112         track the activation frames for various local variables.   
15113
15114         Each toplevel block has an optional capture context associated
15115         with it.  When a method contains an anonymous method both the
15116         toplevel method and the anonymous method will create a capture
15117         context.   When variables or parameters are captured, they are
15118         recorded on the CaptureContext that owns them, for example:
15119
15120         void Demo () {
15121              int a;
15122              MyDelegate d = delegate {
15123                  a = 1;
15124              }
15125         }
15126
15127         Here `a' will be recorded as captured on the toplevel
15128         CapturedContext, the inner captured context will not have anything
15129         (it will only have data if local variables or parameters from it
15130         are captured in a nested anonymous method.
15131
15132         The ScopeInfo is used to track the activation frames for local
15133         variables, for example:
15134
15135         for (int i = 0; i < 10; i++)
15136                 for (int j = 0; j < 10; j++){
15137                    MyDelegate d = delegate {
15138                         call (i, j);
15139                    }
15140                 }
15141
15142         At runtime this captures a single captured variable `i', but it
15143         captures 10 different versions of the variable `j'.  The variable
15144         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15145         recorded on a child.  
15146
15147         The toplevel ScopeInfo will also track information like the `this'
15148         pointer if instance variables were referenced (this is necessary
15149         as the anonymous method lives inside a nested class in the host
15150         type of the method). 
15151
15152         (AnonymousMethod): Expanded to track the Toplevel, implement
15153         `AnonymousMethod.Compatible' to tell whether an anonymous method
15154         can be converted to a target delegate type. 
15155
15156         The routine now also produces the anonymous method content
15157
15158         (AnonymousDelegate): A helper class that derives from
15159         DelegateCreation, this is used to generate the code necessary to
15160         produce the delegate for the anonymous method that was created. 
15161
15162         * assign.cs: API adjustments for new changes in
15163         Convert.ImplicitStandardConversionExists.
15164
15165         * class.cs: Adjustments to cope with the fact that now toplevel
15166         blocks are of type `ToplevelBlock'. 
15167
15168         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15169         insteda of standard blocks.
15170
15171         Flag errors if params arguments are passed to anonymous methods.
15172
15173         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15174         `CurrentAnonymousMethod' which points to the current Anonymous
15175         Method.  The variable points to the AnonymousMethod class that
15176         holds the code being compiled.  It is set in the new EmitContext
15177         created for the anonymous method.
15178
15179         (EmitContext.Phase): Introduce a variable and an enumeration to
15180         assist in enforcing some rules about when and where we are allowed
15181         to invoke certain methods (EmitContext.NeedsReturnLabel is the
15182         only one that enfonces this right now).
15183
15184         (EmitContext.HaveCaptureInfo): new helper method that returns
15185         whether we have a CapturedContext initialized.
15186
15187         (EmitContext.CaptureVariable): New method used to register that a
15188         LocalInfo must be flagged for capturing. 
15189
15190         (EmitContext.CapturedParameter): New method used to register that a
15191         parameters must be flagged for capturing. 
15192         
15193         (EmitContext.CapturedField): New method used to register that a
15194         field must be flagged for capturing. 
15195
15196         (EmitContext.HaveCapturedVariables,
15197         EmitContext.HaveCapturedFields): Return whether there are captured
15198         variables or fields. 
15199
15200         (EmitContext.EmitMethodHostInstance): This is used to emit the
15201         instance for the anonymous method.  The instance might be null
15202         (static methods), this (for anonymous methods that capture nothing
15203         and happen to live side-by-side with the current method body) or a
15204         more complicated expression if the method has a CaptureContext.
15205
15206         (EmitContext.EmitTopBlock): Routine that drives the emission of
15207         code: it will first resolve the top block, then emit any metadata
15208         and then emit the code.  The split is done so that we can extract
15209         any anonymous methods and flag any captured variables/parameters.
15210         
15211         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15212         during this phase, the ILGenerator should not be used as labels
15213         and local variables declared here might not be accessible to any
15214         code that is part of an anonymous method.  
15215
15216         Exceptions to this include the temporary variables that are
15217         created by some statements internally for holding temporary
15218         variables. 
15219         
15220         (EmitContext.EmitMeta): New routine, in charge of emitting all the
15221         metadata for a cb
15222
15223         (EmitContext.TemporaryReturn): This method is typically called
15224         from the Emit phase, and its the only place where we allow the
15225         ReturnLabel to be defined other than the EmitMeta.  The reason is
15226         that otherwise we would have to duplicate a lot of logic in the
15227         Resolve phases of various methods that today is on the Emit
15228         phase. 
15229
15230         (EmitContext.NeedReturnLabel): This no longer creates the label,
15231         as the ILGenerator is not valid during the resolve phase.
15232
15233         (EmitContext.EmitThis): Extended the knowledge in this class to
15234         work in anonymous methods in addition to iterators. 
15235
15236         (EmitContext.EmitCapturedVariableInstance): This emits whatever
15237         code is necessary on the stack to access the instance to a local
15238         variable (the variable will be accessed as a field).
15239
15240         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15241         EmitContext.EmitAddressOfParameter): Routines to support
15242         parameters (not completed at this point). 
15243         
15244         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
15245         will also remove the parameters.
15246
15247         * convert.cs (Convert): Define a `ConstantEC' which points to a
15248         null.  This is just to prefity some code that uses
15249         ImplicitStandardConversion code and do not have an EmitContext
15250         handy.
15251
15252         The idea is to flag explicitly that at that point in time, it is
15253         known that the conversion will not trigger the delegate checking
15254         code in implicit conversions (which requires a valid
15255         EmitContext). 
15256
15257         Everywhere: pass new EmitContext parameter since
15258         ImplicitStandardConversionExists now requires it to check for
15259         anonymous method conversions. 
15260
15261         (Convert.ImplicitStandardConversionExists): If the type of an
15262         expression is the anonymous_method_type, and the type is a
15263         delegate, we invoke the AnonymousMethod.Compatible method to check
15264         whether an implicit conversion is possible. 
15265
15266         (Convert.ImplicitConversionStandard): Only do implicit method
15267         group conversions if the language level is not ISO_1.
15268
15269         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15270         MethodInfo for the Invoke method.  used by Delegate and
15271         AnonymousDelegate.
15272
15273         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15274         method conversions if the target type is a delegate.
15275
15276         Removed extra debugging nops.
15277
15278         (LocalVariableReference): Turn the `local_info' into a public
15279         field. 
15280
15281         Add `prepared' field, the same hack used for FieldExprs to cope
15282         with composed assignments, as Local variables do not necessarily
15283         operate purely on the stack as they used to: they can be captured
15284         fields. 
15285
15286         Add `temp' for a temporary result, like fields.
15287
15288         Refactor DoResolve and DoResolveLValue into DoResolveBase.
15289
15290         It now copes with Local variables that are captured and emits the
15291         proper instance variable to load it from a field in the captured
15292         case. 
15293
15294         (ParameterReference.DoResolveBase): During the resolve phase,
15295         capture parameters if we are in an anonymous method.
15296
15297         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15298         anonymous method, use the EmitContext helper routines to emit the
15299         parameter reference.
15300
15301         * iterators.cs: Set RemapToProxy to true/false during the
15302         EmitDispose class.
15303
15304         * parameters.cs (GetParameterByName): New helper method. 
15305
15306         * typemanager.cs (anonymous_method_type) a new type that
15307         represents an anonyous method.  This is always an internal type,
15308         used as a fencepost to test against the anonymous-methodness of an
15309         expression. 
15310         
15311 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
15312
15313         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15314         561 report.
15315         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15316
15317 2004-10-18  Martin Baulig  <martin@ximian.com>
15318
15319         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15320         `Type' directly, but call ResolveType() on it.
15321         (Catch.Resolve): Likewise.
15322         (Foreach.Resolve): Likewise.
15323
15324 2004-10-18  Martin Baulig  <martin@ximian.com>
15325
15326         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15327         `Type' directly, but call ResolveType() on it.
15328         (Probe.DoResolve): Likewise.
15329         (ArrayCreation.LookupType): Likewise.
15330         (TypeOf.DoResolve): Likewise.
15331         (SizeOf.DoResolve): Likewise.
15332
15333 2004-10-18  Martin Baulig  <martin@ximian.com>
15334
15335         * expression.cs (Invocation.BetterFunction): Put back
15336         TypeManager.TypeToCoreType().
15337
15338 2004-10-18  Raja R Harinath  <rharinath@novell.com>
15339
15340         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15341         the ResolveType.
15342
15343 2004-10-18  Martin Baulig  <martin@ximian.com>
15344
15345         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
15346         `Type' directly, but call ResolveType() on it.
15347
15348 2004-10-18  Martin Baulig  <martin@ximian.com>
15349
15350         * class.cs (FieldMember.Define): Don't access the TypeExpr's
15351         `Type' directly, but call ResolveType() on it.
15352         (MemberBase.DoDefine): Likewise.
15353
15354         * expression.cs (New.DoResolve): Don't access the TypeExpr's
15355         `Type' directly, but call ResolveType() on it.
15356         (ComposedCast.DoResolveAsTypeStep): Likewise.
15357
15358         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15359         `Type' directly, but call ResolveType() on it.
15360
15361 2004-10-17  John Luke  <john.luke@gmail.com>
15362
15363         * class.cs (Operator.GetSignatureForError): use CSharpName
15364
15365         * parameter.cs (Parameter.GetSignatureForError): Returns
15366         correct name even if was not defined.
15367
15368 2004-10-13  Raja R Harinath  <rharinath@novell.com>
15369
15370         Fix #65816.
15371         * class.cs (TypeContainer.EmitContext): New property.
15372         (DefineNestedTypes): Create an emitcontext for each part.
15373         (MethodCore.DoDefineParameters): Use container's emitcontext.
15374         Pass type array to InternalParameters.
15375         (MemberBase.DoDefine): Use container's emitcontext.
15376         (FieldMember.Define): Likewise.
15377         (Event.Define): Likewise.
15378         (SetMethod.GetParameterInfo): Change argument to EmitContext.
15379         Pass type array to InternalParameters.
15380         (SetIndexerMethod.GetParameterInfo): Likewise.
15381         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15382         * delegate.cs (Define): Pass emitcontext to
15383         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
15384         array to InternalParameters.
15385         * expression.cs (ParameterReference.DoResolveBase): Pass
15386         emitcontext to GetParameterInfo.
15387         (ComposedCast.DoResolveAsTypeStep): Remove check on
15388         ec.ResolvingTypeTree.
15389         * parameter.cs (Parameter.Resolve): Change argument to
15390         EmitContext.  Use ResolveAsTypeTerminal.
15391         (Parameter.GetSignature): Change argument to EmitContext.
15392         (Parameters.ComputeSignature): Likewise.
15393         (Parameters.ComputeParameterTypes): Likewise.
15394         (Parameters.GetParameterInfo): Likewise.
15395         (Parameters.ComputeAndDefineParameterTypes): Likewise.
15396         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
15397         * support.cs (InternalParameters..ctor): Remove variant that takes
15398         a DeclSpace.
15399         * typemanager.cs (system_intptr_expr): New.
15400         (InitExpressionTypes): Initialize it.
15401
15402 2004-10-12  Chris Toshok  <toshok@ximian.com>
15403
15404         * cs-parser.jay: fix location for try_statement and catch_clause.
15405
15406 2004-10-11  Martin Baulig  <martin@ximian.com>
15407
15408         * report.cs: Don't make --fatal abort on warnings, we have
15409         -warnaserror for that.
15410
15411 2004-10-07  Raja R Harinath  <rharinath@novell.com>
15412
15413         More DeclSpace.ResolveType avoidance.
15414         * decl.cs (MemberCore.InUnsafe): New property.
15415         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
15416         with newly created EmitContext.
15417         (FieldMember.Define): Likewise.
15418         * delegate.cs (Delegate.Define): Likewise.
15419         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15420         only if normal name-lookup fails.
15421         (TypeExpr.DoResolve): Enable error-checking.
15422         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15423         (SizeOf.DoResolve): Likewise.
15424         (ComposedCast.DoResolveAsTypeStep): Likewise.
15425         (StackAlloc.DoResolve): Likewise.
15426         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15427         (Block.Unsafe): New property.
15428         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15429         (Unsafe): Set 'unsafe' flag of contained block.
15430         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15431         (Fixed.Resolve): Likewise.
15432         (Catch.Resolve): Likewise.
15433         (Using.ResolveLocalVariableDecls): Likewise.
15434         (Foreach.Resolve): Likewise.
15435
15436 2004-10-05  John Luke <john.luke@gmail.com>
15437
15438         * cs-parser.jay: add location to error CS0175
15439
15440 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
15441
15442         * ecore.cs (Expression.Constantity): Add support for turning null
15443         into a constant.
15444
15445         * const.cs (Const.Define): Allow constants to be reference types
15446         as long as the value is Null.
15447
15448 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
15449
15450         * namespace.cs (NamespaceEntry.Using): No matter which warning
15451         level is set, check if this namespace name has already been added.
15452
15453 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
15454
15455         * expression.cs: reftype [!=]= null should always use br[true,false].
15456         # 67410
15457
15458 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
15459
15460         Fix #67108
15461         * attribute.cs: Enum conversion moved to 
15462         GetAttributeArgumentExpression to be applied to the all
15463         expressions.
15464
15465 2004-10-01  Raja R Harinath  <rharinath@novell.com>
15466
15467         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15468         * class.c (TypeContainer.DefineType): Flag error if
15469         base types aren't accessible due to access permissions.
15470         * decl.cs (DeclSpace.ResolveType): Move logic to
15471         Expression.ResolveAsTypeTerminal.
15472         (DeclSpace.ResolveTypeExpr): Thin layer over
15473         Expression.ResolveAsTypeTerminal.
15474         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15475         Refactor code into NestedAccess.  Use it.
15476         (DeclSpace.NestedAccess): New.
15477         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15478         argument to silence errors.  Check access permissions.
15479         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15480         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15481         (Cast.DoResolve): Likewise.
15482         (New.DoResolve): Likewise.
15483         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15484         (TypeOf.DoResolve): Likewise.
15485
15486         * expression.cs (Invocation.BetterConversion): Return the Type of
15487         the better conversion.  Implement section 14.4.2.3 more faithfully.
15488         (Invocation.BetterFunction): Make boolean.  Make correspondence to
15489         section 14.4.2.2 explicit.
15490         (Invocation.OverloadResolve): Update.
15491         (Invocation): Remove is_base field.
15492         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
15493         (Invocation.Emit): Likewise.
15494
15495 2004-09-27  Raja R Harinath  <rharinath@novell.com>
15496
15497         * README: Update to changes.
15498
15499 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
15500
15501         * cs-parser.jay: Reverted 642 warning fix.
15502
15503 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15504
15505         Fix bug #66615
15506         * decl.cs (FindMemberWithSameName): Indexer can have more than
15507         1 argument.
15508
15509 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15510
15511         * expression.cs (LocalVariableReference.DoResolveLValue):
15512         Do not report warning 219 for out values.
15513         (EmptyExpression.Null): New member to avoid extra allocations.
15514
15515 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15516
15517         * cs-parser.jay: Fix wrong warning 642 report.
15518
15519         * cs-tokenizer.cs (CheckNextToken): New helper;
15520         Inspect next character if is same as expected.
15521
15522 2004-09-23  Martin Baulig  <martin@ximian.com>
15523
15524         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15525         (Convert.ImplicitReferenceConversionExists): Likewise.
15526
15527 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15528
15529         * class.cs (Operator.Define): Add error 448 and 559 report.
15530
15531 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15532
15533         * class.cs (MemberBase.IsTypePermitted): New protected
15534         method for checking error CS0610.
15535
15536 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15537
15538         * class.cs (TypeContainer.HasExplicitLayout): New property
15539         Returns whether container has StructLayout attribute set Explicit.
15540         (FieldMember): New abstract class for consts and fields.
15541         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15542         (Field): Reuse FieldMember.
15543
15544         * const.cs (Const): Reuse FieldMember.
15545
15546         * rootcontext.cs: EmitConstants call moved to class.
15547
15548 2004-09-22  Martin Baulig  <martin@ximian.com>
15549
15550         Thanks to Peter Sestoft for this bug report.
15551
15552         * expression.cs (Conditional): If both the `trueExpr' and the
15553         `falseExpr' is a NullLiteral, return a NullLiteral.
15554
15555 2004-09-22  Martin Baulig  <martin@ximian.com>
15556
15557         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15558         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15559         for the "get_Current" call.
15560
15561 2004-09-22  Martin Baulig  <martin@ximian.com>
15562
15563         Marek and me just fixed one of our oldest bugs: #28562 :-)
15564
15565         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15566
15567         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15568         we're an EnumConstant, just return that.
15569         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15570         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
15571         to get the value which'll actually be written into the attribute.
15572         However, we have to use GetValue() to access the attribute's value
15573         in the compiler.        
15574
15575 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15576
15577         * constant.cs (Constant.IsNegative): New abstract property
15578         IsNegative.
15579
15580         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15581         (StackAlloc.DoResolve): Reused IsNegative.
15582
15583 2004-09-21  Martin Baulig  <martin@ximian.com>
15584
15585         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15586         if we're used in an iterator, we may be called from different
15587         methods.
15588
15589         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15590         we actually have an exception block.
15591
15592 2004-09-20  John Luke <jluke@cfl.rr.com>
15593
15594         * class.cs, cs-parser.jay: Improve the error report for 1520:
15595         report the actual line where the error happens, not where the
15596         class was declared.
15597
15598         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15599         Pass location information that was available elsewhere.
15600
15601 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
15602
15603         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15604         runtime to delay sign assemblies.
15605
15606 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * cs-parser.jay: Do not report the stack trace, this is barely
15609         used nowadays.
15610
15611 2004-08-22  John Luke  <john.luke@gmail.com>
15612  
15613         * driver.cs : check that a resource id is not already used
15614         before adding it, report CS1508 if it is, bug #63637
15615
15616 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15617
15618         * ecore.cs: Removed dead code.
15619
15620 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
15621
15622         * class.cs: Do not report warning CS0067 on the interfaces.
15623
15624 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15625
15626         * cs-parser.jay: Add error 504 report.
15627
15628 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15629
15630         * rootcontext.cs: WarningLevel is 4 by default now.
15631
15632         * statement.cs (Fixed.Resolve): Do not null
15633         VariableInfo.
15634
15635 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15636
15637         Fixed bug #55780
15638         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15639         deep search when property is not virtual.
15640         (PropertyExpr.ResolveAccessors): Make one call for both
15641         accessors.
15642
15643 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15644
15645         Fixed bug #65766
15646         * statement.cs: Error 152 report constains also location.
15647
15648 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15649
15650         Fixed bug #65766
15651         * const.cs: Explicitly set constant as static.
15652
15653 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15654
15655         Fixed bug #64226
15656         * cs-parser.jay: Add error 1017 report.
15657
15658 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15659
15660         Fixed bug #59980, #64224
15661         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15662
15663         * typemanager.cs (IsSpecialMethod): Simplified
15664
15665 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15666
15667         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15668         condition with better params.
15669
15670 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15671
15672         Fixed bug #65238
15673         * attribute.cs (Resolve): Property has to have both
15674         accessors.
15675
15676 2004-09-14  Martin Baulig  <martin@ximian.com>
15677
15678         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15679
15680 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15681
15682         Fixed bug #61902
15683         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15684         called and is obsolete then this member suppress message
15685         when call is inside next [Obsolete] method or type.
15686
15687         * expression.cs: Use TestObsoleteMethodUsage member.
15688
15689 2004-09-14  Martin Baulig  <martin@ximian.com>
15690
15691         * cs-parser.jay: Sync a bit with the GMCS version.
15692
15693 2004-09-14  Martin Baulig  <martin@ximian.com>
15694
15695         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15696         (CSharpParser.yacc_verbose_flag): New public field.
15697
15698         * genericparser.cs: Removed.
15699
15700 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15701
15702         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15703
15704 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15705
15706         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15707
15708 2004-09-10  Martin Baulig  <martin@ximian.com>
15709
15710         Backported my MemberName changes from GMCS into MCS.
15711
15712         - we are now using a special `MemberName' class instead of using
15713         strings; in GMCS, the `MemberName' also contains the type
15714         arguments.
15715
15716         - changed the grammar rules a bit:
15717           * the old `member_name' is now a `namespace_or_type_name':
15718             The rule is that we use `namespace_or_type_name' everywhere
15719             where we expect either a "member name" (GetEnumerator) or a
15720             "member name" with an explicit interface name
15721             (IEnumerable.GetEnumerator).
15722             In GMCS, the explicit interface name may include type arguments
15723             (IEnumerable<T>.GetEnumerator).
15724           * we use `member_name' instead of just `IDENTIFIER' for
15725             "member names":
15726             The rule is that we use `member_name' wherever a member may
15727             have type parameters in GMCS.       
15728
15729         * decl.cs (MemberName): New public class.
15730         (MemberCore.MemberName): New public readonly field.
15731         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15732         (DeclSpace): Likewise.
15733
15734         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15735         * enum.cs (Enum.ctor): Likewise.
15736
15737         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15738         MemberName.     
15739         (AliasEntry.ctor): Take a MemberName, not an Expression.
15740         (AliasEntry.UsingAlias): Likewise.
15741
15742         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15743         (IMethodData.MemberName): Changed type from string to MemberName.
15744         (MemberBase.ExplicitInterfaceName): Likewise.
15745         (AbstractPropertyEventMethod.SetupName): Make this private.
15746         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15747         argument; compute the member name here.
15748         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15749         on the `member.MemberName' and the `prefix'.
15750
15751         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15752         not `type_name'.
15753         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15754         thus, we get a `MemberName' instead of a `string'.  These
15755         declarations may have type parameters in GMCS.
15756         (interface_method_declaration, delegate_declaration): Likewise.
15757         (class_declaration, interface_declaration): Likewise.
15758         (method_header): Use `namespace_or_type_name' instead of
15759         `member_name'.  We may be an explicit interface implementation.
15760         (property_declaration, event_declaration): Likewise.
15761         (member_name): This is now just an `IDENTIFIER', not a
15762         `namespace_or_type_name'.
15763         (type_name, interface_type): Removed.
15764         (namespace_or_type_name): Return a MemberName, not an Expression.
15765         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15766         call GetTypeExpression() on the MemberName to get an expression.
15767         (IndexerDeclaration.interface_type): Changed type from string to
15768         MemberName.
15769         (MakeName): Operate on MemberName's instead of string's.
15770
15771 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15772
15773         Fix bug #55770.
15774         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15775         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15776         lookup to avoid symbols introduced by 'using'.
15777         * rootcontext.cs (NamespaceLookup): Update.
15778
15779 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15780
15781         * class.cs (TypeContainer.DoDefineMembers): Do not call
15782         DefineDefaultConstructor for static classes.
15783
15784 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15785
15786         * attribute.cs (Attribute.Resolve): Add error 653 report.
15787
15788         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15789         report.
15790         (Method.ApplyAttributeBuilder): Add error 685 report.
15791         (Operator.Define): Add error 564 report.
15792
15793         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15794
15795         * expression.cs (Invocation.DoResolve): Add error
15796         245 and 250 report.
15797
15798         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15799         error 674 report.
15800
15801 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15802
15803         * class.cs (ConstructorInitializer.Resolve):
15804         Wrong error number (515->516).
15805
15806 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15807
15808         * class.cs (Indexer.Define): Add error 631 report.
15809
15810 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15811
15812         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15813
15814 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15815
15816         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15817
15818 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15819
15820         * cs-parser.jay: Added error CS0241 report.
15821
15822 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15823
15824         * cs-parser.jay (fixed_statement): Introduce a scope for the
15825         declaration in the 'fixed' statement.
15826
15827 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15828
15829         * cs-parser.jay: Added CS0230 error report.
15830
15831 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15832
15833         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15834
15835 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15836
15837         * expression.cs (Argument.Resolve): Added error CS0192 and
15838         CS0199 report.
15839
15840 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15841
15842         C# 2.0 #pragma warning feature
15843
15844         * cs-tokenizer.cs (PreProcessPragma): New method; 
15845         Handles #pragma directive.
15846
15847         * report.cs (WarningRegions): New class; Support
15848         class for #pragma warning directive. It tests whether
15849         warning is enabled for a given line.
15850
15851 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15852
15853         * const.cs: Add more descriptive error report, tahnks to
15854         Sebastien. 
15855
15856 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15857
15858         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15859
15860 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * expression.cs: Apply patch from Ben: Remove dead code from
15863         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15864         as that code just threw an exception anwyays.
15865
15866         * const.cs: Remove the call to the turnintoconstant, for details
15867         see bug: #63144
15868         
15869         * literal.cs: The type of the null-literal is the null type;  So
15870         we use a placeholder type (literal.cs:System.Null, defined here)
15871         for it.
15872
15873         * expression.cs (Conditional.DoResolve): Remove some old code that
15874         is no longer needed, conversions have been fixed.
15875
15876         (ArrayCreationExpression.DoResolve): Return false if we fail to
15877         resolve the inner expression.
15878
15879 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15880
15881         Fix test-290.cs.
15882         * cs-parser.jay (delegate_declaration): Record a delegate
15883         declaration as a type declaration.
15884         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15885
15886 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * parameter.cs: Do not crash if the type can not be resolved. 
15889
15890         * expression.cs: Report errors with unsafe pointers, fixes #64896
15891
15892 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15893
15894         * expression.cs: Pointer arith always needs to do a conv.i
15895         if the operand is a long. fix 65320
15896
15897 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15898
15899         Fixed cs0619-37.cs, cs0619-38.cs
15900
15901         * enum.cs (GetObsoleteAttribute): Removed.
15902
15903         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15904         on Enum member is double staged. The first is tested member
15905         and then enum.
15906
15907 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15908
15909         Fixed #56986, #63631, #65231
15910
15911         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15912         adds member to name container.
15913         (TypeContainer.AddToTypeContainer): New method, adds type to
15914         name container.
15915         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15916         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15917         AddOperator): Simplified by reusing AddToMemberContainer.
15918         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15919         instead of field.
15920         (Method.CheckForDuplications): Fixed implementation to test all
15921         possibilities.
15922         (MemberBase): Detection whether member is explicit interface
15923         implementation is now in constructor.
15924         (MemberBase.UpdateMemberName): Handles IndexerName.
15925         (Accessor): Changed to keep also location information.
15926         (AbstractPropertyEventMethod): Is derived from MemberCore.
15927         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15928         will be emited or not.
15929         (PropertyBase.AreAccessorsDuplicateImplementation):
15930         Tests whether accessors are not in collision with some method.
15931         (Operator): Is derived from MethodCore to simplify common
15932         operations.
15933
15934         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15935         must be performed.
15936         (DeclSpace.AddToContainer): Adds the member to defined_names
15937         table. It tests for duplications and enclosing name conflicts.
15938
15939         * enum.cs (EnumMember): Clean up to reuse the base structures
15940
15941 2004-09-03  Martin Baulig  <martin@ximian.com>
15942
15943         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15944         into TypeContainer, to make partial classes work again.
15945
15946 2004-09-03  Martin Baulig  <martin@ximian.com>
15947
15948         * rootcontext.cs (RootContext.V2): Removed.
15949
15950 2004-03-23  Martin Baulig  <martin@ximian.com>
15951
15952         * expression.cs (Invocation.OverloadResolve): Added `bool
15953         may_fail' argument and use it instead of the Location.IsNull() hack.
15954
15955 2004-09-03  Martin Baulig  <martin@ximian.com>
15956
15957         Merged latest changes into gmcs.  Please keep this comment in
15958         here, it makes it easier for me to see what changed in MCS since
15959         the last time I merged.
15960
15961 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15962
15963         Fix #61128.
15964         * expression.cs (BetterConversion): Don't allow either conversion 
15965         to be null.  Remove redundant implicit conversion test when 'q ==
15966         null' -- when this function is invoked, we already know that the
15967         implicit conversion exists.
15968         (BetterFunction): Assume that 'best' is non-null.  Remove
15969         redundant reimplementation of IsApplicable when 'best' is null.
15970         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15971         number of arguments.
15972         (IsAncestralType): Extract from OverloadResolve.
15973         (OverloadResolve): Make robust to the MethodGroupExpr being
15974         unsorted.  Implement all the logic of Section 14.5.5.1, and
15975         support overloading of methods from multiple applicable types.
15976         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15977
15978         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15979         (RealError, Warning): Append type of report to related symbol.
15980
15981 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15982
15983         * enum.cs: Fixed CLS-Compliance checks for enum members.
15984         Error tests cs3008-8.cs, cs3014-8.cs
15985
15986 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15987
15988         Fixed bug #62342, #63102
15989         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15990         like ImplementMethod.
15991
15992 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15993
15994         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15995         Fixed bug #65170.
15996
15997 2004-09-02  Martin Baulig  <martin@ximian.com>
15998
15999         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
16000         TypeManager.GetArgumentTypes() rather than calling GetParameters()
16001         on the MethodBase.
16002
16003 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
16004
16005         C# 2.0 Static classes implemented
16006
16007         * class.cs (TypeContainer): instance_constructors,
16008         initialized_fields, initialized_static_fields,
16009         default_constructor, base_inteface_types are protected to be
16010         accessible from StaticClass.
16011         (TypeContainer.DefineDefaultConstructor): New virtual method
16012         for custom default constructor generating
16013         (StaticClass): New class to handle "Static classes" feature.
16014
16015         * cs-parser.jay: Handle static keyword on class like instance
16016         of StaticClass.
16017
16018         * driver.cs: Added "/langversion" command line switch with two
16019         options (iso-1, default).
16020
16021 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
16022
16023         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
16024
16025 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * delegate.cs: Style.
16028
16029 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16030
16031         * delegate.cs: Add seperate instance expr field for miguel.
16032
16033 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16034
16035         * PointerArithmetic (Resolve): make sure we are not doing
16036         pointer arith on void*. Also, make sure we are resolved
16037         by not setting eclass until resolve.
16038
16039         All callers: Make sure that PointerArithmetic gets resolved.
16040
16041 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16042
16043         * ArrayCreation (LookupType): If the type does not resolve 
16044         to an array, give an error.
16045
16046 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
16047
16048         * statement.cs (Try.Resolve): Fixed bug #64222
16049
16050 2004-08-27  Martin Baulig  <martin@ximian.com>
16051
16052         * class.cs
16053         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
16054         crash here.     
16055
16056 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
16057
16058         * ecore.cs (Constantify): Get underlying type via
16059         System.Enum.GetUnderlyingType to avoid StackOverflow on the
16060         Windows in special cases.
16061
16062 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
16063
16064         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
16065         for obtaining also private methods.
16066         (GetRemoveMethod): Used GetRemoveMethod (true)
16067         for obtaining also private methods.
16068
16069 2004-08-24  Martin Baulig  <martin@ximian.com>
16070
16071         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
16072         MethodAttributes.HideBySig for operators.
16073
16074 2004-08-23  Martin Baulig  <martin@ximian.com>
16075
16076         Back to the old error reporting system :-)
16077
16078         * report.cs (Message): Removed.
16079         (Report.MessageData, ErrorData, WarningData): Removed.
16080         (Report.Error, Warning): Back to the old system.
16081
16082 2004-08-23  Martin Baulig  <martin@ximian.com>
16083
16084         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
16085
16086         * class.cs (TypeContainer.ParentContainer): New public virtual
16087         method; replaces the explicit interface implementation.
16088         (ClassPart.ParentContainer): Override.
16089
16090 2004-08-23  Martin Baulig  <martin@ximian.com>
16091
16092         * statement.cs (Switch): Added support for constant switches; see
16093         #59428 or test-285.cs.
16094
16095 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
16096
16097         Fixed bug #62740.
16098         * statement.cs (GetEnumeratorFilter): Removed useless
16099         logic because C# specs is strict. GetEnumerator must be
16100         public.
16101
16102 2004-08-22  Martin Baulig  <martin@ximian.com>
16103
16104         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16105         a switch and may break, reset the barrier.  Fixes #59867.
16106
16107 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
16108
16109         CLS-Compliance speed up (~5% for corlib)
16110
16111         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16112         New method. Tests container for CLS-Compliant names
16113
16114         * class.cs (TypeContainer.VerifyClsName): New method.
16115         Checks whether container name is CLS Compliant.
16116         (Constructor): Implements IMethodData.
16117
16118         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16119         low-case table for CLS Compliance test.
16120         (MemberCache.VerifyClsParameterConflict): New method.
16121         Checks method parameters for CS3006 error.
16122
16123         * enum.cs (EnumMember): Is derived from MemberCore.
16124         (Enum.VerifyClsName): Optimized for better performance.
16125
16126 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
16127
16128         * report.cs: Renamed Error_T to Error and changed all
16129         references.
16130
16131 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
16132
16133         * class.cs (TypeContainer.IndexerArrayList): New inner class
16134         container for indexers.
16135         (TypeContainer.DefaultIndexerName): New constant for default
16136         indexer name. Replaced all "Item" with this constant.
16137         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16138
16139         * typemanager.cs (TypeManager.default_member_ctor): Cache here
16140         DefaultMemberAttribute constructor.
16141
16142 2004-08-05  Martin Baulig  <martin@ximian.com>
16143
16144         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16145         Fix bug #59429.
16146
16147 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
16148
16149         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16150         multi platforms problem.
16151
16152         * compiler.csproj: Included shared files.
16153
16154 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16155
16156         Fix bug 60333, 55971 in the more general way
16157         * attribute.cs (Attribute.GetAttributeArgumentExpression):
16158         Added arg_type argument for constant conversion.
16159         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16160
16161 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16162
16163         Fix bug #59760
16164         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
16165         OperatorArrayList, MethodCoreArrayList for typecontainer
16166         containers. Changed class member types to these new types.
16167         (MethodArrayList.DefineMembers): Added test for CS0659.
16168
16169 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
16170
16171         * cfold.cs: Synchronize the folding with the code in expression.cs
16172         Binary.DoNumericPromotions for uint operands.
16173
16174         * attribute.cs: Revert patch from Raja, it introduced a regression
16175         while building Blam-1.2.1 (hard to isolate a test case).
16176
16177 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16178
16179         Fix for #55382
16180         * class.cs:
16181         (TypeContainer.Define): Renamed to DefineContainerMembers because of
16182         name collision.
16183         (MethodCore.parent_method): New member. The method we're overriding
16184         if this is an override method.
16185         (MethodCore.CheckBase): Moved from Method class and made common.
16186         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16187         private.
16188         (MethodCore.CheckForDuplications): New abstract method. For custom
16189         member duplication search in a container
16190         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16191         method and its return type.
16192         (Event.conflict_symbol): New member. Symbol with same name in the
16193         parent class.
16194
16195         * decl.cs:
16196         (MemberCache.FindMemberWithSameName): New method. The method
16197         is looking for conflict with inherited symbols.
16198
16199 2004-08-04  Martin Baulig  <martin@ximian.com>
16200
16201         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16202
16203         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16204
16205 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16206
16207         * report.cs (Message): New enum for better error, warning reference in
16208         the code.
16209         (MessageData): New inner abstract class. It generally handles printing of
16210         error and warning messages.
16211         Removed unused Error, Warning, Message methods.
16212
16213 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16214
16215         Fix for cs0592-8.cs test
16216         * attribute.cs
16217         (Attributable.ValidAttributeTargets): Made public.
16218         (Attribute.ExplicitTarget): New member for explicit target value.
16219         (Attribute.CheckTargets): Now we translate explicit attribute
16220         target to Target here.
16221
16222 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
16223
16224         * ecore.cs (MethodGroupExpr): new IsBase property.
16225
16226         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16227
16228         * delegate.cs (DelegateCreation): store a MethodGroupExpr
16229         rather than an instance expr.
16230
16231         (DelegateCreation.Emit): Use the method group rather than
16232         the instance expression. Also, if you have base.Foo as the
16233         method for a delegate, make sure to emit ldftn, not ldftnvirt.
16234
16235         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
16236
16237         (NewDelegate.DoResolve): Only check for the existance of Invoke
16238         if the method is going to be needed. Use MethodGroupExpr.
16239
16240         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
16241
16242         * expression.cs: For pointer arith., make sure to use
16243         the size of the type, not the size of the pointer to
16244         the type.
16245
16246 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16247
16248         Fix for #60722
16249         * class.cs (Class): Added error CS0502 test.
16250
16251 2004-08-03  John Luke  <jluke@cfl.rr.com>
16252             Raja R Harinath  <rharinath@novell.com>
16253
16254         Fix for #60997.
16255         * attribute.cs (Attribute.complained_before): New flag.
16256         (Attribute.ResolveType, Attribute.Resolve),
16257         (Attribute.DefinePInvokeMethod): Set it.
16258         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16259         
16260 2004-08-03  Martin Baulig  <martin@ximian.com>
16261
16262         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16263         use a user-defined operator; we still need to do numeric
16264         promotions in case one argument is a builtin type and the other
16265         one has an implicit conversion to that type.  Fixes #62322.
16266
16267 2004-08-02  Martin Baulig  <martin@ximian.com>
16268
16269         * statement.cs (LocalInfo.Flags): Added `IsThis'.
16270         (LocalInfo.IsThis): New public property.
16271         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16272
16273 2004-08-01  Martin Baulig  <martin@ximian.com>
16274
16275         * class.cs (TypeContainer.GetClassBases): Don't set the default
16276         here since we may get called from GetPartialBases().
16277         (TypeContainer.DefineType): If GetClassBases() didn't return a
16278         parent, use the default one.
16279
16280 2004-07-30  Duncan Mak  <duncan@ximian.com>
16281
16282         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16283
16284 2004-07-30  Martin Baulig  <martin@ximian.com>
16285
16286         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16287
16288         * class.cs (SourceMethod): New public class, derive from the
16289         symbol writer's ISourceMethod.
16290         (Method): Use the new symbol writer API.
16291
16292         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16293         as argument and use the new symbol writer.
16294
16295         * location.cs
16296         (SourceFile): Implement the symbol writer's ISourceFile.
16297         (Location.SymbolDocument): Removed.
16298         (Location.SourceFile): New public property.
16299
16300         * symbolwriter.cs: Use the new symbol writer API.
16301
16302 2004-07-30  Raja R Harinath  <rharinath@novell.com>
16303
16304         * Makefile (install-local): Remove.  Functionality moved to
16305         executable.make.
16306
16307 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
16308
16309         * Makefile: Install mcs.exe.config file together with mcs.exe.
16310         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16311         correct runtime version.
16312         
16313 2004-07-25  Martin Baulig  <martin@ximian.com>
16314
16315         * class.cs
16316         (TypeContainer.RegisterOrder): Removed, this was unused.
16317         (TypeContainer, interface_order): Removed.
16318         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16319         TypeContainer as argument since we can also be called with a
16320         `PartialContainer' for a partial class/struct/interface.
16321         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16322         of checking whether we're an `Interface' - we could be a
16323         `PartialContainer'.
16324         (PartialContainer.Register): Override; call
16325         AddClass()/AddStruct()/AddInterface() on our parent.
16326
16327         * cs-parser.jay (interface_member_declaration): Add things to the
16328         `current_container', not the `current_class'.
16329
16330         * rootcontext.cs (RegisterOrder): The overloaded version which
16331         takes an `Interface' was unused, removed.
16332
16333         * typemanager.cs (TypeManager.LookupInterface): Return a
16334         `TypeContainer', not an `Interface'.
16335         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16336         contain a `PartialContainer' for an interface, so check it's
16337         `Kind' to figure out what it is.
16338
16339 2004-07-25  Martin Baulig  <martin@ximian.com>
16340
16341         * class.cs (Class.DefaultTypeAttributes): New public constant.
16342         (Struct.DefaultTypeAttributes): Likewise.
16343         (Interface.DefaultTypeAttributes): Likewise.
16344         (PartialContainer.TypeAttr): Override this and add the
16345         DefaultTypeAttributes.
16346
16347 2004-07-25  Martin Baulig  <martin@ximian.com>
16348
16349         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16350         we can just use the `Parent' field instead.
16351
16352 2004-07-25  Martin Baulig  <martin@ximian.com>
16353
16354         * class.cs (TypeContainer.Emit): Renamed to EmitType().
16355
16356 2004-07-25  Martin Baulig  <martin@ximian.com>
16357
16358         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16359         our parts before defining any methods.
16360         (TypeContainer.VerifyImplements): Make this virtual.
16361         (ClassPart.VerifyImplements): Override and call VerifyImplements()
16362         on our PartialContainer.
16363
16364 2004-07-25  Martin Baulig  <martin@ximian.com>
16365
16366         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16367
16368         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16369         argument, we can just use the `Parent' field instead.
16370
16371         * class.cs
16372         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
16373         (MemberBase.DoDefine): Likewise.
16374
16375 2004-07-24  Martin Baulig  <martin@ximian.com>
16376
16377         * decl.cs (MemberCore.Parent): New public field.
16378         (DeclSpace.Parent): Moved to MemberCore.
16379
16380         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16381         (MemberBase.ctor): Added TypeContainer argument, pass it to our
16382         parent's .ctor.
16383         (FieldBase, Field, Operator): Likewise.
16384         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16385         (EventField, Event): Likewise.
16386
16387 2004-07-23  Martin Baulig  <martin@ximian.com>
16388
16389         * class.cs (PartialContainer): New public class.
16390         (ClassPart): New public class.
16391         (TypeContainer): Added support for partial classes.
16392         (TypeContainer.GetClassBases): Splitted some of the functionality
16393         out into GetNormalBases() and GetPartialBases().
16394
16395         * cs-tokenizer.cs (Token.PARTIAL): New token.
16396         (Tokenizer.consume_identifier): Added some hacks to recognize
16397         `partial', but only if it's immediately followed by `class',
16398         `struct' or `interface'.
16399
16400         * cs-parser.jay: Added support for partial clases.
16401
16402 2004-07-23  Martin Baulig  <martin@ximian.com>
16403
16404         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16405         a `DeclSpace' and also made it readonly.
16406         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16407         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16408         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16409
16410         * cs-parser.jay: Pass the `current_class', not the
16411         `current_container' (at the moment, this is still the same thing)
16412         to a new Method, Property, Event, Indexer or Constructor.
16413
16414 2004-07-23  Martin Baulig  <martin@ximian.com>
16415
16416         * cs-parser.jay (CSharpParser): Added a new `current_class' field
16417         and removed the `current_interface' one.
16418         (struct_declaration, class_declaration, interface_declaration):
16419         Set `current_class' to the newly created class/struct/interface;
16420         set their `Bases' and call Register() before parsing their body.
16421
16422 2004-07-23  Martin Baulig  <martin@ximian.com>
16423
16424         * class.cs (Kind): New public enum.
16425         (TypeContainer): Made this class abstract.
16426         (TypeContainer.Kind): New public readonly field.
16427         (TypeContainer.CheckDef): New public method; moved here from
16428         cs-parser.jay.
16429         (TypeContainer.Register): New public abstract method.
16430         (TypeContainer.GetPendingImplementations): New public abstract
16431         method.
16432         (TypeContainer.GetClassBases): Removed the `is_class' and
16433         `is_iface' parameters.
16434         (TypeContainer.DefineNestedTypes): Formerly known as
16435         DoDefineType().
16436         (ClassOrStruct): Made this class abstract.
16437
16438         * tree.cs (RootTypes): New public type. 
16439
16440 2004-07-20  Martin Baulig  <martin@ximian.com>
16441
16442         * tree.cs (Tree.RecordNamespace): Removed.
16443         (Tree.Namespaces): Removed.
16444
16445         * rootcontext.cs (RootContext.IsNamespace): Removed.
16446
16447         * cs-parser.jay (namespace_declaration): Just create a new
16448         NamespaceEntry here.
16449
16450 2004-07-20  Martin Baulig  <martin@ximian.com>
16451
16452         * statement.cs (ExceptionStatement): New abstract class.  This is
16453         now used as a base class for everyone who's using `finally'.
16454         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16455         our local variables before using them.
16456
16457         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16458         virtual method.  This is used by Yield.Resolve() to "steal" an
16459         outer block's `finally' clauses.
16460         (FlowBranchingException): The .ctor now takes an ExceptionStatement
16461         argument.
16462
16463         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16464         version which takes an ExceptionStatement.  This version must be
16465         used to create exception branchings.
16466
16467         * iterator.cs
16468         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16469         (Iterator.EmitMoveNext): Added exception support; protect the
16470         block with a `fault' clause, properly handle 'finally' clauses.
16471         (Iterator.EmitDispose): Run all the `finally' clauses here.
16472
16473 2004-07-20  Martin Baulig  <martin@ximian.com>
16474
16475         * iterator.cs: This is the first of a set of changes in the
16476         iterator code.  Match the spec more closely: if we're an
16477         IEnumerable, then GetEnumerator() must be called.  The first time
16478         GetEnumerator() is called, it returns the current instance; all
16479         subsequent invocations (if any) must create a copy.
16480
16481 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
16482
16483         * expression.cs: Resolve the constant expression before returning
16484         it. 
16485
16486 2004-07-19  Martin Baulig  <martin@ximian.com>
16487
16488         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16489         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16490         the return type of the new EmitContext.
16491
16492 2004-07-18  Martin Baulig  <martin@ximian.com>
16493
16494         * class.cs (Property.Define): Fix iterators.
16495
16496         * iterators.cs (Iterator.Define): Moved the
16497         `container.AddInterator (this)' call here from the .ctor; only do
16498         it if we resolved successfully.
16499
16500 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
16501
16502         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16503         `true' for preprocessing directives that we parse.  The return
16504         value indicates whether we should return to regular tokenizing or
16505         not, not whether it was parsed successfully.
16506
16507         In the past if we were in: #if false ... #line #endif, we would
16508         resume parsing after `#line'.  See bug 61604.
16509
16510         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16511         building: IsEnumType should return true only for enums, not for
16512         enums or System.Enum itself.  This fixes #61593.
16513
16514         Likely what happened is that corlib was wrong: mcs depended on
16515         this bug in some places.  The bug got fixed, we had to add the
16516         hack, which caused bug 61593.
16517
16518         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16519         that was a workaround for the older conditions.
16520
16521 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
16522
16523         * assign.cs: IAssignMethod has a new interface, as documented
16524         inline. All assignment code now uses this new api.
16525
16526         * ecore.cs, expression.cs: All classes which implement
16527         IAssignMethod now use the new interface.
16528
16529         * expression.cs (Invocation): add a hack to EmitCall so that
16530         IndexerAccess can be the target of a compound assignment without
16531         evaluating its arguments twice.
16532
16533         * statement.cs: Handle changes in Invocation api.
16534
16535 2004-07-16  Martin Baulig  <martin@ximian.com>
16536
16537         * iterators.cs: Rewrote this.  We're now using one single Proxy
16538         class for both the IEnumerable and the IEnumerator interface and
16539         `Iterator' derives from Class so we can use the high-level API.
16540
16541         * class.cs (TypeContainer.AddIterator): New method.
16542         (TypeContainer.DoDefineType): New protected virtual method, which
16543         is called from DefineType().
16544         (TypeContainer.DoDefineMembers): Call DefineType() and
16545         DefineMembers() on all our iterators.
16546         (TypeContainer.Emit): Call Emit() on all our iterators.
16547         (TypeContainer.CloseType): Call CloseType() on all our iterators.
16548
16549         * codegen.cs (EmitContext.CurrentIterator): New public field.
16550
16551 2004-07-15  Martin Baulig  <martin@ximian.com>
16552
16553         * typemanager.cs
16554         (TypeManager.not_supported_exception_type): New type.   
16555
16556 2004-07-14  Martin Baulig  <martin@ximian.com>
16557
16558         * iterators.cs: Use real error numbers.
16559
16560 2004-07-14  Martin Baulig  <martin@ximian.com>
16561
16562         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16563         requires this to be a System.Collection.IEnumerable and not a
16564         class implementing that interface.
16565         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
16566
16567 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
16568
16569         * class.cs: Fixed previous fix, it broke some error tests.
16570
16571 2004-07-12  Martin Baulig  <martin@ximian.com>
16572
16573         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16574         Fixes #61293.
16575
16576 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
16577
16578         * assign.cs (LocalTemporary): Add new argument: is_address,If
16579         `is_address' is true, then the value that we store is the address
16580         to the real value, and not the value itself.
16581         
16582         * ecore.cs (PropertyExpr): use the new local temporary
16583         stuff to allow us to handle X.Y += z (where X is a struct)
16584
16585 2004-07-08  Martin Baulig  <martin@ximian.com>
16586
16587         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16588         not always return, just like we're doing in Using.Resolve().
16589
16590 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
16591
16592         * cs-parser.jay (fixed_statement): flag this as Pinned.
16593
16594 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * typemanager.cs (TypeManager): Removed MakePinned method, this
16597         mechanism is replaced with the .NET 2.x compatible mechanism of
16598         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16599
16600         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
16601         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16602         `IsFixed' property which has a different meaning.
16603
16604 2004-07-02  Raja R Harinath  <rharinath@novell.com>
16605
16606         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16607         visible from inside a nested class, not just the names of the
16608         immediately enclosing class.
16609         Fix for bug #60730.
16610
16611 2004-06-24  Raja R Harinath  <rharinath@novell.com>
16612
16613         * expression.cs (BetterConversion): Remove buggy special-case
16614         handling of "implicit constant expression conversions".  At this
16615         point, we already know that the conversion is possible -- we're
16616         only checking to see which is better.
16617
16618 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16619
16620         * cs-parser.jay: Added error CS0210 test.
16621
16622 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16623
16624         * cs-parser.jay: Added error CS0134 test.
16625
16626 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16627
16628         Fix bug #52507
16629         * cs-parser.jay: Added error CS0145 test.
16630
16631 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16632
16633         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16634
16635 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
16636         
16637         * expression.cs (StackAlloc.Resolve): The argument may not
16638         be a constant; deal with this case.
16639         
16640 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
16641
16642         * attribute.cs (IndexerName_GetIndexerName): Renamed to
16643         GetIndexerAttributeValue.
16644         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16645
16646         * class.cs (Indexer.Define): Added error tests for CS0415,
16647         CS0609.
16648
16649 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
16650
16651         * attribute.cs (Attribute.Resolve): Keep field code in sync with
16652         property code.
16653
16654 2004-06-23  Martin Baulig  <martin@ximian.com>
16655
16656         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16657         neither return nor throw, reset the barrier as well.  Fixes #60457.
16658
16659 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
16660
16661         * class.cs : EventAttributes is now set to None by default.
16662           This fixes bug #60459.
16663
16664 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16665
16666         Fix bug #60219
16667         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16668         Don't throw exception but return null (it's sufficient now).
16669
16670 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16671
16672         * typemanager.cs (GetArgumentTypes): Faster implementation.
16673
16674 2004-06-18  Martin Baulig  <martin@ximian.com>
16675
16676         * attribute.cs (Attribute.Resolve): Check whether we're an
16677         EmptyCast which a Constant child.  Fixes #60333.
16678
16679 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16680
16681         * statement.cs (EmitCollectionForeach): Account for the fact that
16682         not all valuetypes are in areas which we can take the address of.
16683         For these variables, we store to a temporary variable. Also, make
16684         sure that we dont emit a `callvirt' on a valuetype method.
16685
16686 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16687
16688         * expression.cs (StackAlloc.DoReSolve): Added test for
16689         negative parameter (CS0247).
16690
16691 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16692
16693         Fix bug #59792
16694         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16695
16696 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16697
16698         Fix bug #59781
16699         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16700         ulong.
16701
16702 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16703
16704         Fix bug #58254 & cs1555.cs, cs1556.cs
16705         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16706
16707 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16708
16709         * cs-parser.jay: Added error CS1669 test for indexers.
16710
16711 2004-06-11  Martin Baulig  <martin@ximian.com>
16712
16713         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16714         call this twice: for params and varargs methods.
16715
16716 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16717
16718         * class.cs:
16719         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16720
16721 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16722
16723         * attribute.cs (Attribute.GetValidTargets): Made public.
16724
16725         * class.cs: 
16726         (AbstractPropertyEventMethod): New class for better code sharing.
16727         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16728         CS1667 report.
16729         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16730
16731 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16732
16733         Fix bug #59477.
16734         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16735         that the call to Resolve is part of a MemberAccess.
16736         (Expression.Resolve): Use it for SimpleName resolution.
16737         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16738         Add 'intermediate' boolean argument.
16739         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16740         error message when the SimpleName can be resolved ambiguously
16741         between an expression and a type.
16742         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16743         public.
16744         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16745         call on the left-side.
16746
16747 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16748
16749         * class.cs:
16750         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16751
16752 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16753
16754         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16755
16756 2004-06-11  Martin Baulig  <martin@ximian.com>
16757
16758         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16759         varargs methods if applicable.
16760
16761 2004-06-11  Martin Baulig  <martin@ximian.com>
16762
16763         * expression.cs (Invocation.EmitCall): Don't use
16764         `method.CallingConvention == CallingConventions.VarArgs' since the
16765         method could also have `CallingConventions.HasThis'.
16766
16767 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16768
16769         * class.cs (Event.GetSignatureForError): Implemented.
16770         Fixed crash in error test cs3010.cs
16771
16772 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * cs-tokenizer.cs: Change the way we track __arglist to be
16775         consistent with the other keywords.
16776
16777 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16778
16779         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16780         tomorrow.
16781
16782 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16783
16784         * codegen.cs: Check that all referenced assemblies have a strongname
16785         before strongnaming the compiled assembly. If not report error CS1577.
16786         Fix bug #56563. Patch by Jackson Harper.
16787         * typemanager.cs: Added a method to return all referenced assemblies.
16788         Fix bug #56563. Patch by Jackson Harper.
16789
16790 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16791
16792         * class.cs:
16793         (Method.ApplyAttributeBuilder): Moved and added conditional
16794         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16795
16796         * delegate.cs:
16797         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16798
16799 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16800
16801         Fixed #59640
16802         * class.cs: (EventField.attribute_targets): Changed default target.
16803
16804 2004-06-08  Martin Baulig  <martin@ximian.com>
16805
16806         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16807
16808 2004-06-08  Martin Baulig  <martin@ximian.com>
16809
16810         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16811
16812 2004-06-07  Martin Baulig  <martin@ximian.com>
16813
16814         Added support for varargs methods.
16815
16816         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16817         keyword.
16818
16819         * cs-parser.jay: Added support for `__arglist'.
16820
16821         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16822
16823         * expression.cs (Argument.AType): Added `ArgList'.
16824         (Invocation): Added support for varargs methods.
16825         (ArglistAccess): New public class.
16826         (Arglist): New public class.
16827
16828         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16829
16830         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16831         a method's top-level block if the method has varargs.
16832
16833         * support.cs (ReflectionParameters, InternalParameters): Added
16834         support for varargs methods.    
16835
16836 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16837
16838         * class.cs: Provide location in indexer error report.
16839
16840         * driver.cs: Use standard names.
16841
16842         * namespace.cs: Catch the use of using after a namespace has been
16843         declared also on using aliases.
16844
16845 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16846
16847         Bug #50820.
16848         * typemanager.cs (closure_private_ok, closure_invocation_type)
16849         (closure_qualifier_type, closure_invocation_assembly)
16850         (FilterWithClosure): Move to ...
16851         (Closure): New internal nested class.
16852         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16853         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16854         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16855         (MemberLookup, MemberLookupFailed): Use it.
16856         * expression.cs (New.DoResolve): Treat the lookup for the
16857         constructor as being qualified by the 'new'ed type.
16858         (Indexers.GetIndexersForTypeOrInterface): Update.
16859
16860 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16861
16862         * attribute.cs
16863         (GetConditionalAttributeValue): New method. Returns
16864         condition of ConditionalAttribute.
16865         (SearchMulti): New method.  Returns all attributes of type 't'.
16866         Use it when attribute is AllowMultiple = true.
16867         (IsConditionalMethodExcluded): New method.
16868
16869         * class.cs
16870         (Method.IsExcluded): Implemented. Returns true if method has conditional
16871         attribute and the conditions is not defined (method is excluded).
16872         (IMethodData): Extended interface for ConditionalAttribute support.
16873         (PropertyMethod.IsExcluded): Implemented.
16874
16875         * decl.cs
16876         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16877
16878         * expression.cs
16879         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16880         on the method.
16881
16882 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16883
16884         * expression.cs (ArrayCreationExpression): Make this just an
16885         `expression'. It can't be a statement, so the code here was
16886         dead.
16887
16888 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16889
16890         Fixed #59072
16891         * typemanager.cs (GetFullNameSignature): New method for
16892         MethodBase types.
16893
16894 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16895
16896         Fixed #56452
16897         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16898         Use this method when MethodBuilder is null.
16899         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16900         Added test for error CS0626 (MONO reports error for this situation).
16901         (IMethodData.GetSignatureForError): Extended interface.
16902
16903 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16904
16905         * attribute.cs
16906         (AttributeTester.GetObsoleteAttribute): Returns instance of
16907         ObsoleteAttribute when type is obsolete.
16908
16909         * class.cs
16910         (TypeContainer.VerifyObsoleteAttribute): Override.
16911         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16912         (MethodCode.VerifyObsoleteAttribute): Override.
16913         (MemberBase.VerifyObsoleteAttribute): Override.
16914
16915         * decl.cs
16916         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16917         and report proper error.
16918
16919         *delegate.cs
16920         Delegate.VerifyObsoleteAttribute): Override.
16921
16922         * ecore.cs
16923         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16924         and report proper error.
16925         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16926
16927         * enum.cs
16928         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16929         and enum member.
16930
16931         * expression.cs
16932         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16933         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16934         Added test for ObsoleteAttribute.
16935
16936         * statement.cs
16937         (Catch): Derived from Statement.
16938
16939 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16940  
16941         Fixed bug #59071 & cs0160.cs
16942  
16943         * statement.cs (Try.Resolve): Check here whether order of catch
16944         clauses matches their dependencies.
16945
16946 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16947
16948         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16949         caused a regression: #59343.  Referencing nested classes from an
16950         assembly stopped working.
16951
16952 2004-05-31  Martin Baulig  <martin@ximian.com>
16953
16954         MCS is now frozen for beta 2.
16955
16956 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16957
16958         * convert.cs: add a trivial cache for overload operator resolution.
16959
16960 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16961
16962         * decl.cs: If possible, use lookuptypedirect here. We can only do
16963         this if there is no `.' after the namespace. Avoids using
16964         LookupType, which does lots of slow processing.
16965         (FindNestedType) New method, does what it says :-).
16966         * namespace.cs: use LookupTypeDirect.
16967         * rootcontext.cs: use membercache, if possible.
16968         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16969
16970 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16971
16972         * expression.cs:
16973         According to the spec, 
16974
16975         In a member access of the form E.I, if E is a single identifier,
16976         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16977         field, property, localvariable, or parameter with the same type as
16978         the meaning of E as a type-name (§3.8), then both possible
16979         meanings of E are permitted.
16980
16981         We did not check that E as a simple-name had the same type as E as
16982         a type name.
16983
16984         This trivial check gives us 5-7% on bootstrap time.
16985
16986 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16987
16988         * expression.cs (Invocation.OverloadResolve): Avoid the
16989         use of hashtables and boxing here by allocating on demand.
16990
16991 2004-05-30  Martin Baulig  <martin@ximian.com>
16992
16993         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16994         we're doing a silent lookup.  Don't try to lookup nested types in
16995         TypeManager.object_type (thanks to Ben Maurer).
16996
16997 2004-05-30  Martin Baulig  <martin@ximian.com>
16998
16999         Committing a patch from Ben Maurer.
17000
17001         * rootcontext.cs (RootContext.LookupType): Cache negative results.
17002
17003 2004-05-29  Martin Baulig  <martin@ximian.com>
17004
17005         * class.cs (IMethodData.ShouldIgnore): New method.
17006
17007         * typemanager.cs (TypeManager.MethodFlags): Don't take a
17008         `Location' argument, we don't need it anywhere.  Use
17009         `IMethodData.ShouldIgnore ()' instead of
17010         `MethodData.GetMethodFlags ()'.
17011         (TypeManager.AddMethod): Removed.
17012         (TypeManager.AddMethod2): Renamed to AddMethod.
17013
17014 2004-05-29  Martin Baulig  <martin@ximian.com>
17015
17016         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
17017
17018         * convert.cs (Convert.ImplicitReferenceConversion): If we're
17019         converting from a class type S to an interface type and we already
17020         have an object on the stack, don't box it again.  Fixes #52578.
17021
17022 2004-05-29  Martin Baulig  <martin@ximian.com>
17023
17024         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17025         Added support for `params' parameters.  Fixes #59267.
17026
17027 2004-05-29  Martin Baulig  <martin@ximian.com>
17028
17029         * literal.cs (NullPointer): Provide a private .ctor which sets
17030         `type' to TypeManager.object_type.  Fixes #59048.
17031
17032 2004-05-29  Martin Baulig  <martin@ximian.com>
17033
17034         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
17035         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
17036
17037         * ecore.cs (EventExpr.instance_expr): Make the field private.
17038
17039 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
17040
17041         Fixed bug #50080 & cs0214-2.cs
17042         * expression.cs (Cast.DoResolve): Check unsafe context here.
17043         
17044         * statement.cs (Resolve.DoResolve): Likewise.
17045
17046 2004-05-26  Martin Baulig  <martin@ximian.com>
17047
17048         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
17049
17050         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
17051         (RootContext.LookupType): Pass down the `silent' flag.
17052
17053 2004-05-25  Martin Baulig  <martin@ximian.com>
17054
17055         * expression.cs
17056         (MethodGroupExpr.IdenticalTypeName): New public property.
17057         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
17058         expression actually refers to a type.
17059
17060 2004-05-25  Martin Baulig  <martin@ximian.com>
17061
17062         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
17063         for #56176 and made it actually work.
17064
17065 2004-05-25  Martin Baulig  <martin@ximian.com>
17066
17067         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
17068         (FieldExpr, PropertyExpr): Override and implement
17069         CacheTemporaries.  Fixes #52279.
17070
17071 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
17072
17073         * location.cs: In the new compiler listing a file twice is a
17074         warning, not an error.
17075
17076 2004-05-24  Martin Baulig  <martin@ximian.com>
17077
17078         * enum.cs (Enum.DefineType): For the `BaseType' to be a
17079         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
17080
17081 2004-05-24  Martin Baulig  <martin@ximian.com>
17082
17083         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
17084         walking the `using' list.  Fixes #53921.
17085
17086 2004-05-24  Martin Baulig  <martin@ximian.com>
17087
17088         * const.cs (Const.LookupConstantValue): Added support for
17089         EmptyCast's; fixes #55251.
17090
17091 2004-05-24  Martin Baulig  <martin@ximian.com>
17092
17093         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17094         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17095         which does the CS0135 check.  The reason is that we first need to
17096         check whether the variable actually exists.
17097
17098 2004-05-24  Martin Baulig  <martin@ximian.com>
17099
17100         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17101         than RootContext.LookupType() to find the explicit interface
17102         type.  Fixes #58584.
17103
17104 2004-05-24  Raja R Harinath  <rharinath@novell.com>
17105
17106         * Makefile: Simplify.  Use executable.make.
17107         * mcs.exe.sources: New file.  List of sources of mcs.exe.
17108
17109 2004-05-24  Anders Carlsson  <andersca@gnome.org>
17110
17111         * decl.cs:
17112         * enum.cs:
17113         Use the invariant culture when doing String.Compare for CLS case
17114         sensitivity.
17115         
17116 2004-05-23  Martin Baulig  <martin@ximian.com>
17117
17118         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17119         don't have any dots.  Fixes #52622, added cs0246-8.cs.
17120
17121         * namespace.cs (NamespaceEntry.Lookup): Likewise.
17122         
17123 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17124
17125         * class.cs (MemberBase.Define): Reuse MemberType member for 
17126         resolved type. Other methods can use it too.
17127
17128 2004-05-23  Martin Baulig  <martin@ximian.com>
17129
17130         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17131         the variable also exists in the current block (otherwise, we need
17132         to report a CS0103).  Fixes #58670.
17133
17134 2004-05-23  Martin Baulig  <martin@ximian.com>
17135
17136         * flowanalysis.cs (Reachability.Reachable): Compute this
17137         on-the-fly rather than storing it as a field.
17138
17139 2004-05-23  Martin Baulig  <martin@ximian.com>
17140
17141         * flowanalysis.cs (Reachability.And): Manually compute the
17142         resulting `barrier' from the reachability.      
17143        
17144 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17145
17146         Fix bug #57835
17147         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17148         instance of ObsoleteAttribute when symbol is obsolete.
17149
17150         * class.cs
17151         (IMethodData): Extended interface for ObsoleteAttribute support.
17152
17153 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17154
17155         * attribute.cs: Fix bug #55970
17156
17157 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17158
17159         Fix bug #52705
17160         * attribute.cs
17161         (GetObsoleteAttribute): New method. Creates the instance of
17162         ObsoleteAttribute.
17163         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17164         ObsoleteAttribute when member is obsolete.
17165         (AttributeTester.Report_ObsoleteMessage): Common method for
17166         Obsolete error/warning reporting.
17167
17168         * class.cs
17169         (TypeContainer.base_classs_type): New member for storing parent type.
17170
17171         * decl.cs
17172         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17173         for this MemberCore.
17174
17175 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17176
17177         * attribute.cs, const.cs: Fix bug #58590
17178
17179 2004-05-21  Martin Baulig  <martin@ximian.com>
17180
17181         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17182         out parameters if the end of the method is unreachable.  Fixes
17183         #58098. 
17184
17185 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17186
17187         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17188         Hari was right, why extra method.
17189
17190 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17191
17192         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17193
17194 2004-05-20  Martin Baulig  <martin@ximian.com>
17195
17196         Merged this back from gmcs to keep the differences to a minumum.
17197
17198         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17199         instead of a Declspace.
17200         (Attribute.ResolveType): Likewise.
17201         (Attributes.Search): Likewise.
17202         (Attributes.Contains): Likewise.
17203         (Attributes.GetClsCompliantAttribute): Likewise.
17204
17205         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17206         argument.
17207         (MethodData.ApplyAttributes): Take an EmitContext instead of a
17208         DeclSpace.
17209
17210 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
17211
17212         Fix bug #58688 (MCS does not report error when the same attribute
17213         is assigned twice)
17214
17215         * attribute.cs (Attribute.Emit): Distinction between null and default.
17216
17217 2004-05-19  Raja R Harinath  <rharinath@novell.com>
17218
17219         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17220         of a top-level attribute without an attribute target.
17221         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
17222         Make non-static.
17223         (Attribute.Conditional_GetConditionName), 
17224         (Attribute.Obsolete_GetObsoleteMessage): Update.
17225         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
17226         part of ScanForIndexerName.
17227         (Attribute.CanIgnoreInvalidAttribute): New function.
17228         (Attribute.ScanForIndexerName): Move to ...
17229         (Attributes.ScanForIndexerName): ... here.
17230         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17231         (Attributes.Search): New internal variant that can choose not to
17232         complain if types aren't resolved.  The original signature now
17233         complains.
17234         (Attributes.GetClsCompliantAttribute): Use internal variant, with
17235         complaints suppressed.
17236         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17237         only if it not useful.
17238         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17239         top-level for attributes that are shared between the assembly
17240         and a top-level class.
17241         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17242         * class.cs: Update to reflect changes.
17243         (DefineIndexers): Fuse loops.
17244         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
17245         a couple more variants of attribute names.
17246
17247 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
17248
17249         Fix bug #52585 (Implemented explicit attribute declaration)
17250
17251         * attribute.cs:
17252         (Attributable.ValidAttributeTargets): New abstract method. It gets
17253         list of valid attribute targets for explicit target declaration.
17254         (Attribute.Target): It holds target itself.
17255         (AttributeSection): Removed.
17256         (Attribute.CheckTargets): New method. It checks whether attribute
17257         target is valid for the current element.
17258
17259         * class.cs:
17260         (EventProperty): New class. For events that are declared like
17261         property (with add and remove accessors).
17262         (EventField): New class. For events that are declared like field.
17263         class.cs
17264
17265         * cs-parser.jay: Implemented explicit attribute target declaration.
17266
17267         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
17268         Override ValidAttributeTargets.
17269
17270         * parameter.cs:
17271         (ReturnParameter): Class for applying custom attributes on 
17272         the return type.
17273         (ParameterAtribute): New class. Class for applying custom
17274         attributes on the parameter type.
17275
17276 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17279         definitions. 
17280
17281         (Method): Allow UNSAFE here.
17282
17283         * modifiers.cs: Support unsafe reporting.
17284
17285 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
17286
17287         * decl.cs: Fix bug #58478.
17288
17289 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17290
17291         * statement.cs: When checking for unreachable code on an EmptyStatement,
17292         set the location. Fixes bug #58488.
17293
17294 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
17295
17296         * driver.cs: Add -pkg handling.
17297
17298         From Gonzalo: UseShelLExecute=false
17299
17300 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
17301
17302         * attribute.cs:
17303         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17304         for attribute.
17305         (Attribute.IsClsCompliaceRequired): Moved to base for better
17306         accesibility.
17307         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17308         when attribute is AttributeUsageAttribute.
17309         (Attribute.GetValidTargets): Simplified.
17310         (Attribute.GetAttributeUsage): New method returns AttributeUsage
17311         attribute for this type.
17312         (Attribute.ApplyAttributes): Method renamed to Emit and make
17313         non-static.
17314         (GlobalAttributeSection): New class for special handling of global
17315         attributes (assembly, module).
17316         (AttributeSection.Emit): New method.
17317
17318         * class.cs: Implemented Attributable abstract methods.
17319         (MethodCore.LabelParameters): Moved to Parameter class.
17320         (Accessor): Is back simple class.
17321         (PropertyMethod): Implemented Attributable abstract class.
17322         (DelegateMethod): Implemented Attributable abstract class.
17323         (Event): New constructor for disctintion between normal Event
17324         and Event with accessors.
17325
17326         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17327
17328         * codegen.cs, const.cs, decl.cs, delegate.cs:
17329         (CommonAssemblyModulClass): Implemented Attributable abstract class
17330         and simplified.
17331
17332         * enum.cs: Implement IAttributeSupport interface.
17333         (EnumMember): New class for emum members. Implemented Attributable
17334         abstract class
17335
17336         * parameter.cs:
17337         (ParameterBase): Is abstract.
17338         (ReturnParameter): New class for easier [return:] attribute handling.
17339
17340         * typemanager.cs: Removed builder_to_attr.
17341
17342 2004-05-11  Raja R Harinath  <rharinath@novell.com>
17343
17344         Fix bug #57151.
17345         * attribute.cs (Attribute.GetPositionalValue): New function.
17346         * class.cs (TypeContainer.VerifyMembers): New function.
17347         (TypeContainer.Emit): Use it.
17348         (ClassOrStruct): New base class for Class and Struct.
17349         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
17350         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17351         class.
17352         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17353         then each non-static field should have a FieldOffset attribute.
17354         Otherwise, none of the fields should have a FieldOffset attribute.
17355         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
17356         and FieldOffset attributes.
17357         * typemanager.cs (TypeManager.struct_layout_attribute_type)
17358         (TypeManager.field_offset_attribute_type): New core types.
17359         (TypeManager.InitCoreTypes): Initialize them.
17360
17361 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
17362
17363         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17364         Return correct type.
17365         From bug #58270.
17366
17367 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17370         be implicitly converted to ulong.
17371         
17372         * expression.cs: The logic for allowing operator &, | and ^ worked
17373         was wrong, it worked before because we did not report an error in
17374         an else branch.  Fixes 57895.
17375
17376         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17377         allow volatile fields to be reference types.
17378
17379 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
17380
17381         * driver.cs: Add support for /debug-
17382
17383 2004-05-07  Raja R Harinath  <rharinath@novell.com>
17384
17385         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
17386         Add a 'complain' parameter to silence errors.
17387         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
17388         silently overlooked type-resolutions.
17389         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17390         to reflect changes.
17391         (Attributes.Search): New function.
17392         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17393         (Attributes.GetAttributeFullName): Remove hack.
17394         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
17395         Update to reflect changes.
17396         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17397         Use Attributes.Search instead of nested loops.
17398
17399 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
17400
17401         * decl.cs:
17402         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17403         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17404         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17405
17406         * report.cs: (Report.Warning): Renamed to Warning_T because of
17407         parameter collision.
17408
17409 2004-05-05  Raja R Harinath  <rharinath@novell.com>
17410
17411         * expression.cs (MemberAccess.ResolveMemberAccess):
17412         Exit with non-zero status after Report.Error.
17413         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17414         Likewise.
17415         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17416
17417 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17418
17419         * support.cs: Don't hang when the file is empty.
17420
17421 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17422
17423         * support.cs: In SeekableStreamReader, compute the preamble size of the
17424           underlying stream. Position changes should take into account that initial
17425           count of bytes.
17426
17427 2004-05-03  Todd Berman  <tberman@sevenl.net>
17428
17429         * driver.cs: remove unused GetSysVersion function.
17430
17431 2004-05-03  Todd Berman  <tberman@sevenl.net>
17432
17433         * driver.cs: Remove the hack from saturday, as well as the hack
17434         from jackson (LoadAssemblyFromGac), also adds the CWD to the
17435         link_paths to get that bit proper.
17436
17437 2004-05-01  Todd Berman  <tberman@sevenl.net>
17438
17439         * driver.cs: Try a LoadFrom before a Load, this checks the current
17440         path. This is currently a bug in mono that is be fixed, however, this
17441         provides a workaround for now. This will be removed when the bug
17442         is fixed.
17443
17444 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
17445
17446         * CryptoConvert.cs: Updated to latest version. Fix issue with 
17447         incomplete key pairs (#57941).
17448
17449 2004-05-01  Todd Berman  <tberman@sevenl.net>
17450
17451         * driver.cs: Remove '.' from path_chars, now System.* loads properly
17452         from the GAC
17453
17454 2004-04-30  Jackson Harper  <jackson@ximian.com>
17455
17456         * codegen.cs: Open keys readonly.
17457         
17458 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17459
17460         * typemanager.cs: don't report cyclic struct layout when a struct
17461         contains 2 or more fields of the same type. Failed for Pango.AttrShape
17462         which has 2 Pango.Rectangle fields.
17463
17464 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17465
17466         * expression.cs: Handle IntPtr comparisons with IL code
17467         rather than a method call.
17468
17469 2004-04-29  Martin Baulig  <martin@ximian.com>
17470
17471         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
17472         the list of PropertyInfo's in class hierarchy and find the
17473         accessor.  Fixes #56013.
17474
17475 2004-04-29  Martin Baulig  <martin@ximian.com>
17476
17477         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17478
17479 2004-04-29  Martin Baulig  <martin@ximian.com>
17480
17481         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17482
17483         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17484
17485 2004-04-29  Martin Baulig  <martin@ximian.com>
17486
17487         * class.cs (ConstructorInitializer.Resolve): Check whether the
17488         parent .ctor is accessible.  Fixes #52146.
17489
17490 2004-04-29  Martin Baulig  <martin@ximian.com>
17491
17492         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17493
17494         * statement.cs (Using.EmitLocalVariableDecls): Use
17495         TypeManager.idisposable_type, not typeof (IDisposable).
17496         (Foreach.EmitCollectionForeach): Added support for valuetypes.
17497
17498 2004-04-29  Martin Baulig  <martin@ximian.com>
17499
17500         * class.cs (Event.Define): Don't emit the field and don't set
17501         RTSpecialName and SpecialName for events on interfaces.  Fixes
17502         #57703. 
17503
17504 2004-04-29  Raja R Harinath  <rharinath@novell.com>
17505
17506         Refactor Attribute.ApplyAttributes.
17507         * attribute.cs (Attributable): New base class for objects that can
17508         have Attributes applied on them.
17509         (Attribute): Make AttributeUsage fields public.
17510         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17511         (Attribute.IsInternalCall): New property.
17512         (Attribute.UsageAttr): Convert to a public read-only property.
17513         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17514         (Attribute.ResolveType, Attribute.Resolve)
17515         (Attribute.ScanForIndexerName): Update to reflect changes.
17516         (Attribute.CheckAttributeTarget): Re-format.
17517         (Attribute.ApplyAttributes): Refactor, to various
17518         Attributable.ApplyAttributeBuilder methods.
17519         * decl.cs (MemberCore): Make Attributable.
17520         * class.cs (Accessor): Make Attributable.
17521         (MethodData.ApplyAttributes): Use proper attribute types, not
17522         attribute names.
17523         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17524         (TypeContainer.ApplyAttributeBuilder)
17525         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17526         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
17527         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17528         (Operator.ApplyAttributeBuilder): New factored-out methods.
17529         * const.cs (Const.ApplyAttributeBuilder): Likewise.
17530         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17531         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17532         * parameter.cs (ParameterBase): New Attributable base class
17533         that can also represent Return types.
17534         (Parameter): Update to the changes.
17535
17536 2004-04-29  Jackson Harper  <jackson@ximian.com>
17537
17538         * driver.cs: Prefer the corlib system version when looking for
17539         assemblies in the GAC. This is still a hack, but its a better hack
17540         now.
17541         
17542 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
17543
17544         * decl.cs, enum.cs: Improved error 3005 reporting.
17545   
17546         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17547         (related_symbols): New private member for list of symbols
17548         related to reported error/warning.
17549         
17550         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17551
17552 2004-04-29  Martin Baulig  <martin@ximian.com>
17553
17554         * ecore.cs (Expression.Constantify): If we're an enum and
17555         TypeManager.TypeToCoreType() doesn't give us another type, use
17556         t.UnderlyingSystemType.  Fixes #56178.  
17557
17558 2004-04-29  Martin Baulig  <martin@ximian.com>
17559
17560         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17561         interfaces and for each interface, only add members directly
17562         declared in that interface.  Fixes #53255.
17563
17564 2004-04-28  Martin Baulig  <martin@ximian.com>
17565
17566         * expression.cs (ConditionalLogicalOperator): Use a temporary
17567         variable for `left' to avoid that we evaluate it more than once;
17568         bug #52588.
17569
17570 2004-04-28  Martin Baulig  <martin@ximian.com>
17571
17572         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17573         `void[]' (CS1547).
17574
17575 2004-04-28  Martin Baulig  <martin@ximian.com>
17576
17577         * statement.cs (LocalInfo.Resolve): Check whether the type is not
17578         void (CS1547).
17579
17580         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17581         whether the type is not void (CS1547).
17582
17583 2004-04-28  Martin Baulig  <martin@ximian.com>
17584
17585         * expression.cs (Unary.DoResolveLValue): Override this and report
17586         CS0131 for anything but Operator.Indirection.
17587
17588 2004-04-28  Martin Baulig  <martin@ximian.com>
17589
17590         Committing a patch from Ben Maurer; see bug #50820.
17591
17592         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17593         check for classes.
17594
17595         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17596         classes.        
17597
17598 2004-04-28  Martin Baulig  <martin@ximian.com>
17599
17600         Committing a patch from Ben Maurer; see bug #50820.
17601
17602         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17603         check for classes.
17604
17605         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17606         classes.        
17607
17608 2004-04-28  Martin Baulig  <martin@ximian.com>
17609
17610         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17611         (Block.AddLabel): Call DoLookupLabel() to only search in the
17612         current block.
17613
17614 2004-04-28  Martin Baulig  <martin@ximian.com>
17615
17616         * cfold.cs (ConstantFold.BinaryFold): Added special support for
17617         comparing StringConstants and NullLiterals in Equality and Inequality.
17618
17619 2004-04-28  Jackson Harper  <jackson@ximian.com>
17620
17621         * driver.cs: Attempt to load referenced assemblies from the
17622         GAC. This is the quick and dirty version of this method that
17623         doesnt take into account versions and just takes the first
17624         canidate found. Will be good enough for now as we will not have more
17625         then one version installed into the GAC until I update this method.
17626
17627 2004-04-28  Martin Baulig  <martin@ximian.com>
17628
17629         * typemanager.cs (TypeManager.CheckStructCycles): New public
17630         static method to check for cycles in the struct layout.
17631
17632         * rootcontext.cs (RootContext.PopulateTypes): Call
17633         TypeManager.CheckStructCycles() for each TypeContainer.
17634         [Note: We only need to visit each type once.]
17635
17636 2004-04-28  Martin Baulig  <martin@ximian.com>
17637
17638         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17639
17640         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17641         success and added `out object value'.  Use a `bool resolved' field
17642         to check whether we've already been called rather than
17643         `ConstantValue != null' since this breaks for NullLiterals.
17644
17645 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17646
17647         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17648         setting of this flag, since the 'set' method may be non-public.
17649
17650 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17651
17652         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17653         check on current_vector.Block.
17654
17655 2004-04-27  Martin Baulig  <martin@ximian.com>
17656
17657         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17658         a field initializer.  Fixes #56459.
17659
17660 2004-04-27  Martin Baulig  <martin@ximian.com>
17661
17662         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17663         we're not attempting to use an indexer.  Fixes #52154.
17664
17665 2004-04-27  Martin Baulig  <martin@ximian.com>
17666
17667         * statement.cs (Return): Don't create a return label if we don't
17668         need it; reverts my change from January 20th.  Thanks to Ben
17669         Maurer for this.
17670
17671 2004-04-27  Martin Baulig  <martin@ximian.com>
17672
17673         According to the spec, `goto' can only leave a nested scope, but
17674         never enter it.
17675
17676         * statement.cs (Block.LookupLabel): Only lookup in the current
17677         block, don't recurse into parent or child blocks.
17678         (Block.AddLabel): Check in parent and child blocks, report
17679         CS0140/CS0158 if we find a duplicate.
17680         (Block): Removed this indexer for label lookups.
17681         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17682         this already does the error reporting for us.
17683
17684         * flowanalysis.cs
17685         (FlowBranching.UsageVector.Block): New public variable; may be null.
17686         (FlowBranching.CreateSibling): Added `Block' argument.
17687         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17688         label for the target of a `goto' and check whether we're not
17689         leaving a `finally'.
17690
17691 2004-04-27  Martin Baulig  <martin@ximian.com>
17692
17693         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17694         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17695         just for returns).
17696
17697 2004-04-27  Martin Baulig  <martin@ximian.com>
17698
17699         * statement.cs (Block.AddLabel): Also check for implicit blocks
17700         and added a CS0158 check.
17701
17702 2004-04-27  Martin Baulig  <martin@ximian.com>
17703
17704         * flowanalysis.cs (FlowBranchingLoop): New class.
17705         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17706         UsageVector's instead of an ArrayList.
17707         (FlowBranching.Label): Likewise.
17708         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17709         (FlowBranching.AddBreakVector): New method.
17710
17711 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17712
17713         * attribute.cs: Small regression fix: only convert the type if we
17714         the type is different, fixes System.Drawing build.
17715
17716 2004-04-27  Martin Baulig  <martin@ximian.com>
17717
17718         * attribute.cs (Attribute.Resolve): If we have a constant value
17719         for a named field or property, implicity convert it to the correct
17720         type.
17721
17722 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17723
17724         * statement.cs (Block.Block): Implicit blocks share
17725         'child_variable_names' fields with parent blocks.
17726         (Block.AddChildVariableNames): Remove.
17727         (Block.AddVariable): Mark variable as "used by a child block" in
17728         every surrounding block.
17729         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17730         been used in a child block, complain about violation of "Invariant
17731         meaning in blocks" rule.
17732         * cs-parser.jay (declare_local_variables): Don't use
17733         AddChildVariableNames.
17734         (foreach_statement): Don't create an implicit block: 'foreach'
17735         introduces a scope.
17736
17737 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17740         converting from 0L to ulong.  Fixes 57522.
17741
17742 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17743
17744         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17745         derived class hides via 'new' keyword field from base class (test-242.cs).
17746         TODO: Handle this in the more general way.
17747         
17748         * class.cs (CheckBase): Ditto.
17749
17750 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17751
17752         * decl.cs (caching_flags): New member for storing cached values
17753         as bit flags.
17754         (MemberCore.Flags): New enum where bit flags for caching_flags
17755         are defined.
17756         (MemberCore.cls_compliance): Moved to caching_flags.
17757         (DeclSpace.Created): Moved to caching_flags.
17758
17759         * class.cs: Use caching_flags instead of DeclSpace.Created
17760         
17761 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17764         if we are only a derived class, not a nested class.
17765
17766         * typemanager.cs: Same as above, but do this at the MemberLookup
17767         level (used by field and methods, properties are handled in
17768         PropertyExpr).   Allow for the qualified access if we are a nested
17769         method. 
17770
17771 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17772
17773         * class.cs: Refactoring.
17774         (IMethodData): New inteface; Holds links to parent members
17775         to avoid member duplication (reduced memory allocation).
17776         (Method): Implemented IMethodData interface.
17777         (PropertyBase): New inner classes for get/set methods.
17778         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17779         (Event): New inner classes for add/remove methods.
17780         (Event.DelegateMethod): Implemented IMethodData interface.
17781
17782         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17783         EmitContext (related to class.cs refactoring).
17784
17785 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17786
17787         * delegate.cs (Delegate.VerifyApplicability): If the number of
17788         arguments are the same as the number of parameters, first try to
17789         verify applicability ignoring  any 'params' modifier on the last
17790         parameter.
17791         Fixes #56442.
17792
17793 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17794
17795         * class.cs (TypeContainer.AddIndexer): Use
17796         'ExplicitInterfaceName' to determine if interface name was
17797         explicitly specified.  'InterfaceType' is not initialized at this time.
17798         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17799         Indexers array is already in the required order.  Initialize
17800         'IndexerName' only if there are normal indexers.
17801         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17802         (TypeContainer.Emit): Emit DefaultMember attribute only if
17803         IndexerName is initialized.
17804         Fixes #56300.
17805
17806 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17807
17808         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17809         Fixes #57007
17810
17811 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17812
17813         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17814         attributes.
17815         Fix for #56456.
17816
17817         * attribute.cs (Attribute.Resolve): Check for duplicate named
17818         attributes.
17819         Fix for #56463.
17820
17821 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17822
17823         * iterators.cs (MarkYield): track whether we are in an exception,
17824         and generate code accordingly.  Use a temporary value to store the
17825         result for our state.
17826
17827         I had ignored a bit the interaction of try/catch with iterators
17828         since their behavior was not entirely obvious, but now it is
17829         possible to verify that our behavior is the same as MS .NET 2.0
17830
17831         Fixes 54814
17832
17833 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17834
17835         * iterators.cs: Avoid creating temporaries if there is no work to
17836         do. 
17837
17838         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17839         Enumerations, use TypeManager.EnumToUnderlying and call
17840         recursively. 
17841
17842         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17843         bug #57013
17844
17845         (This.Emit): Use EmitContext.EmitThis to emit our
17846         instance variable.
17847
17848         (This.EmitAssign): Ditto.
17849
17850         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17851         codepaths, we will move all the functionality into
17852         Mono.CSharp.This 
17853
17854         (FieldExpr.EmitAssign): Ditto.
17855
17856         This fixes several hidden bugs that I uncovered while doing a code
17857         review of this today.
17858
17859         * codegen.cs (EmitThis): reworked so the semantics are more clear
17860         and also support value types "this" instances.
17861
17862         * iterators.cs: Changed so that for iterators in value types, we
17863         do not pass the value type as a parameter.  
17864
17865         Initialization of the enumerator helpers is now done in the caller
17866         instead of passing the parameters to the constructors and having
17867         the constructor set the fields.
17868
17869         The fields have now `assembly' visibility instead of private.
17870
17871 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17872
17873         * expression.cs (Argument.Resolve): Check if fields passed as ref
17874         or out are contained in a MarshalByRefObject.
17875
17876         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17877         another compiler type.
17878
17879 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17880
17881         * class.cs (Indexer.Define): use the new name checking method.
17882         Also, return false on an error.
17883         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17884         (is_identifier_[start/part]_character): make static.
17885
17886 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * expression.cs (Binary.ResolveOperator): Do no append strings
17889         twice: since we can be invoked more than once (array evaluation)
17890         on the same concatenation, take care of this here.  Based on a fix
17891         from Ben (bug #56454)
17892
17893 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17894
17895         * codegen.cs: Fix another case where CS1548 must be reported (when 
17896         delay-sign isn't specified and no private is available #56564). Fix
17897         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17898         error when MCS is used on the MS runtime and we need to delay-sign 
17899         (which seems unsupported by AssemblyBuilder - see #56621).
17900
17901 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17902
17903         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17904         (TypeManager.ComputeNamespaces): Faster implementation for
17905         Microsoft runtime.
17906
17907         * compiler.csproj: Updated AssemblyName to mcs.
17908
17909 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17910
17911         * rootcontext.cs: Add new types to the boot resolution.
17912
17913         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17914         MulticastDelegate is not allowed.
17915
17916         * typemanager.cs: Add new types to lookup: System.TypedReference
17917         and ArgIterator.
17918
17919         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17920         check for TypedReference or ArgIterator, they are not allowed. 
17921
17922         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17923         makes us properly catch 1510 in some conditions (see bug 56016 for
17924         details). 
17925
17926 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17927
17928         * CryptoConvert.cs: update from corlib version
17929         with endian fixes.
17930
17931 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * class.cs (Indexer.Define): Check indexername declaration
17934
17935 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17936
17937         * attribute.cs (IsClsCompliant): Fixed problem with handling
17938         all three states (compliant, not-compliant, undetected).
17939
17940 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17941
17942         * attribute.cs (Attribute): Location is now public.
17943         (Resolve): Store resolved arguments (pos_values) in attribute class.
17944         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17945         (GetClsCompliantAttributeValue): New method that gets
17946         CLSCompliantAttribute value.
17947         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17948         if exists else null.
17949         (AttributeTester): New class for CLS-Compliant verification routines.
17950
17951         * class.cs (Emit): Add CLS-Compliant verification.
17952         (Method.GetSignatureForError): Implemented.
17953         (Constructor.GetSignatureForError): Implemented
17954         (Constructor.HasCompliantArgs): Returns if constructor has
17955         CLS-Compliant arguments.
17956         (Constructor.Emit): Override.
17957         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17958         is needed to test only parameters.
17959         (FieldBase.GetSignatureForError): Implemented.
17960         (TypeContainer): New member for storing base interfaces.
17961         (TypeContainer.FindMembers): Search in base interfaces too.
17962
17963         * codegen.cs (GetClsComplianceAttribute): New method that gets
17964         assembly or module CLSCompliantAttribute value.
17965         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17966         for assembly.
17967         (ModuleClass.Emit): Add error 3012 test.
17968
17969         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17970
17971         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17972         state for all decl types.
17973         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17974         if CLS-Compliant tests are required.
17975         (IsClsCompliaceRequired): New method. Analyze whether code
17976         must be CLS-Compliant.
17977         (IsExposedFromAssembly): New method. Returns true when MemberCore
17978         is exposed from assembly.
17979         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17980         value or gets cached value.
17981         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17982         is explicitly marked with CLSCompliantAttribute.
17983         (IsIdentifierClsCompliant): New abstract method. This method is
17984         used to testing error 3005.
17985         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17986         for identifier and parameters CLS-Compliant testing.
17987         (VerifyClsCompliance): New method. The main virtual method for
17988         CLS-Compliant verifications.
17989         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17990         null. I don't know why is null (too many public members !).
17991         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17992         and get value of first CLSCompliantAttribute that found.
17993
17994         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17995         (VerifyClsCompliance): Override and add extra tests.
17996
17997         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17998         clscheck- disable CLS-Compliant verification event if assembly is has
17999         CLSCompliantAttribute(true).
18000
18001         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
18002         ApllyAttribute is now called in emit section as in the other cases.
18003         Possible future Emit integration.
18004         (IsIdentifierClsCompliant): New override.
18005         (VerifyClsCompliance): New override.
18006         (GetEnumeratorName): Returns full enum name.
18007
18008         * parameter.cs (GetSignatureForError): Implemented.
18009
18010         * report.cs (WarningData): New struct for Warning message information.
18011         (LocationOfPreviousError): New method.
18012         (Warning): New method. Reports warning based on the warning table.
18013         (Error_T): New method. Reports error based on the error table.
18014
18015         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
18016         verifications are done here.
18017
18018         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
18019
18020         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
18021         CLSCompliantAttribute.
18022         (all_imported_types): New member holds all imported types from other
18023         assemblies.
18024         (LoadAllImportedTypes): New method fills static table with exported types
18025         from all referenced assemblies.
18026         (Modules): New property returns all assembly modules.
18027
18028 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
18029
18030         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
18031         throwing a parser error.
18032
18033         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
18034         which removes the hardcoded get_/set_ prefixes for properties, as
18035         IL allows for the properties to be named something else.  
18036
18037         Bug #56013
18038
18039         * expression.cs: Do not override operand before we know if it is
18040         non-null.  Fix 56207
18041
18042 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18043
18044         * typemanager.cs: support for pinned variables.
18045
18046 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18047
18048         * decl.cs, typemanager.cs: Avoid using an arraylist
18049         as a buffer if there is only one result set.
18050
18051 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18052
18053         * expression.cs: Make sure you cant call a static method
18054         with an instance expression, bug #56174.
18055
18056 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
18057
18058         * class.cs (IsDuplicateImplementation): Improve error reporting to
18059         flag 663 (method only differs in parameter modifier).
18060
18061         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
18062         in preprocessor directives.
18063
18064         * location.cs (LookupFile): Allow for the empty path.
18065
18066         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
18067         better approach for some of that patch, but its failing with the
18068         CharSet enumeration.  For now try/catch will do.
18069
18070         * typemanager.cs: Do not crash if a struct does not have fields.
18071         Fixes 56150.
18072
18073 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18074
18075         * expression.cs: cs0213, cant fix a fixed expression.
18076         fixes 50231.
18077
18078 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18079
18080         * cs-parser.jay: detect invalid embeded statements gracefully.
18081         bug #51113.
18082
18083 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18084
18085         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
18086         As a regex:
18087         s/
18088         the invocation type may not be a subclass of the tye of the item/
18089         The type of the item must be a subclass of the invocation item.
18090         /g
18091
18092         Fixes bug #50820.
18093
18094 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
18095
18096         * attribute.cs: Added methods to get a string and a bool from an
18097         attribute. Required to information from AssemblyKeyFileAttribute,
18098         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18099         * codegen.cs: Modified AssemblyName creation to include support for
18100         strongnames. Catch additional exceptions to report them as CS1548.
18101         * compiler.csproj: Updated include CryptoConvert.cs.
18102         * compiler.csproj.user: Removed file - user specific configuration.
18103         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
18104         Mono.Security assembly. The original class is maintained and tested in
18105         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18106         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18107         like CSC 8.0 (C# v2) supports.
18108         * Makefile: Added CryptoConvert.cs to mcs sources.
18109         * rootcontext.cs: Added new options for strongnames.
18110
18111 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
18112
18113         * driver.cs: For --expect-error, report error code `2'
18114         if the program compiled with no errors, error code `1' if
18115         it compiled with an error other than the one expected.
18116
18117 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
18118
18119         * compiler.csproj: Updated for Visual Studio .NET 2003.
18120         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18121         * compiler.sln: Updated for Visual Studio .NET 2003.
18122
18123 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
18124
18125         * expression.cs: Fix bug #47234. We basically need to apply the
18126         rule that we prefer the conversion of null to a reference type
18127         when faced with a conversion to 'object' (csc behaviour).
18128
18129 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18130
18131         * statement.cs: Shorter form for foreach, eliminates
18132         a local variable. r=Martin.
18133
18134 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18135
18136         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18137         checks if we can use brtrue/brfalse to test for 0.
18138         * expression.cs: use the above in the test for using brtrue/brfalse.
18139         cleanup code a bit.
18140
18141 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18142
18143         * expression.cs: Rewrite string concat stuff. Benefits:
18144
18145         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18146         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18147         rather than a concat chain.
18148
18149         * typemanager.cs: Add lookups for more concat overloads.
18150
18151 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18152
18153         * expression.cs: Emit shorter il code for array init.
18154
18155         newarr
18156         dup
18157         // set 1
18158
18159         // set 2
18160
18161         newarr
18162         stloc.x
18163
18164         ldloc.x
18165         // set 1
18166
18167         ldloc.x
18168         // set 2
18169
18170 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
18171
18172         * statement.cs: Before, two switch blocks would be merged if the
18173         total size of the blocks (end_item - begin_item + 1) was less than
18174         two times the combined sizes of the blocks.
18175
18176         Now, it will only merge if after the merge at least half of the
18177         slots are filled.
18178
18179         fixes 55885.
18180
18181 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
18182
18183         * class.cs : csc build fix for GetMethods(). See bug #52503.
18184
18185 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
18186
18187         * expression.cs: Make sure fp comparisons work with NaN.
18188         This fixes bug #54303. Mig approved this patch a long
18189         time ago, but we were not able to test b/c the runtime
18190         had a related bug.
18191
18192 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
18195
18196 2004-03-19  Martin Baulig  <martin@ximian.com>
18197
18198         * class.cs (MemberCore.IsDuplicateImplementation): Report the
18199         error here and not in our caller.
18200
18201 2004-03-19  Martin Baulig  <martin@ximian.com>
18202
18203         * interface.cs: Completely killed this file.
18204         (Interface): We're now a TypeContainer and live in class.cs.
18205
18206         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18207         argument; we're now also called for interfaces.
18208         (TypeContainer.DefineMembers): Allow this method being called
18209         multiple times.
18210         (TypeContainer.GetMethods): New public method; formerly known as
18211         Interface.GetMethod().  This is used by PendingImplementation.
18212         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18213         it's now private and non-static.
18214         (Interface): Moved this here; it's now implemented similar to
18215         Class and Struct.
18216         (Method, Property, Event, Indexer): Added `bool is_interface'
18217         argument to their .ctor's.
18218         (MemberBase.IsInterface): New public field.
18219
18220         * cs-parser.jay: Create normal Method, Property, Event, Indexer
18221         instances instead of InterfaceMethod, InterfaceProperty, etc.
18222         (opt_interface_base): Removed; we now use `opt_class_base' instead.
18223         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18224
18225 2004-03-19  Martin Baulig  <martin@ximian.com>
18226
18227         * class.cs (MethodCore.IsDuplicateImplementation): New private
18228         method which does the CS0111 checking.
18229         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18230         Use IsDuplicateImplementation().
18231
18232 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
18233
18234         * decl.cs (FindMemberToOverride): New method to find the correct
18235         method or property to override in the base class.
18236         * class.cs
18237             - Make Method/Property use the above method to find the
18238               version in the base class.
18239             - Remove the InheritableMemberSignatureCompare as it is now
18240               dead code.
18241
18242         This patch makes large code bases much faster to compile, as it is
18243         O(n) rather than O(n^2) to do this validation.
18244
18245         Also, it fixes bug 52458 which is that nested classes are not
18246         taken into account when finding the base class member.
18247
18248         Reviewed/Approved by Martin.
18249
18250 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
18251
18252         * interface.cs: In all interface classes removed redundant
18253         member initialization.
18254
18255 2004-03-16  Martin Baulig  <martin@ximian.com>
18256
18257         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18258
18259 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
18260
18261         * decl.cs (DefineTypeAndParents): New helper method to define a
18262         type's containers before the type itself is defined;  This is a
18263         bug exposed by the recent changes to Windows.Forms when an
18264         implemented interface was defined inside a class that had not been
18265         built yet.   
18266
18267         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18268
18269         (Check): Loop correctly to report errors modifiers
18270         (UNSAFE was not in the loop, since it was the same as TOP).
18271
18272         * interface.cs: Every interface member now takes a ModFlags,
18273         instead of a "is_new" bool, which we set on the base MemberCore. 
18274
18275         Every place where we called "UnsafeOk" in the interface, now we
18276         call the proper member (InterfaceMethod.UnsafeOK) instead to get
18277         the unsafe settings from the member declaration instead of the
18278         container interface. 
18279
18280         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
18281
18282         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18283         `set_indexer_name' to the pending bits (one per type).
18284
18285         We fixed a bug today that was picking the wrong method to
18286         override, since for properties the existing InterfaceMethod code
18287         basically ignored the method name.  Now we make sure that the
18288         method name is one of the valid indexer names.
18289
18290 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
18291  
18292         * support.cs (SeekableStreamReader): Keep track of stream byte
18293         positions and don't mix them with character offsets to the buffer.
18294
18295         Patch from Gustavo Giráldez
18296
18297 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
18298
18299         * interface.cs (InterfaceSetGetBase): Removed double member
18300         initialization, base class does it as well.
18301
18302 2004-03-13  Martin Baulig  <martin@ximian.com>
18303
18304         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18305         when compiling corlib.
18306
18307 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * convert.cs (ExplicitConversion): We were reporting an error on
18310         certain conversions (object_type source to a value type, when the
18311         expression was `null') before we had a chance to pass it through
18312         the user defined conversions.
18313
18314         * driver.cs: Replace / and \ in resource specifications to dots.
18315         Fixes 50752
18316
18317         * class.cs: Add check for duplicate operators.  Fixes 52477
18318
18319 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
18320
18321         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18322         that are in the middle of the statements, not only at the end.
18323         Fixes #54987
18324
18325         * class.cs (TypeContainer.AddField): No longer set the
18326         `HaveStaticConstructor' flag, now we call it
18327         `UserDefineStaticConstructor' to diferentiate the slightly
18328         semantic difference.
18329
18330         The situation is that we were not adding BeforeFieldInit (from
18331         Modifiers.TypeAttr) to classes that could have it.
18332         BeforeFieldInit should be set to classes that have no static
18333         constructor. 
18334
18335         See:
18336
18337         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18338
18339         And most importantly Zoltan's comment:
18340
18341         http://bugzilla.ximian.com/show_bug.cgi?id=44229
18342
18343         "I think beforefieldinit means 'it's ok to initialize the type sometime 
18344          before its static fields are used', i.e. initialization does not need
18345          to be triggered by the first access to the type. Setting this flag
18346          helps the JIT to compile better code, since it can run the static
18347          constructor at JIT time, and does not need to generate code to call it
18348          (possibly lots of times) at runtime. Unfortunately, mcs does not set
18349          this flag for lots of classes like String. 
18350          
18351          csc sets this flag if the type does not have an explicit static 
18352          constructor. The reasoning seems to be that if there are only static
18353          initalizers for a type, and no static constructor, then the programmer
18354          does not care when this initialization happens, so beforefieldinit
18355          can be used.
18356          
18357          This bug prevents the AOT compiler from being usable, since it 
18358          generates so many calls to mono_runtime_class_init that the AOT code
18359          is much slower than the JITted code. The JITted code is faster, 
18360          because it does not generate these calls if the vtable is type is
18361          already initialized, which is true in the majority of cases. But the
18362          AOT compiler can't do this."
18363
18364 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * class.cs (MethodData.Emit): Refactor the code so symbolic
18367         information is generated for destructors;  For some reasons we
18368         were taking a code path that did not generate symbolic information
18369         before. 
18370
18371 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18372
18373         * class.cs: Create a Constructor.CheckBase method that
18374         takes care of all validation type code. The method
18375         contains some code that was moved from Define.
18376
18377         It also includes new code that checks for duplicate ctors.
18378         This fixes bug #55148.
18379
18380 2004-03-09  Joshua Tauberer <tauberer@for.net>
18381
18382         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18383         a { ... }-style array creation invokes EmitStaticInitializers
18384         which is not good for reference-type arrays.  String, decimal
18385         and now null constants (NullCast) are not counted toward
18386         static initializers.
18387
18388 2004-03-05  Martin Baulig  <martin@ximian.com>
18389
18390         * location.cs (SourceFile.HasLineDirective): New public field;
18391         specifies whether the file contains or is referenced by a "#line"
18392         directive.
18393         (Location.DefineSymbolDocuments): Ignore source files which
18394         either contain or are referenced by a "#line" directive.        
18395
18396 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
18397
18398         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18399         direct access to our parent, so check the method inline there.
18400
18401 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18402
18403         * expression.cs (Invocation.EmitCall): Miguel's last commit
18404         caused a regression. If you had:
18405
18406             T t = null;
18407             t.Foo ();
18408
18409         In Foo the implict this would be null.
18410
18411 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
18412
18413         * expression.cs (Invocation.EmitCall): If the method is not
18414         virtual, do not emit a CallVirt to it, use Call.
18415
18416         * typemanager.cs (GetFullNameSignature): Improve the method to
18417         cope with ".ctor" and replace it with the type name.
18418
18419         * class.cs (ConstructorInitializer.Resolve): Now the method takes
18420         as an argument the ConstructorBuilder where it is being defined,
18421         to catch the recursive constructor invocations.
18422
18423 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
18424
18425         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18426         routines to check if a type is an enumerable/enumerator allow
18427         classes that implement the IEnumerable or IEnumerator interfaces.
18428
18429         * class.cs (Property, Operator): Implement IIteratorContainer, and
18430         implement SetYields.
18431
18432         (Property.Define): Do the block swapping for get_methods in the
18433         context of iterators.   We need to check if Properties also
18434         include indexers or not.
18435
18436         (Operator): Assign the Block before invoking the
18437         OperatorMethod.Define, so we can trigger the Iterator code
18438         replacement. 
18439
18440         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
18441         Property and Operator classes are not created when we parse the
18442         declarator but until we have the block completed, so we use a
18443         singleton SimpleIteratorContainer.Simple to flag whether the
18444         SetYields has been invoked.
18445
18446         We propagate this setting then to the Property or the Operator to
18447         allow the `yield' to function.
18448
18449 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
18450
18451         * codegen.cs: Implemented attribute support for modules.
18452         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18453         Assembly/Module functionality.
18454
18455         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18456         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18457         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18458
18459 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
18460
18461         * interface.cs (FindMembers): The operation is performed on all base
18462         interfaces and not only on the first. It is required for future CLS Compliance patch.
18463
18464 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18465
18466         * statement.cs, codegen.cs:
18467         This patch deals with patterns such as:
18468
18469         public class List : IEnumerable {
18470
18471                 public MyEnumerator GetEnumerator () {
18472                         return new MyEnumerator(this);
18473                 }
18474
18475                 IEnumerator IEnumerable.GetEnumerator () {
18476                         ...
18477                 }
18478                 
18479                 public struct MyEnumerator : IEnumerator {
18480                         ...
18481                 }
18482         }
18483
18484         Before, there were a few things we did wrong:
18485         1) we would emit callvirt on a struct, which is illegal
18486         2) we emited ldarg when we needed to emit ldarga
18487         3) we would mistakenly call the interface methods on an enumerator
18488         type that derived from IEnumerator and was in another assembly. For example:
18489
18490         public class MyEnumerator : IEnumerator
18491
18492         Would have the interface methods called, even if there were public impls of the
18493         method. In a struct, this lead to invalid IL code.
18494
18495 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
18496
18497         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18498           renamed to Emit.
18499
18500         * delegate.cs (Define): Fixed crash when delegate type is undefined.
18501
18502 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
18503
18504         * cs-parser.jay: Fix small regression: we were not testing V2
18505         compiler features correctly.
18506
18507         * interface.cs: If the emit context is null, then create one
18508
18509 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
18510
18511         * decl.cs (GetSignatureForError): New virtual method to get full name
18512           for error messages.
18513
18514         * attribute.cs (IAttributeSupport): New interface for attribute setting.
18515           Now it is possible to rewrite ApplyAttributes method to be less if/else.
18516
18517         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18518           Duplicated members and code in these classes has been removed.
18519           Better encapsulation in these classes.
18520
18521 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
18522
18523         * assign.cs (Assign.DoResolve): When dealing with compound
18524         assignments, there is a new rule in ECMA C# 2.4 (might have been
18525         there before, but it is documented here) that states that in:
18526
18527         a op= b;
18528
18529         If b is of type int, and the `op' is a shift-operator, then the
18530         above is evaluated as:
18531
18532         a = (int) a op b 
18533
18534         * expression.cs (Binary.ResolveOperator): Instead of testing for
18535         int/uint/long/ulong, try to implicitly convert to any of those
18536         types and use that in pointer arithmetic.
18537
18538         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18539         method to print information for from the type, not from the
18540         null-method we were given.
18541
18542 2004-02-01  Duncan Mak  <duncan@ximian.com>
18543
18544         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18545         parsing for cmd, fixes bug #53694.
18546
18547 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
18548
18549         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18550         in the member name duplication tests. Property and operator name duplication
18551         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18552
18553 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
18554
18555         * interface.cs (PopulateMethod): Fixed crash when interface method
18556         returns not existing type (error test cs0246-3.cs).
18557
18558 2004-02-02  Ravi Pratap M <ravi@ximian.com>
18559
18560         * cs-parser.jay (interface_accessors): Re-write actions to also
18561         store attributes attached to get and set methods. Fix spelling
18562         while at it.
18563
18564         (inteface_property_declaration): Modify accordingly.
18565
18566         (InterfaceAccessorInfo): New helper class to store information to pass
18567         around between rules that use interface_accessors.
18568
18569         * interface.cs (Emit): Apply attributes on the get and set
18570         accessors of properties and indexers too.
18571
18572         * attribute.cs (ApplyAttributes): Modify accordingly to use the
18573         right MethodBuilder when applying attributes to the get and set accessors.
18574
18575 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
18576
18577         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18578
18579 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
18580
18581         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18582
18583 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * cs-parser.jay: Remove YIELD token, instead use the new grammar
18586         changes that treat `yield' specially when present before `break'
18587         or `return' tokens.
18588
18589         * cs-tokenizer.cs: yield is no longer a keyword.
18590
18591 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
18592
18593         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18594         setting for default constructors.
18595         For default constructors are almost every time set wrong Modifier. The
18596         generated IL code has been alright. But inside mcs this values was
18597         wrong and this was reason why several of my CLS Compliance tests
18598         failed.
18599
18600 2004-01-22  Martin Baulig  <martin@ximian.com>
18601
18602         * cs-parser.jay (namespace_or_type_name): Return an Expression,
18603         not a QualifiedIdentifier.  This is what `type_name_expression'
18604         was previously doing.
18605         (type_name_expression): Removed; the code is now in
18606         `namespace_or_type_name'.
18607         (qualified_identifier): Removed, use `namespace_or_type_name'
18608         instead.
18609         (QualifiedIdentifier): Removed this class.      
18610
18611 2004-01-22  Martin Baulig  <martin@ximian.com>
18612
18613         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18614         not a string as alias name.
18615
18616 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
18617
18618         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18619         #52730 bug, and instead compute correctly the need to use a
18620         temporary variable when requesting an address based on the
18621         static/instace modified of the field and the constructor.
18622  
18623 2004-01-21  Martin Baulig  <martin@ximian.com>
18624
18625         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18626         class and namespace before looking up aliases.  Fixes #52517.
18627
18628 2004-01-21  Martin Baulig  <martin@ximian.com>
18629
18630         * flowanalysis.cs (UsageVector.Merge): Allow variables being
18631         assinged in a 'try'; fixes exception4.cs.
18632
18633 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18634         * class.cs : Implemented parameter-less constructor for TypeContainer
18635
18636         * decl.cs: Attributes are now stored here. New property OptAttributes
18637
18638         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18639
18640         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18641
18642 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18643
18644         * typemanager.cs (CSharpSignature): Now reports also inner class name.
18645           (CSharpSignature): New method for indexer and property signature.
18646
18647 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18648
18649         * pending.cs (IsVirtualFilter): Faster implementation.
18650
18651 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18652
18653         * typemanager.cs: Avoid inclusion of same assembly more than once.
18654
18655 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18656
18657         * cs-parser.jay: Fixed problem where the last assembly attribute
18658           has been applied also to following declaration (class, struct, etc.)
18659           
18660 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18661
18662         * class.cs: Added error CS0538, CS0539 reporting.
18663         Fixed crash on Microsoft runtime when field type is void.
18664
18665         * cs-parser.jay: Added error CS0537 reporting.
18666
18667         * pending.cs: Added error CS0535 reporting.
18668         Improved error report for errors CS0536, CS0534.
18669
18670 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18671
18672         Merge a few bits from the Anonymous Method MCS tree.
18673
18674         * statement.cs (ToplevelBlock): New class for toplevel methods,
18675         will hold anonymous methods, lifted variables.
18676
18677         * cs-parser.jay: Create toplevel blocks for delegates and for
18678         regular blocks of code. 
18679
18680 2004-01-20  Martin Baulig  <martin@ximian.com>
18681
18682         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18683         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18684         and `NeedExplicitReturn'; added `IsLastStatement'.
18685         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18686         have a `ReturnLabel' or we're not unreachable.
18687
18688         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18689         child's reachability; don't just override ours with it.  Fixes
18690         #58058 (lluis's example).
18691         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18692         InFinally(), InLoop(), InSwitch() and
18693         BreakCrossesTryCatchBoundary() methods.
18694
18695         * statement.cs (Return): Do all error checking in Resolve().
18696         Unless we are the last statement in a top-level block, always
18697         create a return label and jump to it.
18698         (Break, Continue): Do all error checking in Resolve(); also make
18699         sure we aren't leaving a `finally'.
18700         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18701         statement in a top-level block.
18702         (Block.Flags): Added `IsDestructor'.
18703         (Block.IsDestructor): New public property.
18704
18705 2004-01-20  Martin Baulig  <martin@ximian.com>
18706
18707         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18708
18709 2004-01-20  Martin Baulig  <martin@ximian.com>
18710
18711         * statement.cs (Statement.ResolveUnreachable): New public method.
18712         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18713         (Block.Resolve): Resolve unreachable statements.
18714
18715 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18716
18717         * expression.cs: We need to fix the case where we do
18718         not have a temp variable here.
18719
18720         * assign.cs: Only expression compound assignments need
18721         temporary variables.
18722
18723 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18724
18725         * flowanalysis.cs: Reduce memory allocation in a few ways:
18726           - A block with no variables should not allocate a bit
18727             vector for itself.
18728           - A method with no out parameters does not need any tracking
18729             for assignment of the parameters, so we need not allocate
18730             any data for it.
18731           - The arrays:
18732                 public readonly Type[] VariableTypes;
18733                 public readonly string[] VariableNames;
18734             Are redundant. The data is already stored in the variable
18735             map, so we need not allocate another array for it.
18736           - We need to add alot of checks for if (params | locals) == null
18737             due to the first two changes.
18738
18739 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18740
18741         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18742         implement IMemoryLocation, we store a copy on a local variable and
18743         take the address of it.  Patch from Benjamin Jemlich
18744
18745         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18746         to use a special "type_name_expression" rule which reduces the
18747         number of "QualifiedIdentifier" classes created, and instead
18748         directly creates MemberAccess expressions.
18749
18750 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18751
18752         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18753         that fixes #52853.  Null literal assignment to ValueType
18754
18755         * class.cs (MethodData.Emit): Instead of checking the name of the
18756         method to determine if its a destructor, create a new derived
18757         class from Method called Destructor, and test for that.  
18758
18759         * cs-parser.jay: Create a Destructor object instead of a Method.  
18760
18761         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18762
18763         Fixes: 52933
18764
18765 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18766
18767         * expression.cs (Binary.ResolveOperator): Perform an implicit
18768         conversion from MethodGroups to their delegate types on the
18769         Addition operation.
18770
18771         * delegate.cs: Introduce a new class DelegateCreation that is the
18772         base class for `NewDelegate' and `ImplicitDelegateCreation',
18773         factor some code in here.
18774
18775         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18776         conversion from MethodGroups to compatible delegate types. 
18777
18778         * ecore.cs (Expression.Resolve): Do not flag error 654
18779         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18780         we allow conversions from MethodGroups to delegate types now.
18781
18782         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18783         assignments in v2 either.
18784
18785 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18786
18787         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18788         static read-only fields in ctors.
18789
18790         Applied patch from Benjamin Jemlich 
18791
18792         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18793
18794 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18797         here to return true, as they can be used like this:
18798
18799                 (XXX) int.MEMBER ()
18800
18801         Fixed 49836 and all the other dups
18802
18803 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18804
18805         * driver.cs: Implement /win32res and /win32icon.
18806
18807 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18808
18809         * cs-parser.jay: Add a rule to improve error handling for the
18810         common mistake of placing modifiers after the type.
18811
18812 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18813
18814         * cs-parser.jay (interface_event_declaration): Catch
18815         initialization of events on interfaces, and report cs0068
18816
18817         * cs-parser.jay (interface_event_declaration): Catch
18818         initialization of events. 
18819
18820         * ecore.cs: Better report missing constructors.
18821
18822         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18823         the error reporting done in the wrong place.  Fix.
18824
18825         * expression.cs (Binary.ResolveOperator): Catch the 
18826         operator + (E x, E y) error earlier, and later allow for implicit
18827         conversions in operator +/- (E e, U x) from U to the underlying
18828         type of E.
18829
18830         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18831         52596, if the container class is abstract, the default constructor
18832         is protected otherwise its public (before, we were always public).
18833
18834         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18835         fixed statement.
18836
18837         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18838         Jemlich that fixes bug #52597, MCS was generating invalid code for
18839         idisposable structs.   Thanks to Ben for following up with this
18840         bug as well.
18841
18842 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18843
18844         * driver.cs: Allow assemblies without code to be generated, fixes
18845         52230.
18846
18847 2004-01-07  Nick Drochak <ndrochak@gol.com>
18848
18849         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18850
18851 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18852
18853         * cs-parser.jay: Add rules to improve error reporting if fields or
18854         methods are declared at the namespace level (error 116)
18855
18856         * Add rules to catch event add/remove
18857
18858 2004-01-04  David Sheldon <dave-mono@earth.li>
18859
18860   * expression.cs: Added matching ")" to error message for 
18861   CS0077
18862
18863 2004-01-03 Todd Berman <tberman@gentoo.org>
18864
18865         * ecore.cs, attribute.cs:
18866         Applying fix from #52429.
18867
18868 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18869
18870         * ecore.cs, expression.cs, statement.cs:
18871         Total rewrite of how we handle branching. We
18872         now handle complex boolean expressions with fewer
18873         jumps. As well if (x == 0) no longer emits a ceq.
18874
18875         if (x is Foo) is much faster now, because we generate
18876         better code.
18877
18878         Overall, we get a pretty big improvement on our benchmark
18879         tests. The code we generate is smaller and more readable.
18880
18881         I did a full two-stage bootstrap. The patch was reviewed
18882         by Martin and Miguel.
18883
18884 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18885
18886         * cs-parser.jay: Make primary_expression not take a QI.
18887         we dont need this because the member_access rule covers
18888         us here. So we replace the rule with just IDENTIFIER.
18889
18890         This has two good effects. First, we remove a s/r conflict.
18891         Second, we allocate many fewer QualifiedIdentifier objects.
18892
18893 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18894
18895         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18896         set the correct information via SRE. This prevents
18897         hanging on the MS runtime. Fixes #29374.
18898
18899 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18900
18901         * convert.cs: correctly handle conversions to value types
18902         from Enum and ValueType as unboxing conversions.
18903
18904         Fixes bug #52569. Patch by Benjamin Jemlich.
18905
18906 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18907
18908         * expression.cs (BetterConversion): Prefer int -> uint
18909         over int -> ulong (csc's behaviour). This fixed bug #52046.
18910
18911 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18912
18913         * decl.cs (MemberCache.FindMembers): now returns a
18914         MemberInfo [].
18915
18916         * typemanager.cs: In general, go with with ^^.
18917         (CopyNewMethods): take an IList.
18918         (RealMemberLookup): Only allocate an arraylist
18919         if we copy from two sets of methods.
18920
18921         This change basically does two things:
18922         1) Fewer array lists allocated due to CopyNewMethods.
18923         2) the explicit cast in MemberList costed ALOT.
18924
18925 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18926
18927         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18928         a hashtable to avoid needless string allocations when an identifier is
18929         used more than once (the common case).
18930
18931 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18932
18933         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18934         is broken, it will not return anything. So, we
18935         have to use the information we have in mcs to
18936         do the task.
18937
18938         * typemanager.cs: Add a cache for GetInterfaces,
18939         since this will now be used more often (due to ^^)
18940
18941         (GetExplicitInterfaces) New method that gets the
18942         declared, not effective, interfaces on a type
18943         builder (eg, if you have interface IFoo, interface
18944         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18945         { IBar }.
18946
18947         This patch makes MCS able to bootstrap itself on
18948         Windows again.
18949
18950 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18951
18952         * expression.cs: Remove the Nop's that Miguel put
18953         in by mistake.
18954
18955 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18956
18957         * report.cs, codegen.cs: Give the real stack trace to
18958         the error when an exception is thrown.
18959
18960 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18961
18962         * decl.cs: only allocate hashtables for ifaces if 
18963         it is an iface!
18964
18965 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18966
18967         * expression.cs: fix the error from cs0121-2.cs
18968         (a parent interface has two child interfaces that
18969         have a function with the same name and 0 params
18970         and the function is called through the parent).
18971
18972 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18973
18974         * class.cs, rootcontext.cs, typmanager.cs: do not
18975         leak pointers.
18976
18977 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18978
18979         * codegen.cs: remove stack for the ec flow branching.
18980         It is already a linked list, so no need.
18981
18982 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18983
18984         * Makefile: Allow custom profiler here.
18985
18986 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18987
18988         * typemanager.cs (LookupType):
18989           - Use a static char [], because split takes
18990             a param array for args, so it was allocating
18991             every time.
18992           - Do not store true in a hashtable, it boxes.
18993
18994 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18995
18996         * flowanalysis.cs: bytify common enums.
18997
18998 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18999
19000         * modifiers.cs: Add a new set of flags for the
19001         flags allowed on explicit interface impls.
19002         * cs-parser.jay: catch the use of modifiers in
19003         interfaces correctly.
19004         * class.cs: catch private void IFoo.Blah ().
19005
19006         All related to bug #50572.
19007
19008 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19009
19010         * decl.cs: Rewrite the consistant accessability checking.
19011         Accessability is not linear, it must be implemented in
19012         a tableish way. Fixes #49704.
19013
19014 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19015
19016         * expression.cs: Handle negation in a checked context.
19017         We must use subtraction from zero. Fixes #38674.
19018
19019 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
19020
19021         * class.cs: Ignore static void main in DLLs.
19022         * rootcontext.cs: Handle the target type here,
19023         since we are have to access it from class.cs
19024         * driver.cs: account for the above.
19025
19026 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
19027
19028         * report.cs: Give line numbers and files if available.
19029
19030 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
19031
19032         * driver.cs: Implement /addmodule.
19033
19034         * typemanager.cs:  Change 'modules' field so it now contains Modules not
19035         ModuleBuilders.
19036
19037 2003-12-20  Martin Baulig  <martin@ximian.com>
19038
19039         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
19040         (FieldBase.IsAssigned): Removed this field.
19041         (FieldBase.SetAssigned): New public method.
19042         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
19043
19044 2003-12-20  Martin Baulig  <martin@ximian.com>
19045
19046         * expression.cs (LocalVariableReference.DoResolve): Don't set
19047         `vi.Used' if we're called from DoResolveLValue().
19048
19049         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
19050         returns the usage vector it just merged into the current one -
19051         pass this one to UsageWarning().
19052         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
19053         of the `EmitContext', don't call this recursively on our children.
19054
19055 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
19056
19057         * driver.cs: Implement /target:module.
19058
19059 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
19060
19061         * support.cs (CharArrayHashtable): New helper class.
19062
19063         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
19064         char arrays, not strings, so we can avoid creating a string in
19065         consume_identifier if the identifier is a keyword.
19066
19067 2003-12-16  Martin Baulig  <martin@ximian.com>
19068
19069         * statement.cs (LocalInfo.Assigned): Removed this property.
19070         (LocalInfo.Flags): Removed `Assigned'.
19071         (LocalInfo.IsAssigned): New public method; takes the EmitContext
19072         and uses flow analysis.
19073         (Block.UsageWarning): Made this method private.
19074         (Block.Resolve): Call UsageWarning() if appropriate.
19075
19076         * expression.cs (LocalVariableReference.DoResolve): Always set
19077         LocalInfo.Used here.
19078
19079 2003-12-13  Martin Baulig  <martin@ximian.com>
19080
19081         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
19082         any value here; we're now using flow analysis to figure out
19083         whether a statement/block returns a value.
19084
19085 2003-12-13  Martin Baulig  <martin@ximian.com>
19086
19087         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
19088         working again.
19089         (FlowBranching.MergeFinally): Don't call
19090         `branching.CheckOutParameters()' here, this is called in
19091         MergeTopBlock().
19092         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19093         when adding the `finally' vector.       
19094
19095 2003-12-13  Martin Baulig  <martin@ximian.com>
19096
19097         * flowanalysis.cs
19098         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19099         actually work and also fix #48962.
19100
19101 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
19102
19103         * decl.cs: Do not check System.Object for nested types,
19104         since we know it does not have any. Big bang for buck:
19105
19106         BEFORE:
19107            Run 1:   8.35 seconds
19108            Run 2:   8.32 seconds
19109            corlib:  17.99 seconds
19110         AFTER:
19111            Run 1:   8.17 seconds
19112            Run 2:   8.17 seconds
19113            corlib:  17.39 seconds
19114
19115 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
19116
19117         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19118         time we are returning 0 members, so we save alot here.
19119
19120 2003-12-11  Martin Baulig  <martin@ximian.com>
19121
19122         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19123         `MergeChild()', also just take the `FlowBranching' as argument;
19124         call Merge() on it and return the result.
19125         (FlowBranching.Merge): We don't need to do anything if we just
19126         have one sibling.
19127
19128 2003-12-11  Martin Baulig  <martin@ximian.com>
19129
19130         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19131         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
19132         Maurer for this idea.
19133
19134 2003-12-11  Martin Baulig  <martin@ximian.com>
19135
19136         * flowanalysis.cs (MergeResult): This class is now gone; we now
19137         use the `UsageVector' for this.  The reason for this is that if a
19138         branching just has one sibling, we don't need to "merge" them at
19139         all - that's the next step to do.
19140         (FlowBranching.Merge): We now return a `UsageVector' instead of a
19141         `MergeResult'.
19142
19143 2003-12-11  Martin Baulig  <martin@ximian.com>
19144
19145         Reworked flow analyis and made it more precise and bug-free.  The
19146         most important change is that we're now using a special `Reachability'
19147         class instead of having "magic" meanings of `FlowReturns'.  I'll
19148         do some more cleanups and optimizations and also add some more
19149         documentation this week.
19150
19151         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19152         largely reworked this class.
19153         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19154         the new `Reachability' class instead of having "magic" values here.
19155         (FlowBranching): We're now using an instance of `Reachability'
19156         instead of having separate `Returns', `Breaks' etc. fields.
19157
19158         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19159         based on flow analysis; ignore the return value of block.Emit ().
19160
19161 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
19162
19163         * driver.cs typemanager.cs: Find the mono extensions to corlib even
19164         if they are private.
19165
19166 2003-12-09  Martin Baulig  <martin@ximian.com>
19167
19168         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19169         call them directly on the UsageVector.
19170
19171 2003-12-09  Martin Baulig  <martin@ximian.com>
19172
19173         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19174         Changed return type from `FlowReturns' to `Reachability'.
19175
19176 2003-12-09  Martin Baulig  <martin@ximian.com>
19177
19178         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19179         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19180         `Reachable' fields with a single `Reachability' one.
19181
19182 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19183
19184         * class.cs (FindMembers): Remove foreach's.
19185
19186         Bootstrap times:
19187
19188         BEFORE
19189                 Run 1:   8.74 seconds
19190                 Run 2:   8.71 seconds
19191
19192         AFTER
19193                 Run 1:   8.64 seconds
19194                 Run 2:   8.58 seconds
19195
19196
19197 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19198
19199         * cs-parser.jay:
19200         * gen-treedump.cs:
19201         * statement.cs:
19202         This patch does a few things:
19203                 1. EmptyStatement is now a singleton, so it is never reallocated.
19204                 2. All blah is EmptyStatement constructs have been changed to
19205                    blah == EmptyStatement.Value, which is much faster and valid
19206                    now that EmptyStatement is a singleton.
19207                 3. When resolving a block, rather than allocating a new array for
19208                    the non-empty statements, empty statements are replaced with
19209                    EmptyStatement.Value
19210                 4. Some recursive functions have been made non-recursive.
19211         Mainly the performance impact is from (3), however (1) and (2) are needed for
19212         this to work. (4) does not make a big difference in normal situations, however
19213         it makes the profile look saner.
19214
19215         Bootstrap times:
19216
19217         BEFORE
19218         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19219         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19220         Total memory allocated: 56397 KB
19221
19222         AFTER
19223         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19224         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19225         Total memory allocated: 55666 KB
19226
19227 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19228
19229         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19230         than the hashtable in a hashtable version
19231
19232         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19233         we always end up concating a string. This results in a huge perf
19234         loss, because many strings have to be tracked by the GC. In this
19235         patch, we first use a hashtable that works with two keys, so that
19236         the strings do not need to be concat'ed.
19237
19238         Bootstrap times:
19239         BEFORE
19240                 Run 1:   8.74 seconds
19241                 Run 2:   8.71 seconds
19242
19243         AFTER
19244                 Run 1:   8.65 seconds
19245                 Run 2:   8.56 seconds
19246
19247 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19248
19249         * Makefile: Add a new target `do-time' that does a quick and simple
19250         profile, leaving easy to parse output.
19251
19252 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
19253
19254         * codegen.cs (Init): Create the dynamic assembly with 
19255         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19256
19257 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
19258
19259         * support.cs: Make the PtrHashtable use only one
19260         instance of its comparer.
19261
19262 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
19263
19264         * typemanager.cs: Fix lookup of GetNamespaces.
19265
19266 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
19267
19268         * expression.cs: Removed redundant line.
19269
19270         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19271         ArrayLists, use for loops with bounds.  
19272
19273         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19274         arraylist.
19275
19276         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19277         arraylists, use for loop with bounds.
19278
19279         The above three changes give us a 0.071 second performance
19280         improvement out of 3.294 seconds down to 3.223.  On my machine
19281         the above changes reduced the memory usage by 1,387 KB during
19282         compiler bootstrap.
19283
19284         * cs-parser.jay (QualifiedIdentifier): New class used to represent
19285         QualifiedIdentifiers.  Before we created a new string through
19286         concatenation, and mostly later on, the result would be
19287         manipulated by DecomposeQI through string manipulation.
19288
19289         This reduced the compiler memory usage for bootstrapping from
19290         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19291         compile times in 0.05 seconds.
19292
19293 2003-11-28  Dick Porter  <dick@ximian.com>
19294
19295         * support.cs: Do string compares with the Invariant culture.
19296
19297         * rootcontext.cs: 
19298         * gen-treedump.cs: 
19299         * expression.cs: 
19300         * driver.cs: 
19301         * decl.cs: 
19302         * codegen.cs: 
19303         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19304         the comparison is done with the Invariant culture.
19305
19306 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19309         GetEnumerator method.
19310
19311         (ProbeCollectionType): Iterate starting at the most specific type
19312         upwards looking for a GetEnumerator
19313
19314         * expression.cs: Shift count can be up to 31 for int/uint and 63
19315         for long/ulong.
19316
19317 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * statement.cs (Block.LookupLabel): Also look for the label on the
19320         children blocks.  Use a hash table to keep track of visited
19321         nodes. 
19322
19323         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19324         we actually did transform the other operand, otherwise fall back
19325         to the common codepath that casts to long.
19326
19327         * cs-tokenizer.cs: Use the same code pattern as the int case.
19328         Maybe I should do the parsing myself, and avoid depending on the
19329         Parse routines to get this done.
19330
19331 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19334         which fixes bug 51347.  This time test it.
19335
19336         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19337         attributes for example can not tell the difference between these.
19338         The difference was only a syntax feature of the language. 
19339
19340         * attribute.cs: Apply attributes to delegates.
19341
19342         * delegate.cs: Call the apply attributes method.
19343
19344 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
19345
19346         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19347         comparing 0 vs Byte.MinValue, not the value
19348
19349         (ImplicitConversionRequired): When reporting a conversion error,
19350         use error 31 to print out the constant error instead of the
19351         simpler 29.
19352
19353         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19354         which fixes bug 51347.
19355
19356 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
19359         which fixes the -warnaserror command line option.
19360
19361 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
19362
19363         * cfold.cs (DoNumericPromotions): During constant folding of
19364         additions on UIntConstant, special case intconstants with
19365         IntConstants like we do on the expression binary operator. 
19366
19367 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
19368
19369         * convert.cs (ImplicitReferenceConversion): We were missing a case
19370         (System.Enum are not value types or class types, so we need to
19371         classify them separatedly).
19372
19373         * driver.cs: We do not support error 2007.
19374
19375 2003-11-12 Jackson Harper <jackson@ximian.com>
19376
19377         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19378         system directory. Also use the full file name so users can
19379         libraries names mscorlib-o-tron.dll in a non system dir.
19380
19381 2003-11-10  Martin Baulig  <martin@ximian.com>
19382
19383         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19384         (TypeManager.InitCoreTypes): Initialize them here, but instead of
19385         calling `ResolveType()' on them, directly assign their `Type'.
19386
19387 2003-11-08  Martin Baulig  <martin@ximian.com>
19388
19389         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19390         return value and the `out parent' parameter.
19391         (TypeContainer.DefineType): Moved the CS0644 check into
19392         GetClassBases().  Don't pass the interface types to the
19393         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19394         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19395
19396         * ecore.cs (TypeExpr.IsAttribute): New property.
19397         (TypeExpr.GetInterfaces): New method.
19398
19399         * interface.cs (Interface.GetInterfaceTypeByName): Return a
19400         TypeExpr instead of a Type.
19401         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19402         (Interface.DefineType): Don't pass the interface types to the
19403         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19404         them later and then call `TypeBulider.AddInterfaceImplementation()'.
19405
19406         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19407         instead of a `Type[]'.
19408         (TypeManager.RegisterBuilder): Likewise.
19409         (TypeManager.AddUserInterface): Likewise.
19410         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19411         `Type[]' and also return a `TypeExpr[]'.
19412         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19413
19414 2003-11-08  Martin Baulig  <martin@ximian.com>
19415
19416         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19417         Expression.     
19418
19419 2003-11-08  Martin Baulig  <martin@ximian.com>
19420
19421         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19422         TypeManager.ResolveExpressionTypes().
19423
19424         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19425         instead of an Expression.
19426         (TypeExpr): This is now an abstract base class for `TypeExpression'.
19427         (TypeExpression): New public class; formerly known as `TypeExpr'.
19428
19429         * expression.cs (ComposedCast): Derive from TypeExpr.
19430
19431         * typemanager.cs (TypeManager.system_*_expr): These are now
19432         TypExpr's instead of Expression's.
19433         (TypeManager.ResolveExpressionTypes): New public static function;
19434         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19435         of them.        
19436
19437 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
19438
19439         * expression.cs (New.DoResolve): Do not dereference value that
19440         might be a null return.
19441
19442         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19443         sure that the constant value has the right type.  Fixes an
19444         unreported bug, similar to 50425.
19445
19446         * const.cs (Const.LookupConstantValue): Call
19447         ImplicitStandardConversionExists before doing a conversion to
19448         avoid havng the TypeManager.ChangeType do conversions.
19449
19450         Reduced the number of casts used
19451
19452         (Const.ChangeType): New routine to enable reuse of the constant
19453         type changing code from statement.
19454
19455         * typemanager.cs (ChangeType): Move common initialization to
19456         static global variables.
19457
19458         Fixes #50425.
19459
19460         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19461         every value type to go through, even if it was void.  Fix that. 
19462
19463         * cs-tokenizer.cs: Use is_identifier_start_character on the start
19464         character of the define, and the is_identifier_part_character for
19465         the rest of the string.
19466
19467 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
19468
19469         * expression.cs (UnaryMutator.EmitCode): When I updated
19470         LocalVariableReference.DoResolve, I overdid it, and dropped an
19471         optimization done on local variable references.
19472
19473 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
19474
19475         * ecore.cs: Convert the return from Ldlen into an int.
19476
19477 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
19478
19479         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19480         the accessibility, this is a special case for toplevel non-public
19481         classes (internal for instance).
19482
19483 2003-10-20  Nick Drochak <ndrochak@gol.com>
19484
19485         * ecore.cs: Fix typo and build.  Needed another right paren.
19486
19487 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
19488
19489         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
19490         `internal' case regular and protected, but not allowing protected
19491         to be evaluated later.  Bug 49840
19492
19493 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
19494
19495         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19496         to kb.Nlast, and not the kb.nFirst to isolate the switch
19497         statement.
19498
19499         Extract the underlying type, so enumerations of long/ulong are
19500         treated like long/ulong.
19501
19502 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
19503
19504         * expression.cs (New): Overload the meaning of RequestedType to
19505         track the possible creation of the NewDelegate type, since
19506         DoResolve is invoked more than once for new constructors on field
19507         initialization.
19508
19509         See bugs: #48800 and #37014
19510
19511         * cs-parser.jay (declare_local_constants): Take an arraylist
19512         instead of a single constant.
19513
19514         (local_constant_declaration): It should take a
19515         constant_declarators, not a constant_declarator.  Fixes 49487
19516
19517         * convert.cs: Fix error report.
19518
19519 2003-10-13 Jackson Harper <jackson@ximian.com>
19520
19521         * typemanager.cs (TypeToCoreType): Add float and double this fixes
19522         bug #49611
19523
19524 2003-10-09  Martin Baulig  <martin@ximian.com>
19525
19526         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19527         to the .ctor.
19528         (MethodCore.DoDefineParameters): Removed the TypeContainer
19529         argument; use the DeclSpace which was passed to the .ctor instead.
19530         (MethodCore.CheckParameter): Take a DeclSpace instead of a
19531         TypeContainer; we only need a DeclSpace here.
19532
19533 2003-10-09  Martin Baulig  <martin@ximian.com>
19534
19535         * class.cs (MethodData): Added additional `DeclSpace ds' argument
19536         to the .ctor.
19537         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19538         EmitContext's .ctor.    
19539
19540 2003-10-09  Martin Baulig  <martin@ximian.com>
19541
19542         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19543         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19544         AsAccessible(), moved them as well.
19545
19546         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19547
19548 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19549
19550         * cs-parser.jay : Renamed yyName to yyNames related to jay.
19551
19552 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19555         generation for >=, as spotted by Paolo, bug 48679.  
19556         Patch from David Waite.
19557
19558         * cs-tokenizer.cs: Add handling for #pragma.
19559
19560         * cs-parser.jay: Allow for both yield and yield return in the
19561         syntax.  The anti-cobolization of C# fight will go on!
19562
19563         * class.cs (TypeBuilder.DefineType): Catch error condition here
19564         (Parent.DefineType erroring out and returning null).
19565
19566         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19567         coping with enumerations variables, we were mistakenly processing
19568         them as a regular value type instead of built-in types.  Fixes the
19569         bug #48063
19570
19571         * typemanager.cs (IsBuiltinOrEnum): New method.
19572
19573 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
19574
19575         * cs-parser.jay: Upgrade: yield now needs the return clause.
19576
19577 2003-09-19  Martin Baulig  <martin@ximian.com>
19578
19579         * decl.cs (MemberCache.SetupCacheForInterface): Take a
19580         `MemberCache parent' argument.  Normally, an interface doesn't
19581         have a parent type except System.Object, but we use this in gmcs
19582         for generic type parameters.
19583
19584 2003-09-18  Martin Baulig  <martin@ximian.com>
19585
19586         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19587         on `type.IsInterface'; don't check whether the type has a parent
19588         to determine whether it's an interface.
19589
19590 2003-09-15  Martin Baulig  <martin@ximian.com>
19591
19592         * class.cs (TypeContainer.DefineType): Added an error flag to
19593         avoid reporting duplicate CS0146's ("class definition is
19594         circular.").
19595
19596         * driver.cs (Driver.MainDriver): Abort if
19597         RootContext.ResolveTree() reported any errors.
19598
19599 2003-09-07  Martin Baulig  <martin@ximian.com>
19600
19601         * report.cs (Error, Warning): Added overloaded versions which take
19602         a `params object[] args' and call String.Format().
19603
19604 2003-09-07  Martin Baulig  <martin@ximian.com>
19605
19606         * decl.cs (DeclSpace..ctor): Don't call
19607         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19608         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
19609         (DeclSpace.RecordDecl): New method.
19610
19611         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19612
19613 2003-09-02  Ravi Pratap  <ravi@ximian.com>
19614
19615         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19616         value attributes to be applied to ParameterBuilders.
19617
19618         * class.cs (MethodCore.LabelParameters): Make static and more
19619         generic so that it can be used from other places - like interface
19620         methods, for instance.
19621
19622         * interface.cs (Interface.Emit): Call LabelParameters before
19623         emitting attributes on the InterfaceMethod.
19624
19625 2003-08-26  Martin Baulig  <martin@ximian.com>
19626
19627         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19628         resolving aliases; fixes #47927.
19629
19630 2003-08-26  Martin Baulig  <martin@ximian.com>
19631
19632         * statement.cs (Using.DoResolve): This is internally emitting a
19633         try/finally clause, so we need to set ec.NeedExplicitReturn if we
19634         do not always return.  Fixes #47681.
19635
19636 2003-08-26  Martin Baulig  <martin@ximian.com>
19637
19638         * decl.cs (MemberCore): Moved WarningNotHiding(),
19639         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19640         into MemberBase.
19641         (AdditionResult): Make this nested in DeclSpace.
19642         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19643         argument; call NamespaceEntry.Define() unless we're nested in a
19644         class or struct.
19645
19646         * namespace.cs (Namespace.DefineName): New public function.  This
19647         is called from DeclSpace's .ctor to add 
19648         (Namespace.Lookup): Include DeclSpaces in the lookup.
19649
19650         * class.cs (Operator): Derive from MemberBase, not MemberCore.
19651
19652         * const.cs (Const): Derive from MemberBase, not MemberCore.     
19653
19654 2003-08-25  Martin Baulig  <martin@ximian.com>
19655
19656         * convert.cs (Convert.ExplicitReferenceConversion): When
19657         converting from an interface type to a class, unbox if the target
19658         type is a struct type.  Fixes #47822.
19659
19660 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19661
19662         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19663         #47854.
19664
19665 2003-08-22  Martin Baulig  <martin@ximian.com>
19666
19667         * class.cs (TypeManager.DefineType): When defining a nested type,
19668         call DefineType() on our parent; fixes #47801.
19669
19670 2003-08-22  Martin Baulig  <martin@ximian.com>
19671
19672         * class.cs (MethodData.Define): While checking if a method is an
19673         interface implementation, improve the test a bit more to fix #47654.
19674
19675 2003-08-22  Martin Baulig  <martin@ximian.com>
19676
19677         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19678         correctly; fixes #47722.
19679
19680 2003-08-22  Martin Baulig  <martin@ximian.com>
19681
19682         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19683         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19684
19685         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19686
19687 2003-08-22  Martin Baulig  <martin@ximian.com>
19688
19689         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19690         can only be assigned in static constructors.  Fixes #47161.
19691
19692 2003-08-22  Martin Baulig  <martin@ximian.com>
19693
19694         Rewrote and improved the flow analysis code.
19695
19696         * flowbranching.cs (FlowBranching): Make this class abstract.
19697         (FlowBranching.CreateBranching): New static function to create a
19698         new flow branching.
19699         (FlowBranchingBlock, FlowBranchingException): New classes.
19700         (FlowBranching.UsageVector.Type): New public readonly field.
19701         (FlowBranching.UsageVector.Breaks): Removed the setter.
19702         (FlowBranching.UsageVector.Returns): Removed the setter.
19703         (FlowBranching.UsageVector): Added Break(), Return(),
19704         NeverReachable() and Throw() methods to modify the reachability.
19705         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19706         done by FlowBranching.Merge().
19707         (FlowBranching.UsageVector.MergeChild): New method; merges the
19708         merge result into the current vector.
19709         (FlowBranching.Merge): New abstract method to merge a branching.
19710
19711 2003-08-12  Martin Baulig  <martin@ximian.com>
19712
19713         * expression.cs (Indirection.CacheTemporaries): Create the
19714         LocalTemporary with the pointer type, not its element type.
19715
19716 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19717
19718         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19719         token was a keyword or not.
19720
19721         Add `error' options where an IDENTIFIER was expected;  Provide
19722         CheckToken and CheckIdentifierToken convenience error reporting
19723         functions. 
19724
19725         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19726
19727         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19728         NameSpaceEntry NameSpaceEntry.
19729
19730         (LookupInterfaceOrClass): Avoid creating a full qualified name
19731         from namespace and name: avoid doing lookups when we know the
19732         namespace is non-existant.   Use new Tree.LookupByNamespace which
19733         looks up DeclSpaces based on their namespace, name pair.
19734
19735         * driver.cs: Provide a new `parser verbose' to display the
19736         exception thrown during parsing.  This is turned off by default
19737         now, so the output of a failure from mcs is more graceful.
19738
19739         * namespace.cs: Track all the namespaces defined in a hashtable
19740         for quick lookup.
19741
19742         (IsNamespace): New method
19743
19744 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19745
19746         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19747         we know that we need to concatenate (full typename can never be
19748         null). 
19749
19750         * class.cs: ditto.
19751
19752         * statement.cs: Use a bitfield;  Do not initialize to null things
19753         which are done by the constructor by default.
19754
19755         * cs-parser.jay: bug fix, parameter was 4, not 3.
19756
19757         * expression.cs: Just use the property;
19758
19759         * statement.cs: No need for GetVariableInfo method.
19760
19761 2003-08-08  Martin Baulig  <martin@ximian.com>
19762
19763         * flowanalysis.cs (FlowReturns): This is now nested in the
19764         `FlowBranching' class.
19765         (MyBitVector): Moved this here from statement.cs.
19766         (FlowBranching.SiblingType): New enum type.
19767         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19768
19769 2003-08-07  Martin Baulig  <martin@ximian.com>
19770
19771         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19772         `FlowBranching' class and called `BranchingType'.
19773
19774 2003-08-07  Martin Baulig  <martin@ximian.com>
19775
19776         * flowanalysis.cs: Moved all the control flow analysis code into
19777         its own file.
19778
19779 2003-08-07  Martin Baulig  <martin@ximian.com>
19780
19781         * assign.cs (Assign.DoResolve): `target' must either be an
19782         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19783         #37319.
19784
19785 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19786
19787         * expression.cs (BinaryMethod): This kind of expression is created by the
19788         Binary class if it determines that the operator has to be handled
19789         by a method.
19790
19791         (BinaryDelegate): This kind of expression is created if we are
19792         dealing with a + or - operator on delegates.
19793
19794         (Binary): remove method, argumetns, and DelegateOperator: when
19795         dealing with methods, 
19796
19797         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19798
19799         * statement.cs (Block): use bitfields for the three extra booleans
19800         we had in use.   Remove unused topblock parameter.
19801
19802         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19803
19804         * assign.cs: Drop extra unneeded tests.
19805
19806 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19807
19808         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19809
19810         * statement.cs (Foreach): Use VariableStorage instead of
19811         LocalBuilders.   
19812
19813         * codegen.cs (VariableStorage): New class used by clients that
19814         require a variable stored: locals or fields for variables that
19815         need to live across yield.
19816
19817         Maybe provide a convenience api for EmitThis+EmitLoad?
19818
19819         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19820         these bad boys.
19821
19822 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19825         RemapParameterLValue): New methods that are used to turn a
19826         precomputed FieldInfo into an expression like this:
19827
19828                 instance.FieldInfo
19829
19830         The idea is to use this instead of making LocalVariableReference
19831         have more than one meaning.
19832
19833         * cs-parser.jay: Add error production to BASE.
19834
19835         * ecore.cs: Deal with TypeManager.GetField returning null, which
19836         is now a valid return value.
19837
19838         (FieldExprNoAddress): New expression for Fields whose address can
19839         not be taken.
19840
19841         * expression.cs (LocalVariableReference): During the resolve
19842         phases, create new expressions if we are in a remapping context.
19843         Remove code that dealt with remapping here.
19844
19845         (ParameterReference): same.
19846
19847         (ProxyInstance): New expression, like the `This' expression, but
19848         it is born fully resolved.  We know what we are doing, so remove
19849         the errors that are targeted to user-provided uses of `this'.
19850
19851         * statement.cs (Foreach): our variable is now stored as an
19852         Expression;  During resolution, follow the protocol, dont just
19853         assume it will return this.
19854
19855 2003-08-06  Martin Baulig  <martin@ximian.com>
19856
19857         * support.cs (SeekableStreamReader.cs): New public class.
19858
19859         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19860         SeekableStreamReader instead of the normal StreamReader.
19861
19862 2003-08-04  Martin Baulig  <martin@ximian.com>
19863
19864         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19865         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19866         deambiguate casts and delegate invocations.
19867         (parenthesized_expression): Use the new tokens to ensure this is
19868         not a cast of method invocation.
19869
19870         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19871         when reading a `)' and Deambiguate_CloseParens () was previously
19872         called.
19873
19874         * expression.cs (ParenthesizedExpression): New class.  This is
19875         just used for the CS0075 test.
19876         (Binary.DoResolve): Check for CS0075.   
19877
19878 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19879
19880         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19881         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19882         reference comparison.
19883
19884         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19885         examine the ReturnType for equality - this is necessary in the
19886         cases of implicit and explicit operators whose signature also
19887         includes the return type.
19888
19889 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19890
19891         * namespace.cs: Cache the result of the namespace computation,
19892         instead of computing it every time.
19893
19894 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * decl.cs: Use a global arraylist that we reuse over invocations
19897         to avoid excesive memory consumption.  Reduces memory usage on an
19898         mcs compile by one meg (45 average).
19899
19900         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19901         private, work around that.
19902
19903 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * literal.cs (IntLiteral): Define Zero and One static literals. 
19906
19907         * cs-parser.jay (integer_literal): use static literals to reduce
19908         memory usage for the most used literals (0, 1 and -1).  211kb
19909         reduced in memory usage.
19910
19911         Replace all calls to `new ArrayList' with `new
19912         ArrayList(4)' which is a good average number for most allocations,
19913         and also requires only 16 bytes of memory for its buffer by
19914         default. 
19915
19916         This reduced MCS memory usage in seven megabytes for the RSS after
19917         bootstrapping.
19918
19919 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19920
19921         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19922         handle params methods the correct way by forming only one
19923         applicable set with params and normal methods in them. Earlier we
19924         were looking at params methods only if we found no normal methods
19925         which was not the correct thing to do.
19926
19927         (Invocation.BetterFunction): Take separate arguments indicating
19928         when candidate and the best method are params methods in their
19929         expanded form.
19930
19931         This fixes bugs #43367 and #46199.
19932
19933         * attribute.cs: Documentation updates.
19934
19935         (CheckAttribute): Rename to CheckAttributeTarget.
19936         (GetValidPlaces): Rename to GetValidTargets.
19937
19938         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19939         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19940
19941         Fixes bug #44468.
19942
19943 2003-07-28  Martin Baulig  <martin@ximian.com>
19944
19945         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19946         name when looking up the base class of a nested class.  Fixes #46977.
19947
19948 2003-07-26  Martin Baulig  <martin@ximian.com>
19949
19950         * expression.cs (Indexers.Indexer): New nested struct; contains
19951         getter, setter and the indexer's type.
19952         (Indexers.Properties): This is now an ArrayList of
19953         Indexers.Indexer's.
19954         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19955         indexer doesn't have any getters.
19956
19957         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19958         for embedded property and indexer assignments.
19959
19960 2003-07-26  Martin Baulig  <martin@ximian.com>
19961
19962         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19963         preprocessor directive is not the first non-whitespace character
19964         on a line.
19965
19966 2003-07-26  Martin Baulig  <martin@ximian.com>
19967
19968         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19969         namespace parsing, follow the spec more closely.
19970
19971         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19972         NamespaceEntry.Lookup().
19973
19974 2003-07-25  Martin Baulig  <martin@ximian.com>
19975
19976         * MethodCore.cs (OverridesSomething): New public field; it's set
19977         from TypeContainer.DefineMembers if this method overrides
19978         something (which doesn't need to be a method).  Fix #39462.
19979
19980 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19981
19982         * typemanager.cs (GetMembers): Ensure that the list of members is
19983         reversed. This keeps things in sync.
19984
19985         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19986         find an AttributeUsage attribute.
19987
19988         * expression.cs (Invocation.OverloadResolve): Perform the check
19989         which disallows Invoke to be directly called on a Delegate.
19990
19991         (Error_InvokeOnDelegate): Report error cs1533.
19992
19993 2003-07-25  Martin Baulig  <martin@ximian.com>
19994
19995         * expression.cs (Indexers.GetIndexersForType): Only look in the
19996         interface hierarchy if the requested type is already an
19997         interface.  Fixes #46788 while keeping #46502 fixed.
19998
19999 2003-07-25  Martin Baulig  <martin@ximian.com>
20000
20001         * class.cs (TypeContainer.DefineMembers): Check whether all
20002         readonly fields have been assigned and report warning CS0649 if
20003         not.
20004
20005         * statement.cs (LocalInfo.IsFixed): Always return true if this is
20006         a valuetype.
20007
20008 2003-07-24  Ravi Pratap  <ravi@ximian.com>
20009
20010         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
20011         returned from GetMethods to make things consistent with the
20012         assumptions MCS makes about ordering of methods.
20013
20014         This should comprehensively fix bug #45127 and it does :-)
20015
20016         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
20017         ordering is actually reverse.
20018
20019         * Clean up some debug messages I left lying around.
20020
20021         * interface.cs (Populate*): Get rid of code which emits attributes
20022         since the stage in which we emit attributes is the 'Emit' stage,
20023         not the define stage.
20024
20025         (Emit): Move attribute emission for interface members here.
20026
20027 2003-07-22  Ravi Pratap  <ravi@ximian.com>
20028
20029         * expression.cs (Invocation.OverloadResolve): Follow the spec more
20030         closely: we eliminate methods in base types when we have an
20031         applicable method in a top-level type.
20032
20033         Please see section 14.5.5.1 for an exact description of what goes
20034         on. 
20035
20036         This fixes bug #45127 and a host of other related to corlib compilation.
20037
20038         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
20039         array is the method corresponding to the top-level type (this is
20040         because of the changes made to icall.c) so we change this
20041         accordingly.
20042
20043         (MethodGroupExpr.Name): This too.
20044
20045         * typemanager.cs (GetElementType): New method which does the right
20046         thing when compiling corlib. 
20047
20048         * everywhere: Make use of the above in the relevant places.
20049
20050 2003-07-22  Martin Baulig  <martin@ximian.com>
20051
20052         * cs-parser.jay (invocation_expression): Moved
20053         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
20054         `cast_expression', but create a InvocationOrCast which later
20055         resolves to either an Invocation or a Cast.
20056
20057         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
20058         method; call this before EmitStatement() to make sure that this
20059         expression can be used as a statement.
20060
20061         * expression.cs (InvocationOrCast): New class; resolves to either
20062         an Invocation or a Cast.
20063
20064         * statement.cs (StatementExpression): Call ResolveStatement() on
20065         the ExpressionStatement before emitting it.
20066
20067 2003-07-21  Martin Baulig  <martin@ximian.com>
20068
20069         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
20070         `ref' and `out' attributes match; fixes #46220.
20071         (MemberAccess.ResolveMemberAccess): You can't reference a type
20072         through an expression; fixes #33180.
20073         (Indexers.GetIndexersForType): Don't return the indexers from
20074         interfaces the class implements; fixes #46502.
20075
20076 2003-07-21  Martin Baulig  <martin@ximian.com>
20077
20078         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
20079         CS0661 checks; fixes bug #30442.
20080
20081 2003-07-21  Martin Baulig  <martin@ximian.com>
20082
20083         * decl.cs (AdditionResult): Added `Error'.
20084
20085         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
20086
20087         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
20088         makes cs0031.cs actually work.
20089
20090 2003-07-20  Martin Baulig  <martin@ximian.com>
20091
20092         * namespace.cs: Fixed that bug which caused a crash when compiling
20093         the debugger's GUI.
20094
20095 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
20096
20097         * typemanager.cs (LookupTypeReflection): Never expose types which
20098         are NotPublic, NestedPrivate, NestedAssembly, or
20099         NestedFamANDAssem.  We used to return these, and later do a check
20100         that would report a meaningful error, but the problem is that we
20101         would not get the real match, if there was a name override.
20102
20103 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * namespace.cs (Namespace, Name): Do not compute the namespace
20106         name dynamically, compute it in the constructor.  This reduced
20107         memory usage by 1697 KB.
20108
20109         * driver.cs: Use --pause to pause at the end.
20110
20111 2003-07-17  Peter Williams  <peter@newton.cx>
20112
20113         * Makefile: Change the name of the test target so that it doesn't
20114         conflict with the recursive test target.
20115
20116 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
20117
20118         * expression.cs (LocalVariableReference.Emit, EmitAssign,
20119         AddressOf): Do not use EmitThis, that was wrong, use the actual
20120         this pointer.
20121
20122 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * class.cs (MethodData.Define): While checking if a method is an
20125         interface implementation, improve the test: If we are not public
20126         (use new test here: use the computed MethodAttributes directly,
20127         instead of the parsed modifier flags) check if the `implementing'
20128         method comes from an interface or not.
20129
20130         * pending.cs (VerifyPendingMethods): Slightly better error
20131         message.
20132
20133         * makefile: add test target that does the mcs bootstrap.
20134
20135 2003-07-16  Ravi Pratap  <ravi@ximian.com>
20136
20137         * interface.cs (Define): Do nothing here since there are no
20138         members to populate etc. Move the attribute emission out of here
20139         since this was just totally the wrong place to put it. Attribute
20140         application happens during the 'Emit' phase, not in the 'Define'
20141         phase.
20142
20143         (Emit): Add this method and move the attribute emission here
20144
20145         * rootcontext.cs (EmitCode): Call the Emit method on interface
20146         types too.
20147
20148 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20149
20150         * expression.cs (OverloadResolve): Report error only if Location
20151         is not 'Null' which means that there was a probe going on.
20152
20153 2003-07-14  Martin Baulig  <martin@ximian.com>
20154
20155         * expression.cs (ConditionalLogicalOperator): New public class to
20156         implement user defined conditional logical operators.
20157         This is section 14.11.2 in the spec and bug #40505.
20158
20159 2003-07-14  Martin Baulig  <martin@ximian.com>
20160
20161         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20162
20163 2003-07-14  Martin Baulig  <martin@ximian.com>
20164
20165         * codegen.cs (EmitContext.InFixedInitializer): New public field.
20166
20167         * ecore.cs (IVariable.VerifyFixed): New interface method.
20168
20169         * expression.cs (Unary.ResolveOperator): When resolving the `&'
20170         operator, check whether the variable is actually fixed.  Fixes bug
20171         #36055.  Set a variable definitely assigned when taking its
20172         address as required by the spec.
20173
20174         * statement.cs (LocalInfo.IsFixed): New field.
20175         (LocalInfo.MakePinned): Set `IsFixed' to true.
20176
20177 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20178
20179         * attribute.cs (Attribute.Resolve): While doing a Member lookup
20180         for .ctors, ensure that we only ask for members declared in the
20181         attribute type (BindingFlags.DeclaredOnly).
20182
20183         Fixes bug #43632.
20184
20185         * expression.cs (Error_WrongNumArguments): Report error 1501
20186         correctly the way CSC does.
20187
20188 2003-07-13  Martin Baulig  <martin@ximian.com>
20189
20190         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20191         lookup on the fully qualified name, to make things like "X.X" work
20192         where "X.X" is a fully qualified type name, but we also have a
20193         namespace "X" in the using list.  Fixes #41975.
20194
20195 2003-07-13  Martin Baulig  <martin@ximian.com>
20196
20197         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20198         function. If we're a CompoundAssign, we need to create an embedded
20199         CompoundAssign, not an embedded Assign.
20200         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20201         Fixes #45854.
20202
20203 2003-07-13  Martin Baulig  <martin@ximian.com>
20204
20205         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20206         work to fix bug #46088.
20207
20208 2003-07-13  Ravi Pratap <ravi@ximian.com>
20209
20210         * class.cs (Operator.Emit): Do not emit attributes here - it is
20211         taken care of by the Method class that we delegate too. This takes
20212         care of bug #45876.
20213
20214 2003-07-10  Martin Baulig  <martin@ximian.com>
20215
20216         * expression.cs (TypeOfVoid): New class.
20217         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
20218
20219 2003-07-10  Martin Baulig  <martin@ximian.com>
20220
20221         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20222         bug #35957.
20223
20224 2003-07-10  Martin Baulig  <martin@ximian.com>
20225
20226         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20227         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20228
20229         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20230
20231         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20232
20233 2003-07-10  Martin Baulig  <martin@ximian.com>
20234
20235         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20236         of decimal.  Fixes #42850.
20237
20238         NOTE: I also fixed the created byte blob, but this doesn't work on
20239         the MS runtime and csc never produces any byte blobs for decimal
20240         arrays.
20241
20242 2003-07-10  Martin Baulig  <martin@ximian.com>
20243
20244         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20245         structs; fixes #32068.
20246         (Block.AddChildVariableNames): Fixed #44302.
20247
20248 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20249
20250         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20251
20252 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20253
20254         * attribute.cs: And this test is onger needed.
20255
20256 2003-07-08  Martin Baulig  <martin@ximian.com>
20257
20258         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20259         inaccessible types.  Fixes #36313.
20260
20261         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20262
20263         * namespace.cs (NamespaceEntry): Create implicit entries for all
20264         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20265         implicit entries for N1.N2 and N1.
20266
20267 2003-07-08  Martin Baulig  <martin@ximian.com>
20268
20269         Rewrote the handling of namespaces to fix a lot of the issues
20270         wrt. `using' aliases etc.
20271
20272         * namespace.cs (Namespace): Splitted this class into a
20273         per-assembly `Namespace' and a per-file `NamespaceEntry'.
20274
20275         * typemanager.cs (TypeManager.IsNamespace): Removed.
20276         (TypeManager.ComputeNamespaces): Only compute namespaces from
20277         loaded assemblies here, not the namespaces from the assembly we're
20278         currently compiling.
20279
20280 2003-07-08  Martin Baulig  <martin@ximian.com>
20281
20282         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20283
20284 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20285
20286         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20287         already fixed it.  
20288
20289         I thought about the memory savings here, but LookupTypeReflection
20290         is used under already very constrained scenarios.  Compiling
20291         corlib or mcs only exposes one hit, so it would not really reduce
20292         any memory consumption.
20293
20294 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20295
20296         * typemanager.cs: fixes bug #45889 by only adding public types from
20297         other assemblies to the list of known types.
20298
20299 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20300
20301         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20302         on the type we resolved.
20303
20304 2003-07-05  Martin Baulig  <martin@ximian.com>
20305
20306         * pending.cs (PendingImplementation.ParentImplements): Don't
20307         create the proxy if the parent is abstract.
20308
20309         * class.cs (TypeContainer.DefineIndexers): Process explicit
20310         interface implementations first.  Fixes #37714.
20311
20312 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
20313
20314         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20315         defined recursively;  but since we modify the input parameters
20316         (left is set to `this' temporarily), we reset this value if the
20317         left_is_explicit is false, which gives the original semantics to
20318         the code.  
20319
20320         * literal.cs (NullPointer): new class used to represent a null
20321         literal in a pointer context.
20322
20323         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20324         type is a pointer, use a NullPointer object instead of a
20325         NullLiteral.   Closes 43687
20326
20327         (ExplicitConversion): Convert pointer values using
20328         the conv opcode to the proper type.
20329
20330         * ecore.cs (New): change ValueTypeVariable property into a method,
20331         that returns whether the valuetype is suitable for being used.
20332
20333         * expression.cs (Binary.DoNumericPromotions): Only return if we
20334         the int constant was a valid uint, and we can return both left and
20335         right as uints.  If not, we continue processing, to trigger the
20336         type conversion.  This fixes 39018.
20337
20338         * statement.cs (Block.EmitMeta): During constant resolution, set
20339         the CurrentBlock property on the emitcontext, so that we resolve
20340         constants propertly.
20341
20342 2003-07-02  Martin Baulig  <martin@ximian.com>
20343
20344         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20345         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20346
20347         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20348         than emitting it here.
20349
20350         * statement.cs: Fixed some more flow analysis bugs.
20351
20352 2003-07-02  Martin Baulig  <martin@ximian.com>
20353
20354         * class.cs (MethodData.Define): When implementing interface
20355         methods, set Final unless we're Virtual.
20356
20357         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20358         check work for interface methods.
20359
20360 2003-07-01  Martin Baulig  <martin@ximian.com>
20361
20362         * ecore.cs (EmitContext.This): Replaced this property with a
20363         GetThis() method which takes a Location argument.  This ensures
20364         that we get the correct error location for a CS0188.
20365
20366 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
20367
20368         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20369         ImplicitStandardConversion.
20370
20371         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20372
20373 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
20374
20375         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20376         optimization.
20377
20378 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
20379
20380         * class.cs (Constructor.Define): Turn off initlocals for unsafe
20381         constructors.
20382
20383         (MethodData.Define): Turn off initlocals for unsafe methods.
20384
20385 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
20386
20387         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20388         complete;  Fixes #37521.
20389
20390         * delegate.cs: Use Modifiers.TypeAttr to compute the
20391         TypeAttributes, instead of rolling our own.  This makes the flags
20392         correct for the delegates.
20393
20394 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
20395
20396         * class.cs (Constructor.Define): Set the private flag for static
20397         constructors as well.
20398
20399         * cs-parser.jay (statement_expression): Set the return value to
20400         null, to avoid a crash when we catch an error.
20401
20402 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
20403
20404         * cs-parser.jay: Applied patch from Jackson that adds support for
20405         extern and unsafe modifiers to destructor declarations.
20406
20407         * expression.cs: Report error 21 if the user is trying to index a
20408         System.Array.
20409
20410         * driver.cs: Add an error message, suggested by the bug report.
20411
20412         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20413         if we do not have a ": this ()" constructor initializer.  Fixes 45149
20414
20415 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
20416
20417         * namespace.cs: Add some information to reduce FAQs.
20418
20419 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
20420
20421         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20422         underlying enumeration types.  Fixes #43915.
20423
20424         * expression.cs: Treat ushort/short as legal values to be used in
20425         bitwise operations.
20426
20427 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20428
20429         * delegate.cs: transfer custom attributes for paramenters from
20430         the delegate declaration to Invoke and BeginInvoke.
20431
20432 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20433
20434         * attribute.cs: handle custom marshalers and emit marshal info
20435         for fields, too.
20436
20437 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
20438
20439         * makefile.gnu: Added anonymous.cs to the compiler sources.
20440
20441 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
20442
20443         * iterators.cs: Change the name of the proxy class to include two
20444         underscores.
20445
20446         * cs-parser.jay: Update grammar to include anonymous methods.
20447
20448         * anonymous.cs: new file.
20449
20450 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
20451
20452         * class.cs (Field.Define): Add missing test for pointers and
20453         safety. 
20454
20455 2003-05-27  Ravi Pratap  <ravi@ximian.com>
20456
20457         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20458         we use the stobj opcode.
20459
20460         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20461         since it wasn't the correct fix. 
20462
20463         It still is puzzling that we are required to use stobj for IntPtr
20464         which seems to be a ValueType.
20465
20466 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
20467
20468         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20469         during regular simple name resolution.   Now, the trick is that
20470         instead of returning for processing the simplename, we do a
20471         TypeManager.LookupType (ie, a rooted lookup as opposed to a
20472         contextual lookup type).   If a match is found, return that, if
20473         not, return for further composition.
20474
20475         This fixes long-standing 30485.
20476
20477         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20478         using the address to initialize an object, do an Stobj instead of
20479         using the regular Stelem.
20480
20481         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20482         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20483         Because if we are a BaseIndexerAccess that value will be true.
20484         Fixes 43643.
20485
20486         * statement.cs (GotoCase.Resolve): Return after reporting an
20487         error, do not attempt to continue. 
20488
20489         * expression.cs (PointerArithmetic.Emit): If our operand is a
20490         long, convert our constants to match the operand before
20491         multiplying.  Convert to I type before adding.   Fixes 43670.
20492
20493 2003-05-14  Ravi Pratap  <ravi@ximian.com>
20494
20495         * enum.cs (ImplicitConversionExists) : Rename to
20496         ImplicitEnumConversionExists to remove ambiguity. 
20497
20498         * ecore.cs (NullCast): New type of cast expression class which
20499         basically is very similar to EmptyCast with the difference being
20500         it still is a constant since it is used only to cast a null to
20501         something else
20502         (eg. (string) null)
20503
20504         * convert.cs (ImplicitReferenceConversion): When casting a null
20505         literal, we return a NullCast.
20506
20507         * literal.cs (NullLiteralTyped): Remove - I don't see why this
20508         should be around anymore.
20509
20510         The renaming (reported was slightly wrong). Corrections:
20511
20512         ConvertImplicitStandard -> ImplicitConversionStandard
20513         ConvertExplicitStandard -> ExplicitConversionStandard
20514
20515         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20516         before passing them in !
20517
20518         * convert.cs (ImplicitConversionStandard): When comparing for
20519         equal expr and target types, ensure that expr is not a
20520         NullLiteral.
20521
20522         In general, we must not be checking (expr_type ==
20523         target_type) in the top level conversion methods
20524         (ImplicitConversion, ExplicitConversion etc). This checking is
20525         done in the methods that they delegate to.
20526
20527 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
20528
20529         * convert.cs: Move Error_CannotConvertType,
20530         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20531         ImplicitNumericConversion, ImplicitConversionExists,
20532         ImplicitUserConversionExists, StandardConversionExists,
20533         FindMostEncompassedType, FindMostSpecificSource,
20534         FindMostSpecificTarget, ImplicitUserConversion,
20535         ExplicitUserConversion, GetConversionOperators,
20536         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20537         TryImplicitIntConversion, Error_CannotConvertImplicit,
20538         ConvertImplicitRequired, ConvertNumericExplicit,
20539         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20540         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20541         its own file.
20542
20543         Perform the following renames:
20544
20545         StandardConversionExists -> ImplicitStandardConversionExists
20546         ConvertImplicit -> ImplicitConversion
20547         ConvertImplicitStandard -> ImplicitStandardConversion
20548         TryImplicitIntConversion -> ImplicitIntConversion
20549         ConvertImplicitRequired -> ImplicitConversionRequired
20550         ConvertNumericExplicit -> ExplicitNumericConversion
20551         ConvertReferenceExplicit -> ExplicitReferenceConversion
20552         ConvertExplicit -> ExplicitConversion
20553         ConvertExplicitStandard -> ExplicitStandardConversion
20554
20555 2003-05-19  Martin Baulig  <martin@ximian.com>
20556
20557         * statement.cs (TypeInfo.StructInfo): Made this type protected.
20558         (TypeInfo): Added support for structs having structs as fields.
20559
20560         * ecore.cs (FieldExpr): Implement IVariable.
20561         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20562         VariableInfo for the field.
20563
20564 2003-05-18  Martin Baulig  <martin@ximian.com>
20565
20566         * expression.cs (This.DoResolve): Report a CS0027 if we're
20567         emitting a field initializer.
20568
20569 2003-05-18  Martin Baulig  <martin@ximian.com>
20570
20571         * expression.cs (This.ResolveBase): New public function.
20572         (This.DoResolve): Check for CS0188.
20573
20574         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20575         This.Resolve().
20576
20577         * ecore.cs (MethodGroupExpr.DoResolve): Set the
20578         `instance_expression' to null if we don't have any non-static
20579         methods.
20580
20581 2003-05-18  Martin Baulig  <martin@ximian.com>
20582
20583         Reworked the way how local variables and parameters are handled by
20584         the flow analysis code.
20585
20586         * statement.cs (TypeInfo, VariableMap): New public classes.
20587         (VariableInfo): New public class.  This is now responsible for
20588         checking whether a variable has been assigned.  It is used for
20589         parameters and local variables.
20590         (Block.EmitMeta): Take the InternalParameters as argument; compute
20591         the layout of the flow vectors here.
20592         (Block.LocalMap, Block.ParameterMap): New public properties.
20593         (FlowBranching): The .ctor doesn't get the InternalParameters
20594         anymore since Block.EmitMeta() now computes the layout of the flow
20595         vector.
20596         (MyStructInfo): This class is now known as `StructInfo' and nested
20597         in `TypeInfo'; we don't access this directly anymore.
20598
20599         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20600         property and removed IsAssigned(), IsFieldAssigned(),
20601         SetAssigned() and SetFieldAssigned(); we now call them on the
20602         VariableInfo so we don't need to duplicate this code everywhere.
20603
20604         * expression.cs (ParameterReference): Added `Block block' argument
20605         to the .ctor.
20606         (LocalVariableReference, ParameterReference, This): The new
20607         VariableInfo class is now responsible for all the definite
20608         assignment stuff.
20609
20610         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20611         IsParameterAssigned, SetParameterAssigned): Removed.
20612
20613 2003-05-18  Martin Baulig  <martin@ximian.com>
20614
20615         * typemanager.cs (InitCoreTypes): Try calling
20616         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20617         the 3-args-version.  Corlib now also needs our `void_type'.
20618         (GetMethod): Added overloaded version which takes an optional
20619         `bool report_errors' to allow lookups of optional methods.
20620
20621 2003-05-12  Martin Baulig  <martin@ximian.com>
20622
20623         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20624         only used for locals and not for parameters.
20625
20626 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * support.cs (InternalParameters.ParameterType): Return the
20629         ExternalType of the parameter.
20630
20631         * parameter.cs (Parameter.ExternalType): drop the two arguments,
20632         they were unused.
20633
20634 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
20635
20636         * class.cs (MethodData.Define): Do not set the `newslot' on
20637         interface members, if they are also flagged as "override".
20638
20639         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20640         better code for ++i and i++.  This only works for static fields
20641         and local variables.
20642
20643         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20644         want to pull the DeclSpace out of the builder_to_declspace instead
20645         of the TypeBuilder (like in TypeContainer.FindMembers).
20646
20647         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20648         instead of LookupTypeContainer.  Fixes the crash on .NET for
20649         looking up interface members.
20650
20651         * const.cs: Create our own emit context during the Definition
20652         stage, so that constants are evaluated in the proper context, when
20653         a recursive definition happens.
20654
20655 2003-05-11  Martin Baulig  <martin@ximian.com>
20656
20657         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
20658         new block for a switch section.
20659         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20660         the adding/lookup in the switch block.  Fixes #39828.
20661
20662 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
20663
20664         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20665         functionality: I needed to convert the data after I had performed
20666         the add/sub operation into the operands type size.
20667
20668         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20669         pass the type for the box operation, otherwise the resulting
20670         object would have been of type object.
20671
20672         (BoxedCast): Add constructor to specify the type to box as.
20673
20674 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20675
20676         * iterators.cs: I was reusing the `count' variable inadvertently,
20677         take steps to not allow this to happen.
20678
20679 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20680
20681         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20682         by creating an array at the point where the params starts and
20683         putting all those arguments there, then adjusting the size of the
20684         array.
20685
20686 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * expression.cs (New.AddressOf): Implement interface
20689         IMemoryLocation.  This is used when the `new' operator is used in
20690         the context of an invocation to a method on a value type.
20691
20692         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20693         example. 
20694
20695         * namespace.cs: Also check the using aliases here.
20696
20697         * driver.cs: Move the test for using validity after the types have
20698         been entered, so we do a single pass that also includes the using
20699         aliases. 
20700
20701         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20702         in the regular case.   CreateSiblingForFinally is doing extra
20703         error checking.
20704
20705         * attribute.cs (GetAttributeArgumentExpression): Store the result
20706         on an out value, and use the return value to indicate failure
20707         instead of using null (which is a valid return for Constant.GetValue).
20708
20709         * statement.cs: Perform the analysis flow for the increment
20710         portion after the statement, because this will be the real flow of
20711         execution.  Fixes #42385
20712
20713         * codegen.cs (EmitContext.EmitArgument,
20714         EmitContext.EmitStoreArgument): New helper functions when the
20715         RemapToProxy flag is set.
20716
20717         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20718         function.
20719
20720         Add support for remapping parameters. 
20721
20722         * iterators.cs: Propagate parameter values;  Store parameter
20723         values in the proxy classes.
20724
20725 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20728         need a proxy reference;  I do not know what I was thinking
20729
20730         * cs-parser.jay (constructor_initializer): catch another error,
20731         and display nice message.
20732
20733         (field_declaration): catch void field declaration
20734         to flag a better error. 
20735
20736         * class.cs (MemberBase.CheckBase): Report an error instead of a
20737         warning if a new protected member is declared in a struct. 
20738         (Field.Define): catch the error of readonly/volatile.
20739
20740         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20741
20742         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20743         volatile variable is taken
20744
20745 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20746
20747         * statement.cs (Fixed.Resolve): Report an error if we are not in
20748         an unsafe context.
20749
20750 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * typemanager.cs: reuse the code that handles type clashes for
20753         delegates and enumerations.
20754
20755         * class.cs (Report28): Always report.
20756
20757         * expression.cs (EncodeAsAttribute): Allow nulls here.
20758
20759 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20760
20761         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20762         the functionality for testing whether an expression is valid for
20763         an attribute here.  Also handle the case of arrays of elements
20764         being stored. 
20765
20766         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20767         encoding a linear array into an array of objects that are suitable
20768         to be passed to an CustomAttributeBuilder.
20769
20770         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20771
20772         * ecore.cs: (FieldExpr): Handle field remapping here.
20773
20774         * iteratators.cs: Pass the instance variable (if the method is an
20775         instance method) to the constructors, so we can access the field
20776         variables on the class.
20777
20778         TODO: Test this with structs.  I think the THIS variable on
20779         structs might have to be a pointer, and not a refenrece
20780
20781 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20782
20783         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20784         local variables to fields in a proxy class.
20785
20786         * iterators.cs (PopulateProxy): Rename our internal fields to
20787         <XXX>.  
20788         Create a <THIS> field if we are an instance method, so we can
20789         reference our parent container variables.
20790         (MapVariable): Called back from the EmitContext code to enter a
20791         new variable to field mapping into the proxy class (we just create
20792         a FieldBuilder).
20793
20794         * expression.cs
20795         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20796         for using the remapped locals to fields.
20797
20798         I placed the code here, because that gives the same semantics to
20799         local variables, and only changes the Emit code.
20800
20801         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20802         statements inside iterators.
20803         (VariableInfo): Add a FieldBuilder for the cases when we are
20804         remapping local variables to fields in a proxy class
20805
20806         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20807         current_block != null.
20808
20809         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20810         not cope with strings, as it has been moved to the
20811         TableSwitchEmit.  Fixed bug in switch generation.
20812
20813         * expression.cs (New.DoResolve): Provide more context for the user
20814         when reporting an error.
20815
20816         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20817         pointers. 
20818
20819         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20820         check the permissions for it.  Note than in a type-resolution
20821         context the check was already present in DeclSpace.ResolveType,
20822         but was missing from the MemberAccess.
20823
20824         (ArrayCreation.CheckIndices): warn if the user has
20825         more nested levels of expressions, but there are no more
20826         dimensions specified.  Avoids crash on bug 41906.
20827
20828 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20829
20830         * statement.cs (Block): replace Implicit bool, for a generic
20831         flags.   
20832         New flag: `Unchecked'.  This is used during the EmitMeta phase
20833         (which is out-of-line with the regular Resolve/Emit process for a
20834         statement, as this is done ahead of time, but still gets a chance
20835         to call constant resolve).
20836
20837         (Block.Flags): new enum for adding a new flag.
20838
20839         (Block.EmitMeta): track the state of unchecked.
20840
20841         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20842         to enable constant resolution to work there as well.
20843
20844 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * typemanager.cs (ienumerable_type): Also look up
20847         System.Collections.IEnumerable. 
20848
20849 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20850
20851         TODO: Test more than one conditional per method.
20852
20853         * class.cs (Indexer.Define): Report the location where the user is
20854         referencing the unsupported feature.
20855
20856         (MethodData): Overload the use of `conditionals' to
20857         minimize the creation of needless ArrayLists.   This saves roughly
20858         212kb on my machine.
20859
20860         (Method): Implement the new IIteratorContainer interface.
20861         (Method.SetYields): Implement the method by setting the ModFlags
20862         to contain METHOD_YIELDS.
20863
20864         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20865         which just got set to null.
20866
20867         * iterators.cs: New file.
20868
20869         (Yield, YieldBreak): New statements.
20870
20871         * statement.cs (Return.Resolve): Flag an error if we are used in
20872         an iterator method.
20873
20874         * codegen.cs (InIterator): New flag set if the code is being
20875         compiled in an iterator method.
20876
20877         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20878         internal modifier, and we just use it to avoid adding extra
20879         fields, as this is seldom used.  
20880
20881         * cs-parser.jay: Add yield_statement (yield and yield break).
20882
20883         * driver.cs: New flag -v2 to turn on version 2 features. 
20884
20885         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20886         hashtable when v2 is enabled.
20887
20888 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20889
20890         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20891         there is already a namespace defined with this name.
20892
20893         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20894         people upgraded their corlibs.
20895
20896         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20897         always use fully qualified types, no need to use the compiler
20898         front end.
20899
20900         (TypeManager.IsNamespace): Use binarysearch.
20901
20902         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20903         AddDelegate): I did not quite use the new IsValid API properly: I
20904         have to pass the short-name and the fullname.  I was passing only
20905         the basename instead of the fullname sometimes. 
20906
20907         (TypeContainer.DefineType): call NamespaceClash.
20908
20909         * interface.cs (Interface.DefineType): use NamespaceClash before
20910         defining the type.
20911
20912         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20913         defining the type.
20914
20915         * enum.cs: (Enum.DefineType): use NamespaceClash before
20916         defining the type.
20917
20918         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20919         speed increase.  First, use the negative_hits cache when we get a
20920         negative.  Second, add the type with its full original name
20921         instead of the new . and + encoded name (reflection uses + to
20922         separate type from a nested type).  Use LookupTypeReflection
20923         directly which bypasses the type->name hashtable (that we already
20924         know does not contain the type.
20925
20926         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20927         location/container type. 
20928
20929         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20930
20931 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20932
20933         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20934
20935         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20936         method is being referenced in the method group from a static
20937         context, and report error 120 if so.
20938
20939         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20940         Error118. 
20941
20942         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20943         is created, we create the A namespace).
20944
20945         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20946         Fixes #41591
20947
20948 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20949
20950         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20951         invocation to ModuleBuilder.GetType with the same values will
20952         return a new type instance, so we need to cache its return
20953         values. 
20954
20955         * expression.cs (Binary.ResolveOperator): Only allow the compare
20956         operators on enums if they are of the same type.
20957
20958         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20959         types of ValueType on their own case.  Before we were giving them
20960         the same treatment as objects.
20961
20962         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20963         fullname.  Short name is used to compare against container name.
20964         Fullname is used to check against defined namespace names.
20965
20966         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20967         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20968
20969         (Method.CheckBase): Call parent.
20970         (MemberBase.CheckBase): Check for protected members on sealed
20971         classes.
20972         (PropertyBase.CheckBase): Call parent.
20973         (Field.Define): Call parent.
20974
20975         * report.cs: Negative error codes are now mapped to 8000 - code,
20976         so that the display is render more nicely.
20977
20978         * typemanager.cs: Do not use try/catch, instead report a regular
20979         error. 
20980
20981         (GetPointerType, GetReferenceType): These methods provide
20982         mechanisms to obtain the T* and T& from a T.  We had the code
20983         previously scattered around the code base, and it also used
20984         TypeManager.LookupType that would go through plenty of caches.
20985         This one goes directly to the type source.
20986
20987         In some places we did the Type.GetType followed by
20988         ModuleBuilder.GetType, but not in others, so this unifies the
20989         processing as well.
20990
20991         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20992         statements now that we have namespace information.
20993
20994         * typemanager.cs (IsNamespace): New method, returns whether the
20995         string presented is a namespace or not.
20996
20997         (ComputeNamespaces): New public entry point, computes the list of
20998         available namespaces, using the GetNamespaces API call in Mono, or
20999         the slower version in MS.NET.   
21000
21001         Now before we start the semantic analysis phase, we have a
21002         complete list of namespaces including everything that the user has
21003         provided.
21004
21005         Deleted old code to cache namespaces in .nsc files.
21006
21007 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
21008
21009         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
21010         class/struct location definition Location for the implicit
21011         constructor location.
21012
21013         (Operator.Define): Use the location of the operator for the
21014         implicit Method definition.
21015
21016         (Constructor.Emit): use the constructor location for the implicit
21017         base initializer constructor.
21018
21019         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
21020         and the Expression class now contains two new methods:
21021
21022         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
21023         isolate type lookup from the rest of the resolution process.
21024
21025         Since we use Expressions to hold type definitions due to the way
21026         we parse the input we have historically overloaded Resolve to
21027         perform the Type lookups if a special flag is passed.  Now this is
21028         eliminated and two methods take their place. 
21029
21030         The differences in the two methods between xStep and xTerminal is
21031         that xStep is involved in our current lookup system that uses
21032         SimpleNames to compose a name, while xTerminal is used just to
21033         catch the case where the simplename lookup failed.
21034
21035 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
21036
21037         * expression.cs (ResolveMemberAccess): Remove redundant code.
21038         TypeExpr expressions are always born fully resolved.
21039
21040         * interface.cs (PopulateMethod): Do not lookup the types twice.
21041         We were doing it once during SemanticAnalysis and once during
21042         PopulateMethod.
21043
21044         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
21045         in local variable type definitions, were being returned as a
21046         SimpleName (we decomposed everything into a string), that is
21047         because primary_expression was being used instead of a type in the
21048         grammar (reduce/reduce conflicts).
21049
21050         The part that was wrong is that we converted the expression into a
21051         string (an oversimplification in one hand, compounded with primary
21052         expressions doing string concatenation).
21053
21054         So things like:
21055
21056         A.B.C [] x;
21057
21058         Would return "A.B.C[]" as a SimpleName.  This stopped things like
21059         using clauses from working on this particular context.  And a type
21060         was being matched directly against "A.B.C[]".
21061
21062         We now use the correct approach, and allow for ComposedCast to be
21063         part of the unary expression.  So the "A.B.C []" become a composed
21064         cast of "A.B.C" (as a nested group of MemberAccess with a
21065         SimpleName at the end) plus the rank composition "[]". 
21066
21067         Also fixes 35567
21068
21069 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
21070
21071         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
21072         for the access level checking.
21073
21074         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
21075         `TypeContainer container', because I kept getting confused when I
21076         was debugging this code.
21077
21078         * expression.cs (Indexers): Instead of tracking getters/setters,
21079         we now track them in parallel.  We create one arraylist less, but
21080         most importantly it is possible now for the LValue code to find a
21081         matching get for a set.
21082
21083         (IndexerAccess.DoResolveLValue): Update the code.
21084         GetIndexersForType has been modified already to extract all the
21085         indexers from a type.  The code assumed it did not.
21086
21087         Also make the code set the correct return type for the indexer.
21088         This was fixed a long time ago for properties, but was missing for
21089         indexers.  It used to be void_type.
21090
21091         (Binary.Emit): Test first for doubles instead of
21092         floats, as they are more common.
21093
21094         (Binary.EmitBranchable): Use the .un version of the branch opcodes
21095         when dealing with floats and the <=, >= operators.  This fixes bug
21096         #39314 
21097
21098         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21099         to load the array value by emitting a load on the foreach variable
21100         type.  This was incorrect.  
21101
21102         We now emit the code to load an element using the the array
21103         variable type, and then we emit the conversion operator.
21104
21105         Fixed #40176
21106
21107 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
21108
21109         * attribute.cs: Avoid allocation of ArrayLists in the common case.
21110
21111 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
21112
21113         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21114         test for protection before we test for signatures. 
21115
21116         (MethodSignature.ToString): implement.
21117
21118         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21119         to the case where we reduced into a LongConstant.
21120
21121         * decl.cs (CheckAccessLevel): If the type is an array, we can not
21122         depend on whether the information is acurrate, because the
21123         Microsoft runtime will always claim that the array type is public,
21124         regardless of the real state.
21125
21126         If the type is a pointer, another problem happens: the type is
21127         reported as non-public in Microsoft.  
21128
21129         In both cases we have to call CheckAccessLevel recursively with
21130         the underlying type as the argument to be tested.
21131
21132 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * assign.cs (Assign.Emit): If we are dealing with a compound
21135         assignment expression, we should use the code path that stores the
21136         intermediate result in a temporary value.  This fixes #40903.
21137
21138         *expression.cs (Indirection.ToString): Provide ToString method for
21139         debugging. 
21140
21141 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
21142
21143         * class.cs: Null out fields holding references to Block objects so
21144         they can be garbage collected.
21145
21146         * expression.cs (OverloadResolve): Remove unused local.
21147
21148 2003-04-07  Martin Baulig  <martin@ximian.com>
21149
21150         * codegen.cs (EmitContext.CurrentFile): New public field.
21151         (EmitContext.Mark): Use the CurrentFile to check whether the
21152         location is in the correct file.
21153         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21154
21155 2003-04-07  Martin Baulig  <martin@ximian.com>
21156
21157         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21158
21159         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21160         location.  [FIXME: The location argument which gets passed to this
21161         method is sometimes wrong!]
21162
21163 2003-04-07  Nick Drochak <ndrochak@gol.com>
21164
21165         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21166
21167 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * expression.cs (Indirection.EmitAssign): We were using the
21170         temporary, but returning immediately instead of continuing the
21171         EmitAssing flow.
21172
21173 2003-04-06  Martin Baulig  <martin@ximian.com>
21174
21175         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21176         if it's a nested child, but also deriving from the outer class.
21177         See test 190.cs.
21178
21179         * typemanager.cs (IsNestedChildOf): Make this work if it's a
21180         nested child, but also deriving from the outer class.  See
21181         test-190.cs.
21182         (FilterWithClosure): We may access private members of the outer
21183         class if we're a nested child and deriving from the outer class.
21184         (RealMemberLookup): Only set `closure_private_ok' if the
21185         `original_bf' contained BindingFlags.NonPublic.
21186
21187 2003-04-05  Martin Baulig  <martin@ximian.com>
21188
21189         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21190
21191 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
21192
21193         * class.cs (Event.Define): Do not allow abstract events to have
21194         initializers. 
21195
21196 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21199         block in event declarations.
21200
21201         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21202         value type, get its address.
21203
21204         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21205         leaving a class on the stack instead of a boolean value (int
21206         0/1).  Change the code so we compare against null, and then the
21207         result against zero.
21208
21209         * class.cs (TypeContainer.GetClassBases): We were checking for the
21210         parent class being sealed too late.
21211
21212         * expression.cs (Binary.Emit): For <= and >= when dealing with
21213         floating point values, use cgt.un and clt.un instead of cgt and
21214         clt alone.
21215
21216 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
21217
21218         * statement.cs: Apply the same optimization as MS: skip the 
21219         GetEnumerator returning an IEnumerator, and use the one returning a 
21220         CharEnumerator instead. This allows us to avoid the try-finally block 
21221         and the boxing.
21222
21223 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
21224
21225         * cs-parser.jay: Attributes cannot be applied to
21226                          namespaces. Fixes #40473
21227
21228 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21229
21230         * class.cs:
21231         (Add*): check if the name is valid using the full name for constants,
21232         fields, properties and events.
21233
21234 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
21235
21236         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21237         char constants to be part of the enumeration.
21238
21239         * expression.cs (Conditional.DoResolve): Add support for operator
21240         true. Implements the missing functionality from 14.12
21241
21242         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21243         operator true/false as required by the spec.
21244
21245         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21246         implicit conversion to boolean.
21247
21248         * statement.cs (Statement.ResolveBoolean): A boolean expression is
21249         also one where the type implements `operator true'. 
21250
21251         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21252         get an expression that will invoke operator true based on an
21253         expression.  
21254
21255         (GetConversionOperators): Removed the hack that called op_True
21256         here.  
21257
21258         (Expression.ResolveBoolean): Move this from Statement.
21259
21260 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
21261
21262         * ecore.cs (FieldExpr): do not allow initialization of initonly
21263         fields on derived classes
21264
21265 2003-03-13  Martin Baulig  <martin@ximian.com>
21266
21267         * statement.cs (Block.Emit): Call ig.BeginScope() and
21268         ig.EndScope() when compiling with debugging info; call
21269         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21270
21271 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
21272
21273         * expression.cs (Indexers): Do not construct immediately, allow
21274         for new members to be appended as we go.  Fixes 38143
21275
21276 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21277
21278         * expression.cs: save/restore context when resolving an unchecked
21279         expression.
21280
21281 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
21282
21283         * cfold.cs: Catch division by zero in modulus operator during
21284         constant folding.
21285
21286 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
21287
21288         * interface.cs (Interface.DefineMembers): Avoid defining members
21289         twice. 
21290
21291 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
21292
21293         * driver.cs: handle the +/- options for -noconfig
21294
21295         * statement.cs (Unckeched.Resolve): Also track the state of
21296         unchecked in the Resolve phase.
21297
21298 2003-02-27  Martin Baulig  <martin@ximian.com>
21299
21300         * ecore.cs (Expression.MemberLookup): Don't create a
21301         MethodGroupExpr for something which is not a method.  Fixes #38291.
21302
21303 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
21304
21305         * class.cs (MemberBase.CheckParameters): Also check that the type
21306         is unmanaged if it is a pointer.
21307
21308         * expression.cs (SizeOf.Resolve): Add location information.
21309
21310         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21311         a managed type is declared.
21312
21313         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21314         parameter modifiers as well.  Fixes bug 38606
21315
21316         * class.cs: Very sad.  Am backing out the speed up changes
21317         introduced by the ArrayList -> Array in the TypeContainer, as they
21318         were not actually that much faster, and introduced a bug (no error
21319         reports on duplicated methods).
21320
21321         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21322         source first, this will guarantee that we have a valid expression
21323         before calling in lower levels functions that will require a
21324         resolved object.  Then use this original_source in the
21325         target.ResolveLValue instead of the original source that was
21326         passed to us.
21327
21328         Another change.  Use target.Resolve instead of LValueResolve.
21329         Although we are resolving for LValues, we will let the Assign code
21330         take care of that (it will be called again from Resolve).  This
21331         basically allows code like this:
21332
21333         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21334         class Y { void A (X x) { x [0] += o; }
21335
21336         The problem was that the indexer was trying to resolve for
21337         set_Item (idx, object o) and never finding one.  The real set_Item
21338         was set_Item (idx, X).  By delaying the process we get the right
21339         semantics. 
21340
21341         Fixes bug 36505
21342
21343 2003-02-23  Martin Baulig  <martin@ximian.com>
21344
21345         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21346         while calling DoEmit ().
21347
21348         * codegen.cs (EmitContext.Mark): Don't mark locations in other
21349         source files; if you use the #line directive inside a method, the
21350         compiler stops emitting line numbers for the debugger until it
21351         reaches the end of the method or another #line directive which
21352         restores the original file.
21353
21354 2003-02-23  Martin Baulig  <martin@ximian.com>
21355
21356         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21357
21358 2003-02-23  Martin Baulig  <martin@ximian.com>
21359
21360         * statement.cs (Block.AddChildVariableNames): We need to call this
21361         recursively, not just for our immediate children.
21362
21363 2003-02-23  Martin Baulig  <martin@ximian.com>
21364
21365         * class.cs (Event.Define): Always make the field private, like csc does.
21366
21367         * typemanager.cs (TypeManager.RealMemberLookup): Make events
21368         actually work, fixes bug #37521.
21369
21370 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
21371
21372         * delegate.cs: When creating the various temporary "Parameters"
21373         classes, make sure that we call the ComputeAndDefineParameterTypes
21374         on those new parameters (just like we do with the formal ones), to
21375         allow them to be resolved in the context of the DeclSpace.
21376
21377         This fixes the bug that Dick observed in Bugzilla #38530.
21378
21379 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * expression.cs (ResolveMemberAccess): When resolving a constant,
21382         do not attempt to pull a constant if the value was not able to
21383         generate a valid constant.
21384
21385         * const.cs (LookupConstantValue): Do not report more errors than required.
21386
21387 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21388
21389         * expression.cs: fixes bug #38328.
21390
21391 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21392
21393         * class.cs: Changed all the various members that can be part of a
21394         class from being an ArrayList to be an Array of the right type.
21395         During the DefineType type_list, interface_list, delegate_list and
21396         enum_list are turned into types, interfaces, delegates and enums
21397         arrays.  
21398
21399         And during the member population, indexer_list, event_list,
21400         constant_list, field_list, instance_constructor_list, method_list,
21401         operator_list and property_list are turned into their real arrays.
21402
21403         Although we could probably perform this operation earlier, for
21404         good error reporting we need to keep the lists and remove the
21405         lists for longer than required.
21406
21407         This optimization was triggered by Paolo profiling the compiler
21408         speed on the output of `gen-sample-program.pl' perl script. 
21409
21410         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21411         not crash in methods like MemberLookupFailed that use this field.  
21412
21413         This problem arises when the compiler fails to resolve a type
21414         during interface type definition for example.
21415
21416 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21417
21418         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21419         inherit from System.Object, so we have to stop at null, not only
21420         when reaching System.Object.
21421
21422 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
21423
21424         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21425         DeclaredOnly because the parent indexer might have had a different
21426         name, but did not loop until the top of the hierarchy was reached.
21427
21428         The problem this one fixes is 35492: when a class implemented an
21429         indexer from an interface, we were getting the interface method
21430         (which was abstract) and we were flagging an error (can not invoke
21431         abstract method).
21432
21433         This also keeps bug 33089 functioning, and test-148 functioning.
21434
21435         * typemanager.cs (IsSpecialMethod): The correct way of figuring
21436         out if a method is special is to see if it is declared in a
21437         property or event, or whether it is one of the predefined operator
21438         names.   This should fix correctly #36804.
21439
21440 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
21441
21442         The goal here is to remove the dependency on EmptyCast.Peel ().
21443         Killing it completely.
21444
21445         The problem is that currently in a number of places where
21446         constants are expected, we have to "probe" for an EmptyCast, and
21447         Peel, which is not the correct thing to do, as this will be
21448         repetitive and will likely lead to errors. 
21449
21450         The idea is to remove any EmptyCasts that are used in casts that
21451         can be reduced to constants, so we only have to cope with
21452         constants. 
21453
21454         This bug hunt was triggered by Bug 37363 and the desire to remove
21455         the duplicate pattern where we were "peeling" emptycasts to check
21456         whether they were constants.  Now constants will always be
21457         constants.
21458
21459         * ecore.cs: Use an enumconstant here instead of wrapping with
21460         EmptyCast.  
21461
21462         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21463         throwing me off.  By handling this we can get rid of a few hacks.
21464
21465         * statement.cs (Switch): Removed Peel() code.
21466
21467 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
21468
21469         * class.cs: Location information for error 508
21470
21471         * expression.cs (New.DoResolve): Add a guard against double
21472         resolution of an expression.  
21473
21474         The New DoResolve might be called twice when initializing field
21475         expressions (see EmitFieldInitializers, the call to
21476         GetInitializerExpression will perform a resolve on the expression,
21477         and later the assign will trigger another resolution
21478
21479         This leads to bugs (#37014)
21480
21481         * delegate.cs: The signature for EndInvoke should contain any ref
21482         or out parameters as well.  We were not doing this in the past. 
21483
21484         * class.cs (Field.Define): Do not overwrite the type definition
21485         inside the `volatile' group.  Turns out that volatile enumerations
21486         were changing the type here to perform a validity test, which
21487         broke conversions. 
21488
21489 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21492         and structs, we do not want to load the instance variable
21493
21494         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21495         enum_type has to be handled like an object reference (implicit
21496         conversions exists from this to object), but the regular IsClass
21497         and IsValueType tests will never return true for this one.
21498
21499         Also we use TypeManager.IsValueType instead of type.IsValueType,
21500         just for consistency with the rest of the code (this is only
21501         needed if we ever use the construct exposed by test-180.cs inside
21502         corlib, which we dont today).
21503
21504 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
21505
21506         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21507         just InternalCall.
21508
21509 2003-02-09  Martin Baulig  <martin@ximian.com>
21510
21511         * namespace.cs (Namespace..ctor): Added SourceFile argument.
21512         (Namespace.DefineNamespaces): New static public method; this is
21513         called when we're compiling with debugging to add all namespaces
21514         to the symbol file.
21515
21516         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21517         pass it to the Namespace's .ctor.
21518
21519         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21520         and MethodBase arguments; pass the namespace ID to the symwriter;
21521         pass the MethodBase instead of the token to the symwriter.
21522         (SymbolWriter.DefineNamespace): New method to add a namespace to
21523         the symbol file.
21524
21525 2003-02-09  Martin Baulig  <martin@ximian.com>
21526
21527         * symbolwriter.cs: New file.  This is a wrapper around
21528         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
21529         methods here in near future.
21530
21531 2003-02-09  Martin Baulig  <martin@ximian.com>
21532
21533         * codegen.cs (EmitContext.Mark): Just pass the arguments to
21534         ILGenerator.MarkSequencePoint() which are actually used by the
21535         symbol writer.
21536
21537 2003-02-09  Martin Baulig  <martin@ximian.com>
21538
21539         * location.cs (SourceFile): New public sealed class.  This
21540         contains the name and an index which is used in the location's token.
21541         (Location): Reserve an appropriate number of bits in the token for
21542         the source file instead of walking over that list, this gives us a
21543         really huge performance improvement when compiling with debugging.
21544
21545         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21546         `SourceFile' argument instead of a string.
21547         (Driver.ProcessFile): Add all the files via Location.AddFile(),
21548         but don't parse/tokenize here, we need to generate the list of all
21549         source files before we do that.
21550         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
21551         the files.
21552
21553         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21554         instead of a string.
21555
21556         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21557         of a string.
21558
21559 2003-02-09  Martin Baulig  <martin@ximian.com>
21560
21561         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21562         filename on `#line default'.
21563
21564 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21565
21566         * statement.cs: don't clear the pinned var when the fixed statement
21567         returns from the method (fixes bug#37752).
21568
21569 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21570
21571         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
21572         to IsValueType.
21573
21574 2003-02-07  Martin Baulig  <martin@ximian.com>
21575
21576         * driver.cs: Removed the `--debug-args' command line argument.
21577
21578         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21579         automatically by the AsssemblyBuilder.
21580         (CodeGen.InitializeSymbolWriter): We don't need to call any
21581         initialization function on the symbol writer anymore.  This method
21582         doesn't take any arguments.
21583
21584 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
21585
21586         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21587         from referenced assemblies as well.
21588
21589 2003-02-02  Martin Baulig  <martin@ximian.com>
21590
21591         * class.cs (MethodData.Emit): Generate debugging info for external methods.
21592
21593 2003-02-02  Martin Baulig  <martin@ximian.com>
21594
21595         * class.cs (Constructor.Emit): Open the symbol writer before
21596         emitting the constructor initializer.
21597         (ConstructorInitializer.Emit): Call ec.Mark() to allow
21598         single-stepping through constructor initializers.
21599
21600 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
21601
21602         * class.cs: Handle error 549: do not allow virtual methods in
21603         sealed classes. 
21604
21605 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21606
21607         * decl.cs: Check access levels when resolving types
21608
21609 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21610
21611         * statement.cs: Add parameters and locals set in catch blocks that might 
21612         return to set vector
21613
21614 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
21615
21616         * class.cs (Operator): Set the SpecialName flags for operators.
21617
21618         * expression.cs (Invocation.DoResolve): Only block calls to
21619         accessors and operators on SpecialName methods.
21620
21621         (Cast.TryReduce): Handle conversions from char constants.
21622
21623
21624 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21625
21626         * statement.cs: small memory and time optimization in FlowBranching.
21627
21628 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
21629
21630         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21631         problem that the last fix but in the other sid (Set).
21632
21633         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21634         access when there is no indexer in the hierarchy.
21635
21636 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21637
21638         * class.cs: Combine some if statements.
21639
21640 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21641
21642         * driver.cs: fixed bug #37187.
21643
21644 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
21645
21646         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21647         any indexer, it's needed to build a list with all the indexers in the
21648         hierarchy (AllGetters), else we have problems. Fixes #35653.
21649
21650 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * class.cs (MethodData.Define): It is wrong for an interface
21653         implementation to be static in both cases: explicit and implicit.
21654         We were only handling this in one case.
21655
21656         Improve the if situation there to not have negations.
21657
21658         * class.cs (Field.Define): Turns out that we do not need to check
21659         the unsafe bit on field definition, only on usage.  Remove the test.
21660
21661 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21662
21663         * driver.cs: use assembly.Location instead of Codebase (the latest
21664         patch made mcs fail when using MS assemblies).
21665
21666 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
21667
21668         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21669         get the path to *corlib.dll.
21670
21671 2003-01-21  Nick Drochak <ndrochak@gol.com>
21672
21673         * cs-tokenizer.cs:
21674         * pending.cs:
21675         * typemanager.cs: Remove compiler warnings
21676
21677 2003-01-20  Duncan Mak  <duncan@ximian.com>
21678
21679         * AssemblyInfo.cs: Bump the version number to 0.19.
21680
21681 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21682
21683         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21684
21685 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21686
21687         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21688
21689 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21690
21691         * cs-parser.jay: Small fix: we were not comparing the constructor
21692         name correctly.   Thanks to Zoltan for the initial pointer.
21693
21694 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21695
21696         * cs-tokenizer.cs: Set file name when specified with #line
21697
21698 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21699
21700         * cs-parser.jay: Only perform the constructor checks here if we
21701         are named like the class;  This will help provider a better
21702         error.  The constructor path is taken when a type definition is
21703         not found, but most likely the user forgot to add the type, so
21704         report that rather than the constructor error.
21705
21706 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21707
21708         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21709         allocations.
21710
21711 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21712
21713         * cs-parser.jay: Add cleanup call.
21714
21715 2003-01-13  Duncan Mak  <duncan@ximian.com>
21716
21717         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21718         consistent with other methods.
21719
21720 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21721
21722         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21723
21724 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21725
21726         * attribute.cs: only set GuidAttr to true when we have a
21727         GuidAttribute.
21728
21729 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21730
21731         * ecore.cs:
21732         * expression.cs:
21733         * typemanager.cs: fixes to allow mcs compile corlib with the new
21734         Type.IsSubclassOf fix.
21735
21736 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21737
21738         * expression.cs (LocalVariableReference.DoResolve): Classify a
21739         constant as a value, not as a variable.   Also, set the type for
21740         the variable.
21741
21742         * cs-parser.jay (fixed_statement): take a type instead of a
21743         pointer_type, so we can produce a better error message later.
21744
21745         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21746         as an error.  
21747
21748         (For.DoEmit): Make inifinite loops have a
21749         non-conditional branch back.
21750
21751         (Fixed.DoEmit): First populate the pinned variables, then emit the
21752         statement, then clear the variables.  Before I was emitting the
21753         code once for each fixed piece.
21754
21755
21756 2003-01-08  Martin Baulig  <martin@ximian.com>
21757
21758         * statement.cs (FlowBranching.MergeChild): A break in a
21759         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21760
21761 2003-01-08  Martin Baulig  <martin@ximian.com>
21762
21763         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21764         lives in the same number space than `param_map'.  Fixes #36154.
21765
21766 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21767
21768         * cs-parser.jay (constructor_declaration): Set the
21769         Constructor.ModFlags before probing for it.  This makes the
21770         compiler report 514, 515 and 132 (the code was there, but got
21771         broken). 
21772
21773         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21774         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21775         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21776
21777 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21778
21779         * enum.cs: create the enum static fields using the enum type.
21780
21781 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21782
21783         * class.cs: don't try to create the ParamBuilder for the return
21784         type if it's not needed (and handle it breaking for the ms runtime
21785         anyway).
21786
21787 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21788
21789         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21790
21791 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21792
21793         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21794         the command.   This showed up while compiling the JANET source
21795         code, which used \r as its only newline separator.
21796
21797 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21798
21799         * class.cs (Method.Define): If we are an operator (because it
21800         reuses our code), then set the SpecialName and HideBySig.  #36128
21801
21802 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21803
21804         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21805         exception, report error 120 `object reference required'.
21806
21807         * driver.cs: Add --pause option, used during to measure the size
21808         of the process as it goes with --timestamp.
21809
21810         * expression.cs (Invocation.DoResolve): Do not allow methods with
21811         SpecialName to be invoked.
21812
21813 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21814
21815         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21816         number before adding it.
21817
21818 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21819
21820         * ecore.cs (StandardImplicitConversion): When in an unsafe
21821         context, we allow conversion between void * to any other pointer
21822         type. This fixes bug #35973.
21823
21824 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21825
21826         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21827         is not thrown when extensionless outputs are used 
21828
21829 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21830
21831         * rootcontext.cs: fixed compilation of corlib.
21832
21833 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21834
21835         * attribute.cs (Attributes.Contains): Add new method.
21836
21837         * class.cs (MethodCore.LabelParameters): if the parameter is an
21838         `out' parameter, check that no attribute `[In]' has been passed.
21839
21840         * enum.cs: Handle the `value__' name in an enumeration.
21841
21842 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21843
21844         * decl.cs: Added special case to allow overrides on "protected
21845         internal" methods
21846
21847 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21848
21849         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21850         since it makes much more sense.
21851
21852         (Attributes.ctor): Don't require a Location parameter.
21853
21854         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21855
21856         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21857         since we already have that information per attribute.
21858
21859         * everywhere : make appropriate changes.
21860
21861         * class.cs (LabelParameters): Write the code which actually
21862         applies attributes to the return type. We can't do this on the MS
21863         .NET runtime so we flag a warning in the case an exception is
21864         thrown.
21865
21866 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21867
21868         * const.cs: Handle implicit null conversions here too.
21869
21870 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21871
21872         * class.cs (MethodCore.LabelParameters): Remove the extra
21873         Type [] parameter since it is completely unnecessary. Instead
21874         pass in the method's attributes so that we can extract
21875         the "return" attribute.
21876
21877 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21878
21879         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21880         of ignoring it and letting the compile continue.
21881
21882         * typemanager.cs (ChangeType): use an extra argument to return an
21883         error condition instead of throwing an exception.
21884
21885 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21886
21887         * expression.cs (Unary.TryReduce): mimic the code for the regular
21888         code path.  Perform an implicit cast in the cases where we can
21889         implicitly convert to one of the integral types, and then reduce
21890         based on that constant.   This fixes bug #35483.
21891
21892 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21893
21894         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21895
21896 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21897
21898         * namespace.cs: fixed bug #35489.
21899
21900 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21901
21902         * class.cs: Remove some dead code.
21903
21904         * cs-parser.jay: Estimate the number of methods needed
21905         (RootContext.MethodCount);
21906
21907         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21908         numbers instead of StringBuilders.
21909
21910         * support.cs (PtrHashtable): Add constructor with initial size;
21911         We can now reduce reallocations of the method table.
21912
21913 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21914
21915         * attribute.cs (ApplyAttributes): Keep track of the emitted
21916         attributes on a per-target basis. This fixes bug #35413.
21917
21918 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21919
21920         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21921         default to the Windows 1252 encoding.
21922
21923         (UnixParseOption): Support version, thanks to Alp for the missing
21924         pointer. 
21925
21926         * AssemblyInfo.cs: Add nice assembly information.
21927
21928         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21929         (bug 35169).
21930
21931         * cs-parser.jay: Allow a trailing comma before the close bracked
21932         in the attribute_section production.
21933
21934         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21935         address of the instance was being taken, I will take this out,
21936         because we take the address of the object immediately here.
21937
21938 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21939
21940         * typemanager.cs (AreMultipleAllowed): Take care of the most
21941         obvious case where attribute type is not in the current assembly -
21942         stupid me ;-)
21943
21944 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21945
21946         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21947         definitions, instead of doing that afterwards.  
21948
21949         Also we use a nice little hack, depending on the constructor, we
21950         know if we are a "composed" name or a simple name.  Hence, we
21951         avoid the IndexOf test, and we avoid 
21952
21953         * codegen.cs: Add code to assist in a bug reporter to track down
21954         the source of a compiler crash. 
21955
21956 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21957
21958         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21959         types have been emitted for a given element and flag an error
21960         if something which does not have AllowMultiple set is used more
21961         than once.
21962
21963         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21964         attribute types and their corresponding AllowMultiple properties
21965
21966         (AreMultipleAllowed): Check the property for a given type.
21967
21968         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21969         property in the case we have a TypeContainer.
21970
21971         (Attributes.AddAttribute): Detect duplicates and just skip on
21972         adding them. This trivial fix catches a pretty gross error in our
21973         attribute emission - global attributes were being emitted twice!
21974
21975         Bugzilla bug #33187 is now fixed.
21976
21977 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21978
21979         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21980         instead of pp_and).
21981
21982         * expression.cs (Binary.ResolveOperator): I can only use the
21983         Concat (string, string, string) and Concat (string, string,
21984         string, string) if the child is actually a concatenation of
21985         strings. 
21986
21987 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21988
21989         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21990         context where we need a 2-character lookahead.
21991
21992         * pending.cs (PendingImplementation): Rework so we can keep track
21993         of interface types all the time, and flag those which were
21994         implemented by parents as optional.
21995
21996 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21997
21998         * expression.cs (Binary.ResolveOperator): Use
21999         String.Concat(string,string,string) or
22000         String.Concat(string,string,string,string) when possible. 
22001
22002         * typemanager: More helper methods.
22003
22004
22005 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
22006
22007         * pending.cs: remove the bogus return from GetMissingInterfaces()
22008         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
22009
22010 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22011
22012         * namespace.cs: avoid duplicated 'using xxx' being added to
22013         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
22014         when we get more than one 'using' statement for the same namespace.
22015         Report a CS0105 warning for it.
22016
22017 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
22018
22019         * cs-tokenizer.cs (consume_identifier): use read directly, instead
22020         of calling getChar/putback, uses internal knowledge of it.    
22021
22022         (xtoken): Reorder tokenizer so most common patterns are checked
22023         first.  This reduces the compilation time in another 5% (from 8.11s
22024         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
22025
22026         The parsing time is 22% of the compilation in mcs, and from that
22027         64% is spent on the tokenization process.  
22028
22029         I tried using a binary search for keywords, but this is slower
22030         than the hashtable.  Another option would be to do a couple of
22031         things:
22032
22033                 * Not use a StringBuilder, instead use an array of chars,
22034                   with a set value.  Notice that this way we could catch
22035                   the 645 error without having to do it *afterwards*.
22036
22037                 * We could write a hand-parser to avoid the hashtable
22038                   compares altogether.
22039
22040         The identifier consumption process takes 37% of the tokenization
22041         time.  Another 15% is spent on is_number.  56% of the time spent
22042         on is_number is spent on Int64.Parse:
22043
22044                 * We could probably choose based on the string length to
22045                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
22046                   computations. 
22047
22048         Another 3% is spend on wrapping `xtoken' in the `token' function.
22049
22050         Handle 0xa0 as whitespace (#34752)
22051
22052 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
22053
22054         * typemanager.cs (IsCLRType): New routine to tell whether a type
22055         is one of the builtin types.  
22056
22057         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
22058         typecode in more places instead of doing pointer comparissions.
22059         We could leverage some knowledge about the way the typecodes are
22060         laid out.
22061
22062         New code to cache namespaces in assemblies, it is currently not
22063         invoked, to be used soon.
22064
22065         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
22066
22067         * expression.cs (Binary.ResolveOperator): specially handle
22068         strings, and do not perform user-defined operator overloading for
22069         built-in types.
22070
22071 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
22072
22073         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
22074         internalcall as it is a pretty simple operation;  Avoid whenever
22075         possible to call Char.IsLetter.
22076
22077         (consume_identifier): Cut by half the number of
22078         hashtable calls by merging the is_keyword and GetKeyword behavior.
22079
22080         Do not short-circuit, because if we do, we
22081         report errors (ie, #if false && true would produce an invalid
22082         directive error);
22083
22084
22085 2002-11-24  Martin Baulig  <martin@ximian.com>
22086
22087         * expression.cs (Cast.TryReduce): If we're in checked syntax,
22088         check constant ranges and report a CS0221.  Fixes #33186.
22089
22090 2002-11-24  Martin Baulig  <martin@ximian.com>
22091
22092         * cs-parser.jay: Make this work for uninitialized variable
22093         declarations in the `for' initializer.  Fixes #32416.
22094
22095 2002-11-24  Martin Baulig  <martin@ximian.com>
22096
22097         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22098         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
22099
22100 2002-11-24  Martin Baulig  <martin@ximian.com>
22101
22102         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22103         argument; if true, we also check for user-defined conversions.
22104         This is only needed if both arguments are of a user-defined type.
22105         Fixes #30443, added test-175.cs.
22106         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22107
22108         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22109
22110 2002-11-24  Martin Baulig  <martin@ximian.com>
22111
22112         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22113         function to get the store opcode.
22114         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22115         only emit the Ldelema if the store opcode is Stobj.  You must run
22116         both test-34 and test-167 to test this.  Fixes #34529.
22117
22118 2002-11-23  Martin Baulig  <martin@ximian.com>
22119
22120         * ecore.cs (Expression.MemberLookup): Added additional
22121         `qualifier_type' argument which is used when we're being called
22122         from MemberAccess.DoResolve() and null if we're called from a
22123         SimpleName lookup.
22124         (Expression.MemberLookupFailed): New method to report errors; this
22125         does the CS1540 check and reports the correct error message.
22126
22127         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22128         argument for the CS1540 check and redone the way how we're dealing
22129         with private members.  See the comment in the source code for details.
22130         (FilterWithClosure): Reverted this back to revision 1.197; renamed
22131         `closure_start_type' to `closure_qualifier_type' and check whether
22132         it's not null.  It was not this filter being broken, it was just
22133         being called with the wrong arguments.
22134
22135         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22136         and pass it the correct `qualifier_type'; this also does the error
22137         handling for us.
22138
22139 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
22140
22141         * expression.cs (Invocation.EmitParams): If the we are dealing
22142         with a non-built-in value type, load its address as well.
22143
22144         (ArrayCreation): Use a a pretty constant instead
22145         of the hardcoded value 2.   Use 6 instead of 2 for the number of
22146         static initializers.  
22147
22148         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22149         because they are not really value types, just glorified integers. 
22150
22151         * driver.cs: Do not append .exe, the CSC compiler does not do it.
22152
22153         * ecore.cs: Remove redundant code for enumerations, make them use
22154         the same code path as everything else, fixes the casting issue
22155         with enumerations in Windows.Forms.
22156
22157         * attribute.cs: Do only cast to string if it is a string, the
22158         validation happens later.
22159
22160         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22161         people upgrade their corlibs.
22162
22163         * ecore.cs: Oops, enumerations were not following the entire code path
22164
22165 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * typemanager.cs (FilterWithClosure): Commented out the test for
22168         1540 in typemanager.cs, as it has problems when accessing
22169         protected methods from a parent class (see test-174.cs). 
22170
22171         * attribute.cs (Attribute.ValidateGuid): new method.
22172         (Attribute.Resolve): Use above.
22173
22174 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22177
22178         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22179         handling for enumerations, as we only needed the TypeContainer
22180         functionality to begin with (this is required for the fix below to
22181         work for enums that reference constants in a container class for
22182         example). 
22183
22184         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22185
22186         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22187         a valid TypeBuilder to perform lookups on.o
22188
22189         * class.cs (InheritableMemberSignatureCompare): Use true in the
22190         call to GetGetMethod and GetSetMethod, because we are comparing
22191         the signature, and we need to get the methods *even* if they are
22192         private. 
22193
22194         (PropertyBase.CheckBase): ditto.
22195
22196         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22197         GotoCase.Resolve): Use Peel on EmpytCasts.
22198
22199         * ecore.cs (EmptyCast): drop child, add Peel method.
22200
22201 2002-11-17  Martin Baulig  <martin@ximian.com>
22202
22203         * ecore.cs (EmptyCast.Child): New public property.
22204
22205         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22206         label resolved to an EmptyCast.  Fixes #34162.
22207         (GotoCase.Resolve): Likewise.
22208         (Block.EmitMeta): Likewise.
22209
22210 2002-11-17  Martin Baulig  <martin@ximian.com>
22211
22212         * expression.cs (Invocation.BetterConversion): Prefer int over
22213         uint; short over ushort; long over ulong for integer literals.
22214         Use ImplicitConversionExists instead of StandardConversionExists
22215         since we also need to check for user-defined implicit conversions.
22216         Fixes #34165.  Added test-173.cs.
22217
22218 2002-11-16  Martin Baulig  <martin@ximian.com>
22219
22220         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22221         with the `true' and `false' literals.  Fixes #33151.
22222
22223 2002-11-16  Martin Baulig  <martin@ximian.com>
22224
22225         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22226         October 22nd; don't do the cs1540 check for static members.
22227
22228         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22229         now using our own filter here and doing the cs1540 check again.
22230
22231 2002-11-16  Martin Baulig  <martin@ximian.com>
22232
22233         * support.cs (InternalParameters): Don't crash if we don't have
22234         any fixed parameters.  Fixes #33532.
22235
22236 2002-11-16  Martin Baulig  <martin@ximian.com>
22237
22238         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22239         when looking up static methods to make this work on Windows.
22240         Fixes #33773.
22241
22242 2002-11-16  Martin Baulig  <martin@ximian.com>
22243
22244         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22245         a setter rather than using PropertyInfo.CanWrite.
22246
22247 2002-11-15  Nick Drochak  <ndrochak@gol.com>
22248
22249         * class.cs: Allow acces to block member by subclasses. Fixes build
22250         breaker.
22251
22252 2002-11-14  Martin Baulig  <martin@ximian.com>
22253
22254         * class.cs (Constructor.Emit): Added the extern/block check.
22255         Fixes bug #33678.
22256
22257 2002-11-14  Martin Baulig  <martin@ximian.com>
22258
22259         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22260         iteration while looking for indexers, this is needed because the
22261         indexer may have a different name in our base classes.  Fixed the
22262         error reporting (no indexers at all, not get accessor, no
22263         overloaded match).  Fixes bug #33089.
22264         (IndexerAccess.DoResolveLValue): Likewise.
22265
22266 2002-11-14  Martin Baulig  <martin@ximian.com>
22267
22268         * class.cs (PropertyBase.CheckBase): Make this work for multiple
22269         indexers.  Fixes the first part of bug #33089.
22270         (MethodSignature.InheritableMemberSignatureCompare): Added support
22271         for properties.
22272
22273 2002-11-13  Ravi Pratap  <ravi@ximian.com>
22274
22275         * attribute.cs (Attribute.Resolve): Catch the
22276         NullReferenceException and report it since it isn't supposed to
22277         happen. 
22278
22279 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
22280
22281         * expression.cs (Binary.EmitBranchable): Also handle the cases for
22282         LogicalOr and LogicalAnd that can benefit from recursively
22283         handling EmitBranchable.  The code now should be nice for Paolo.
22284
22285 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
22286
22287         * typemanager.cs (LookupType): Added a negative-hit hashtable for
22288         the Type lookups, as we perform quite a number of lookups on
22289         non-Types.  This can be removed once we can deterministically tell
22290         whether we have a type or a namespace in advance.
22291
22292         But this might require special hacks from our corlib.
22293
22294         * TODO: updated.
22295
22296         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22297         and double which avoids a conversion from an integer to a double.
22298
22299         * expression.cs: tiny optimization, avoid calling IsConstant,
22300         because it effectively performs the lookup twice.
22301
22302 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
22303
22304         But a bogus return here to keep the semantics of the old code
22305         until the Mono runtime is fixed.
22306
22307         * pending.cs (GetMissingInterfaces): New method used to remove all
22308         the interfaces that are already implemented by our parent
22309         classes from the list of pending methods. 
22310
22311         * interface.cs: Add checks for calls after ResolveTypeExpr.
22312
22313 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
22314
22315         * class.cs (Class.Emit): Report warning 67: event not used if the
22316         warning level is beyond 3.
22317
22318         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22319         being a NullLiteral.
22320
22321         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22322         specifiers. 
22323
22324         * class.cs (TypeContainer.GetClassBases): Cover a missing code
22325         path that might fail if a type can not be resolved.
22326
22327         * expression.cs (Binary.Emit): Emit unsigned versions of the
22328         operators. 
22329
22330         * driver.cs: use error 5.
22331
22332 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22333
22334         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22335
22336 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
22337
22338         * cs-parser.jay (switch_section): A beautiful patch from Martin
22339         Baulig that fixed 33094.
22340
22341 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
22342
22343         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22344         Check whether the base is abstract and report an error if so.
22345
22346         * expression.cs (IndexerAccess.DoResolveLValue,
22347         IndexerAccess.DoResolve): ditto. 
22348
22349         (Invocation.DoResolve): ditto.
22350
22351         (Invocation.FullMethodDesc): Improve the report string.
22352
22353         * statement.cs (Block): Eliminate IsVariableDefined as it is
22354         basically just a wrapper for GetVariableInfo.
22355
22356         * ecore.cs (SimpleName): Use new 
22357
22358         * support.cs (ReflectionParamter.ParameterType): We unwrap the
22359         type, as we return the actual parameter ref/unref state on a
22360         different call.
22361
22362 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
22363
22364         * support.cs: Return proper flags REF/OUT fixing the previous
22365         commit.  
22366
22367         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
22368         not used to mean `ref' but `ref or out' in ParameterReference
22369
22370         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22371         full type signature instead of calling TypeManger.CSharpName
22372         ourselves. 
22373
22374         * support.cs (InternalParameters.ParameterDesc): Do not compare
22375         directly to the modflags, because REF/OUT will actually be bitsets
22376         if set. 
22377
22378         * delegate.cs (VerifyMethod): Check also the modifiers.
22379
22380         * cs-tokenizer.cs: Fix bug where floating point values with an
22381         exponent where a sign was missing was ignored.
22382
22383         * driver.cs: Allow multiple assemblies to be specified in a single
22384         /r: argument
22385
22386 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
22387
22388         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
22389         because identifiers after a parenthesis would end up in this kind
22390         of production, and we needed to desamiguate it for having casts
22391         like:
22392
22393                 (UserDefinedType *) xxx
22394
22395 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
22396
22397         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22398         we should set on the Bindingflags.NonPublic, but not turn on
22399         private_ok.  private_ok controls whether a Private member is
22400         returned (this is chekced on the filter routine), while the
22401         BindingFlags.NonPublic just controls whether private/protected
22402         will be allowed.   This fixes the problem part of the problem of
22403         private properties being allowed to be used in derived classes.
22404
22405         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22406         so we can call the children DoResolveLValue method (this will
22407         properly signal errors on lvalue assignments to base properties)
22408
22409         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22410         getter are null, and we have a property info, we know that this
22411         happened because the lookup failed, so we report an error 122 for
22412         protection level violation.
22413
22414         We also silently return if setter and getter are null in the
22415         resolve functions, this condition only happens if we have flagged
22416         the error before.  This is the other half of the problem. 
22417
22418         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22419         not have accessibility information, that is why we were returning
22420         true in the filter function in typemanager.cs.
22421
22422         To properly report 122 (property is inaccessible because of its
22423         protection level) correctly, we report this error in ResolveAccess
22424         by failing if both the setter and the getter are lacking (ie, the
22425         lookup failed). 
22426
22427         DoResolve and DoLResolve have been modified to check for both
22428         setter/getter being null and returning silently, the reason being
22429         that I did not want to put the knowledge about this error in upper
22430         layers, like:
22431
22432         int old = Report.Errors;
22433         x = new PropertyExpr (...);
22434         if (old != Report.Errors)
22435                 return null;
22436         else
22437                 return x;
22438
22439         So the property expr is returned, but it is invalid, so the error
22440         will be flagged during the resolve process. 
22441
22442         * class.cs: Remove InheritablePropertySignatureCompare from the
22443         class, as we no longer depend on the property signature to compute
22444         whether it is possible to implement a method or not.
22445
22446         The reason is that calling PropertyInfo.GetGetMethod will return
22447         null (in .NET, in Mono it works, and we should change this), in
22448         cases where the Get Method does not exist in that particular
22449         class.
22450
22451         So this code:
22452
22453         class X { public virtual int A { get { return 1; } } }
22454         class Y : X { }
22455         class Z : Y { public override int A { get { return 2; } } }
22456
22457         Would fail in Z because the parent (Y) would not have the property
22458         defined.  So we avoid this completely now (because the alternative
22459         fix was ugly and slow), and we now depend exclusively on the
22460         method names.
22461
22462         (PropertyBase.CheckBase): Use a method-base mechanism to find our
22463         reference method, instead of using the property.
22464
22465         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22466         routines are gone now.
22467
22468         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22469         names, they were incorrectly named.
22470
22471         * cs-tokenizer.cs: Return are more gentle token on failure. 
22472
22473         * pending.cs (PendingImplementation.InterfaceMethod): This routine
22474         had an out-of-sync index variable, which caused it to remove from
22475         the list of pending methods the wrong method sometimes.
22476
22477 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
22478
22479         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22480         CanWrite, because those refer to this particular instance of the
22481         property, and do not take into account the fact that we can
22482         override single members of a property.
22483
22484         Constructor requires an EmitContext.  The resolution process does
22485         not happen here, but we need to compute the accessors before,
22486         because the resolution does not always happen for properties.
22487
22488         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22489         subclass, before we did not update this flag, but we did update
22490         bindingflags. 
22491
22492         (GetAccessors): Drop this routine, as it did not work in the
22493         presence of partially overwritten set/get methods. 
22494
22495         Notice that this broke the cs1540 detection, but that will require
22496         more thinking. 
22497
22498 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22499
22500         * class.cs:
22501         * codegen.cs:
22502         * driver.cs: issue a warning instead of an error if we don't support
22503         debugging for the platform. Also ignore a couple of errors that may
22504         arise when trying to write the symbols. Undo my previous patch.
22505
22506 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22507
22508         * driver.cs: ignore /debug switch except for Unix platforms.
22509
22510 2002-10-23  Nick Drochak  <ndrochak@gol.com>
22511
22512         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22513
22514 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
22515
22516         * driver.cs: Do not make mcs-debug conditional, so we do not break
22517         builds that use it.
22518
22519         * statement.cs (UsageVector.MergeChildren): I would like Martin to
22520         review this patch.  But basically after all the children variables
22521         have been merged, the value of "Breaks" was not being set to
22522         new_breaks for Switch blocks.  I think that it should be set after
22523         it has executed.  Currently I set this to the value of new_breaks,
22524         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22525         conservative, but I do not understand this code very well.
22526
22527         I did not break anything in the build, so that is good ;-)
22528
22529         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22530
22531 2002-10-20  Mark Crichton  <crichton@gimp.org>
22532
22533         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
22534
22535 2002-10-20  Nick Drochak  <ndrochak@gol.com>
22536
22537         * cfold.cs: Fixed compile blocker.
22538
22539 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * driver.cs: I was chekcing the key, not the file.
22542
22543 2002-10-19  Ravi Pratap  <ravi@ximian.com>
22544
22545         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22546         message that we were generating - we just need to silently return
22547         a null.
22548
22549 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
22550
22551         * class.cs (Event.Define): Change my previous commit, as this
22552         breaks the debugger.  This is a temporary hack, as it seems like
22553         the compiler is generating events incorrectly to begin with.
22554
22555         * expression.cs (Binary.ResolveOperator): Added support for 
22556         "U operator - (E x, E y)"
22557
22558         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22559         y)".
22560
22561         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22562         init-only variables, but this path did not take into account that
22563         there might be also instance readonly variables.  Correct this
22564         problem. 
22565
22566         This fixes bug 32253
22567
22568         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22569         delegates as well.
22570
22571         * driver.cs: Change the extension for modules to `netmodule'
22572
22573         * cs-parser.jay: Improved slightly the location tracking for
22574         the debugger symbols.
22575
22576         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22577         modifiers that were specified instead of the hardcoded value
22578         (FamAndAssem).  This was basically ignoring the static modifier,
22579         and others.  Fixes 32429.
22580
22581         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22582         fixed a bug in the process (32476)
22583
22584         * expression.cs (ArrayAccess.EmitAssign): Patch from
22585         hwang_rob@yahoo.ca that fixes bug 31834.3
22586
22587 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
22588
22589         * driver.cs: Make the module extension .netmodule.
22590
22591 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
22592
22593         * driver.cs: Report an error if the resource file is not found
22594         instead of crashing.
22595
22596         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22597         false, like Emit does.
22598
22599 2002-10-16  Nick Drochak  <ndrochak@gol.com>
22600
22601         * typemanager.cs: Remove unused private member.  Also reported mcs
22602         bug to report this as a warning like csc.
22603
22604 2002-10-15  Martin Baulig  <martin@gnome.org>
22605
22606         * statement.cs (Statement.Emit): Made this a virtual method; emits
22607         the line number info and calls DoEmit().
22608         (Statement.DoEmit): New protected abstract method, formerly knows
22609         as Statement.Emit().
22610
22611         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22612
22613 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
22614
22615         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22616         have fixed a remaining problem: not every AddXXXX was adding a
22617         fully qualified name.  
22618
22619         Now everyone registers a fully qualified name in the DeclSpace as
22620         being defined instead of the partial name.  
22621
22622         Downsides: we are slower than we need to be due to the excess
22623         copies and the names being registered this way.  
22624
22625         The reason for this is that we currently depend (on the corlib
22626         bootstrap for instance) that types are fully qualified, because
22627         we dump all the types in the namespace, and we should really have
22628         types inserted into the proper namespace, so we can only store the
22629         basenames in the defined_names array.
22630
22631 2002-10-10  Martin Baulig  <martin@gnome.org>
22632
22633         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22634         from bug #31834, see the bug report for a testcase which is
22635         miscompiled.
22636
22637 2002-10-10  Martin Baulig  <martin@gnome.org>
22638
22639         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22640         flow analysis code for this.
22641
22642         * statement.cs (Do, While, For): Tell the flow analysis code about
22643         infinite loops.
22644         (FlowBranching.UsageVector): Added support for infinite loops.
22645         (Block.Resolve): Moved the dead code elimination here and use flow
22646         analysis to do it.
22647
22648 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
22649
22650         * class.cs (Field.Define): Catch cycles on struct type
22651         definitions. 
22652
22653         * typemanager.cs (IsUnmanagedtype): Do not recursively check
22654         fields if the fields are static.  We only need to check instance
22655         fields. 
22656
22657         * expression.cs (As.DoResolve): Test for reference type.
22658
22659         * statement.cs (Using.ResolveExpression): Use
22660         ConvertImplicitRequired, not ConvertImplicit which reports an
22661         error on failture
22662         (Using.ResolveLocalVariableDecls): ditto.
22663
22664         * expression.cs (Binary.ResolveOperator): Report errors in a few
22665         places where we had to.
22666
22667         * typemanager.cs (IsUnmanagedtype): Finish implementation.
22668
22669 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22670
22671         * expression.cs: Use StoreFromPtr instead of extracting the type
22672         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22673
22674         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22675         an enumeration value to a System.Enum, but System.Enum is not a
22676         value type, but an class type, so we need to box.
22677
22678         (Expression.ConvertExplicit): One codepath could return
22679         errors but not flag them.  Fix this.  Fixes #31853
22680
22681         * parameter.cs (Resolve): Do not allow void as a parameter type.
22682
22683 2002-10-06  Martin Baulig  <martin@gnome.org>
22684
22685         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22686         if it's a class type and not a struct.  Fixes #31815.
22687
22688 2002-10-06  Martin Baulig  <martin@gnome.org>
22689
22690         * statement.cs: Reworked the flow analysis code a bit to make it
22691         usable for dead code elimination.
22692
22693 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22694
22695         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22696
22697 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22698
22699         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22700         to fix the test 165, will investigate deeper.
22701
22702 2002-10-04  Martin Baulig  <martin@gnome.org>
22703
22704         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22705         finally blocks actually work.
22706         (Try.Resolve): We don't need to create a sibling for `finally' if
22707         there is no finally block.
22708
22709 2002-10-04  Martin Baulig  <martin@gnome.org>
22710
22711         * class.cs (Constructor.Define): The default accessibility for a
22712         non-default constructor is private, not public.
22713
22714 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22715
22716         * class.cs (Constructor): Make AllowedModifiers public, add
22717         EXTERN.
22718
22719         * cs-parser.jay: Perform the modifiers test here, as the
22720         constructor for the Constructor class usually receives a zero
22721         because of the way we create it (first we create, later we
22722         customize, and we were never checking the modifiers).
22723
22724         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22725         is a version of LookupTypeReflection that includes the type-name
22726         cache.  This can be used as a fast path for functions that know
22727         the fully qualified name and are only calling into *.GetType() to
22728         obtain a composed type.
22729
22730         This is also used by TypeManager.LookupType during its type
22731         composition.
22732
22733         (LookupType): We now also track the real type name, as sometimes
22734         we can get a quey for the real type name from things like
22735         ComposedCast.  This fixes bug 31422.
22736
22737         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22738         complete type fullname, it does not have to go through the type
22739         resolution system to obtain the composed version of the type (for
22740         obtaining arrays or pointers).
22741
22742         (Conditional.Emit): Use the EmitBoolExpression to
22743         generate nicer code, as requested by Paolo.
22744
22745         (ArrayCreation.CheckIndices): Use the patch from
22746         hwang_rob@yahoo.ca to validate the array initializers. 
22747
22748 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22749
22750         * class.cs (ConstructorInitializer.Emit): simplify code by using
22751         Invocation.EmitCall, and at the same time, fix the bugs in calling
22752         parent constructors that took variable arguments. 
22753
22754         * ecore.cs (Expression.ConvertNumericExplicit,
22755         Expression.ImplicitNumericConversion): Remove the code that
22756         manually wrapped decimal (InternalTypeConstructor call is now gone
22757         as well).
22758
22759         * expression.cs (Cast.TryReduce): Also handle decimal types when
22760         trying to perform a constant fold on the type.
22761
22762         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22763
22764         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22765         that only turned off an error report, and did nothing else. 
22766
22767 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22768
22769         * driver.cs: Handle and ignore /fullpaths
22770
22771 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22772
22773         * expression.cs (Binary.ResolveOperator): Catch the case where
22774         DoNumericPromotions returns true, 
22775
22776         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22777
22778 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22779
22780         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22781         report error 70.
22782
22783 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22784
22785         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22786         conversion exists, but it is also required that the conversion be
22787         performed.  This manifested in "(Type64Enum) 2".  
22788
22789         * class.cs (TypeManager.AddMethod): The fix is not to change
22790         AddEnum, because that one was using a fully qualified name (every
22791         DeclSpace derivative does), but to change the AddMethod routine
22792         that was using an un-namespaced name.  This now correctly reports
22793         the duplicated name.
22794
22795         Revert patch until I can properly fix it.  The issue
22796         is that we have a shared Type space across all namespaces
22797         currently, which is wrong.
22798
22799         Options include making the Namespace a DeclSpace, and merge
22800         current_namespace/current_container in the parser.
22801
22802 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22803
22804         * cs-parser.jay: Improve error reporting when we get a different
22805         kind of expression in local_variable_type and
22806         local_variable_pointer_type. 
22807
22808         Propagate this to avoid missleading errors being reported.
22809
22810         * ecore.cs (ImplicitReferenceConversion): treat
22811         TypeManager.value_type as a target just like object_type.   As
22812         code like this:
22813
22814         ValueType v = 1;
22815
22816         Is valid, and needs to result in the int 1 being boxed before it
22817         is assigned to the value type v.
22818
22819         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22820         to validate the enumeration name.
22821
22822         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22823         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22824         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22825
22826         * ecore.cs (TryImplicitIntConversion): When doing an
22827         implicit-enumeration-conversion, check if the type is 64-bits and
22828         perform a conversion before passing to EnumConstant.
22829
22830 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22831
22832         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22833         report ambiguous type references.  Unlike the MS version, we
22834         report what the ambiguity is.   Innovation at work ;-)
22835
22836         (DeclSpace.FindType): Require a location argument to
22837         display when we display an ambiguous error.
22838
22839         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22840
22841         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22842
22843         * expression.cs (EmitDynamicInitializers): Apply patch from
22844         hwang_rob@yahoo.ca that fixes the order in which we emit our
22845         initializers. 
22846
22847 2002-09-21  Martin Baulig  <martin@gnome.org>
22848
22849         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22850         delegate takes no arguments.
22851
22852 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22853
22854         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22855         from integers.
22856
22857         * expression.cs: Extract the underlying type.
22858
22859         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22860
22861         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22862
22863 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22864
22865         * class.cs (TypeContainer.DefineType): We can not use the nice
22866         PackingSize with the size set to 1 DefineType method, because it
22867         will not allow us to define the interfaces that the struct
22868         implements.
22869
22870         This completes the fixing of bug 27287
22871
22872         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22873         means also structs.  This fixes part of the problem. 
22874         (Expresion.ImplicitReferenceConversionExists): ditto.
22875
22876         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22877         error if there were no errors reported during the type lookup
22878         process, to avoid duplicates or redundant errors.  Without this
22879         you would get an ambiguous errors plus a type not found.  We have
22880         beaten the user enough with the first error.  
22881
22882         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22883         reference. 
22884
22885         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22886         during the resolution process, stop the lookup, this avoids
22887         repeated error reports (same error twice).
22888
22889         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22890
22891         * typemanager.cs (LookupType): Redo the type lookup code to match
22892         the needs of System.Reflection.  
22893
22894         The issue is that System.Reflection requires references to nested
22895         types to begin with a "+" sign instead of a dot.  So toplevel
22896         types look like: "NameSpace.TopLevelClass", and nested ones look
22897         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22898         levels. 
22899
22900 2002-09-19  Martin Baulig  <martin@gnome.org>
22901
22902         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22903         says that a method always returns or always throws an exception,
22904         don't report the CS0161.
22905
22906         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22907         set `Returns = new_returns'.
22908
22909 2002-09-19  Martin Baulig  <martin@gnome.org>
22910
22911         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22912         to an enum constant, check for a CS0176.
22913
22914 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22915
22916         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22917         for operators that must be in pairs and report errors.
22918
22919         * ecore.cs (SimpleName.DoResolveType): During the initial type
22920         resolution process, when we define types recursively, we must
22921         check first for types in our current scope before we perform
22922         lookups in the enclosing scopes.
22923
22924         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22925
22926         (Invocation.VerifyArgumentsCompat): Call
22927         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22928         I thought we were supposed to always call this, but there are a
22929         few places in the code where we dont do it.
22930
22931 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22932
22933         * driver.cs: Add support in -linkres and -resource to specify the
22934         name of the identifier.
22935
22936 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22937
22938         * ecore.cs (StandardConversionExists): Sync with the conversion
22939         code: allow anything-* to void* conversions.
22940
22941         (FindMostSpecificSource): Use an Expression argument
22942         instead of a Type, because we might be handed over a Literal which
22943         gets a few more implicit conversions that plain types do not.  So
22944         this information was being lost.
22945
22946         Also, we drop the temporary type-holder expression when not
22947         required.
22948
22949 2002-09-17  Martin Baulig  <martin@gnome.org>
22950
22951         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22952         this is an explicit interface implementation.
22953
22954 2002-09-17  Martin Baulig  <martin@gnome.org>
22955
22956         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22957         different `IndexerName' attributes.
22958
22959         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22960         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22961         virtual CommonResolve().
22962
22963 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22964
22965         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22966         and convert that to the UnderlyingType.
22967
22968         * statement.cs (Foreach.Resolve): Indexers are just like variables
22969         or PropertyAccesses.
22970
22971         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22972         inside quoted strings, we were not doing this before.
22973
22974 2002-09-16  Martin Baulig  <martin@gnome.org>
22975
22976         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22977         resolve it.  This is needed for the definite assignment check of the
22978         instance expression, fixes bug #29846.
22979         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22980
22981 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22982
22983         * parameter.cs: Fix compile error.  Cannot reference static member
22984         from an instance object.  Is this an mcs bug?
22985
22986 2002-09-14  Martin Baulig  <martin@gnome.org>
22987
22988         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22989         multiple times.  Fixes bug #30295, added test-166.cs.
22990
22991 2002-09-14  Martin Baulig  <martin@gnome.org>
22992
22993         * statement.cs (Block.Emit): Don't emit unreachable code.
22994         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22995         `break' statements.
22996         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22997
22998 2002-09-14  Martin Baulig  <martin@gnome.org>
22999
23000         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
23001         is set.
23002
23003 2002-09-14  Martin Baulig  <martin@gnome.org>
23004
23005         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
23006         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
23007         be false on the ms runtime.
23008
23009 2002-09-13  Martin Baulig  <martin@gnome.org>
23010
23011         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
23012         the CS0038 error message.
23013
23014 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
23015
23016         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
23017         constant inside, return it.
23018
23019 2002-09-12  Martin Baulig  <martin@gnome.org>
23020
23021         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
23022         implicit conversion can be done between enum types.
23023
23024         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
23025         check whether an implicit conversion to the current enum's UnderlyingType
23026         exists and report an error if not.
23027
23028         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
23029         without debugging support.
23030
23031         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
23032         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
23033
23034 2002-09-12  Martin Baulig  <martin@gnome.org>
23035
23036         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
23037
23038         * ecore.cs (IMemberExpr.DeclaringType): New property.
23039         (SimpleName.SimpleNameResolve): Check whether we're accessing a
23040         nonstatic member of an outer type (CS0038).
23041
23042 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
23043
23044         * driver.cs: Activate the using-error detector at warning level
23045         4 (at least for MS-compatible APIs).
23046
23047         * namespace.cs (VerifyUsing): Small buglett fix.
23048
23049         * pending.cs (PendingImplementation): pass the container pointer. 
23050
23051         * interface.cs (GetMethods): Allow for recursive definition.  Long
23052         term, I would like to move every type to support recursive
23053         definitions, not the current ordering mechanism that we have right
23054         now.
23055
23056         The situation is this: Attributes are handled before interfaces,
23057         so we can apply attributes to interfaces.  But some attributes
23058         implement interfaces, we will now handle the simple cases
23059         (recursive definitions will just get an error).  
23060
23061         * parameter.cs: Only invalidate types at the end if we fail to
23062         lookup all types.  
23063
23064 2002-09-09  Martin Baulig  <martin@gnome.org>
23065
23066         * ecore.cs (PropertyExpr.Emit): Also check for
23067         TypeManager.system_int_array_get_length so this'll also work when
23068         compiling corlib.  Fixes #30003.
23069
23070 2002-09-09  Martin Baulig  <martin@gnome.org>
23071
23072         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
23073         and throw an exception if we can't get the type's size.  Fixed #30040,
23074         added test-165.cs.
23075
23076 2002-09-09  Martin Baulig  <martin@gnome.org>
23077
23078         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
23079
23080         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
23081         context.  Fixes bug #30027.
23082
23083         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
23084         virtual functions.  Fixes bug #30043, added test-164.cs.
23085
23086 2002-09-08  Ravi Pratap  <ravi@ximian.com>
23087
23088         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
23089
23090 2002-09-08  Nick Drochak  <ndrochak@gol.com>
23091
23092         * driver.cs: Use an object to get the windows codepage since it's not a
23093         static property.
23094
23095 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
23096
23097         * statement.cs (For.Emit): for infinite loops (test == null)
23098         return whether there is a break inside, not always "true".
23099
23100         * namespace.cs (UsingEntry): New struct to hold the name of the
23101         using definition, the location where it is defined, and whether it
23102         has been used in a successful type lookup.
23103
23104         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23105         strings.
23106
23107         * decl.cs: ditto.
23108
23109 2002-09-06  Ravi Pratap  <ravi@ximian.com>
23110
23111         * attribute.cs : Fix incorrect code which relied on catching
23112         a NullReferenceException to detect a null being passed in
23113         where an object was expected.
23114
23115 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
23116
23117         * statement.cs (Try): flag the catch variable as assigned
23118
23119         * expression.cs (Cast): Simplified by using ResolveType instead of
23120         manually resolving.
23121
23122         * statement.cs (Catch): Fix bug by using ResolveType.
23123
23124 2002-09-06  Ravi Pratap  <ravi@ximian.com>
23125
23126         * expression.cs (BetterConversion): Special case for when we have
23127         a NullLiteral as the argument and we have to choose between string
23128         and object types - we choose string the way csc does.
23129
23130         * attribute.cs (Attribute.Resolve): Catch the
23131         NullReferenceException and report error #182 since the Mono
23132         runtime no more has the bug and having this exception raised means
23133         we tried to select a constructor which takes an object and is
23134         passed a null.
23135
23136 2002-09-05  Ravi Pratap  <ravi@ximian.com>
23137
23138         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23139         message (1502, 1503) when we can't locate a method after overload
23140         resolution. This is much more informative and closes the bug
23141         Miguel reported.
23142
23143         * interface.cs (PopulateMethod): Return if there are no argument
23144         types. Fixes a NullReferenceException bug.
23145
23146         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23147         expressions too. Previously we were checking only in one place for
23148         positional arguments leaving out named arguments.
23149
23150         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23151         type to the enum type is not allowed. Remove code corresponding to
23152         that.
23153
23154         (ConvertNumericExplicit): Allow explicit conversions from
23155         the underlying type to enum type. This precisely follows the spec
23156         and closes a bug filed by Gonzalo.
23157
23158 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23159
23160         * compiler.csproj:
23161         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23162
23163 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
23164
23165         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23166         it was important that we stored the right value after the
23167         reduction in `converted'.
23168
23169 2002-09-04  Martin Baulig  <martin@gnome.org>
23170
23171         * location.cs (Location.SymbolDocument): Use full pathnames for the
23172         source files.
23173
23174 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
23175
23176         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23177         of the expression resolve mechanism, because that will catch the
23178         SimpleName error failures.
23179
23180         (Conditional): If we can not resolve the
23181         expression, return, do not crash.
23182
23183 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23184
23185         * cs-tokenizer.cs:
23186         (location): display token name instead of its number.
23187
23188 2002-08-28  Martin Baulig  <martin@gnome.org>
23189
23190         * expression.cs (Binary.ResolveOperator): Don't silently return
23191         but return an error if an operator cannot be applied between two
23192         enum types.
23193
23194 2002-08-28  Martin Baulig  <martin@gnome.org>
23195
23196         * class.cs (Constructor.Define): Set the permission attributes
23197         correctly instead of making all constructors public.
23198
23199 2002-08-28  Martin Baulig  <martin@gnome.org>
23200
23201         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23202         for private members before reporting a CS0103; if we find anything,
23203         it's a CS0122.
23204
23205 2002-08-28  Martin Baulig  <martin@gnome.org>
23206
23207         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23208         to check whether `closure_start_type == closure_invocation_type',
23209         we also need to check whether `m.DeclaringType == closure_invocation_type'
23210         before bypassing the permission checks.  We might be accessing
23211         protected/private members from the base class.
23212         (TypeManager.RealMemberLookup): Only set private_ok if private
23213         members were requested via BindingFlags.NonPublic.
23214
23215         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23216
23217         * expression.cs (MemberAccess.ResolveMemberAccess): Set
23218         MethodGroupExpr.IsExplicitImpl if appropriate.
23219         (Invocation.DoResolve): Don't report the CS0120 for explicit
23220         interface implementations.
23221
23222 2002-08-27  Martin Baulig  <martin@gnome.org>
23223
23224         * expression.cs (Invocation.DoResolve): If this is a static
23225         method and we don't have an InstanceExpression, we must report
23226         a CS0120.
23227
23228 2002-08-25  Martin Baulig  <martin@gnome.org>
23229
23230         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23231         `==' between a valuetype and an object.
23232
23233 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
23234
23235         * ecore.cs (TypeExpr): Provide a ToString method.
23236
23237 2002-08-24  Martin Baulig  <martin@gnome.org>
23238
23239         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23240         now called proggie.dbg and it's a binary file.
23241
23242 2002-08-23  Martin Baulig  <martin@gnome.org>
23243
23244         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23245
23246 2002-08-23  Martin Baulig  <martin@gnome.org>
23247
23248         * struct.cs (MyStructInfo.ctor): Make this work with empty
23249         structs; it's not allowed to use foreach() on null.
23250
23251 2002-08-23  Martin Baulig  <martin@gnome.org>
23252
23253         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23254         writer the full pathname of the generated assembly.
23255
23256 2002-08-23  Martin Baulig  <martin@gnome.org>
23257
23258         * statements.cs (FlowBranching.UsageVector.MergeChildren):
23259         A `finally' block never returns or breaks; improved handling of
23260         unreachable code.
23261
23262 2002-08-23  Martin Baulig  <martin@gnome.org>
23263
23264         * statement.cs (Throw.Resolve): Allow `throw null'.
23265
23266 2002-08-23  Martin Baulig  <martin@gnome.org>
23267
23268         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23269         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23270         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
23271         MemberLookup would return a wrong event if this is an explicit
23272         interface implementation and the class has an event with the same
23273         name.
23274
23275 2002-08-23  Martin Baulig  <martin@gnome.org>
23276
23277         * statement.cs (Block.AddChildVariableNames): New public method.
23278         (Block.AddChildVariableName): Likewise.
23279         (Block.IsVariableNameUsedInChildBlock): Likewise.
23280         (Block.AddVariable): Check whether a variable name has already
23281         been used in a child block.
23282
23283         * cs-parser.jay (declare_local_variables): Mark all variable names
23284         from the current block as being used in a child block in the
23285         implicit block.
23286
23287 2002-08-23  Martin Baulig  <martin@gnome.org>
23288
23289         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23290         find the symbol writer.
23291
23292         * driver.cs: csc also allows the arguments to /define being
23293         separated by commas, not only by semicolons.
23294
23295 2002-08-23  Martin Baulig  <martin@gnome.org>
23296
23297         * interface.cs (Interface.GetMembers): Added static check for events.
23298
23299 2002-08-15  Martin Baulig  <martin@gnome.org>
23300
23301         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23302         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23303
23304         * ecore.cs (Expression.MemberLookup): Added documentation and explained
23305         why the MethodData.EmitDestructor() change was necessary.
23306
23307 2002-08-20  Martin Baulig  <martin@gnome.org>
23308
23309         * class.cs (TypeContainer.FindMembers): Added static check for events.
23310
23311         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23312
23313         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23314         use Type.GetEvents(), not Type.FindMembers().
23315
23316 2002-08-20  Martin Baulig  <martin@gnome.org>
23317
23318         * decl.cs (MemberCache): Added a special method cache which will
23319         be used for method-only searched.  This ensures that a method
23320         search will return a MethodInfo with the correct ReflectedType for
23321         inherited methods.      
23322
23323 2002-08-20  Martin Baulig  <martin@gnome.org>
23324
23325         * decl.cs (DeclSpace.FindMembers): Made this public.
23326
23327 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23328
23329         * delegate.cs: fixed build on windows.
23330         [FIXME:  Filed as bug #29150: MCS must report these errors.]
23331
23332 2002-08-19  Ravi Pratap  <ravi@ximian.com>
23333
23334         * ecore.cs (StandardConversionExists): Return a false
23335         if we are trying to convert the void type to anything else
23336         since that is not allowed.
23337
23338         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23339         we flag error 70 in the event an event is trying to be accessed
23340         directly from outside the declaring type.
23341
23342 2002-08-20  Martin Baulig  <martin@gnome.org>
23343
23344         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23345         MemberCache from typemanager.cs to decl.cs.
23346
23347 2002-08-19  Martin Baulig  <martin@gnome.org>
23348
23349         * class.cs (TypeContainer): Implement IMemberContainer.
23350         (TypeContainer.DefineMembers): Create the MemberCache.
23351         (TypeContainer.FindMembers): Do better BindingFlags checking; only
23352         return public members if BindingFlags.Public was given, check
23353         whether members are static.
23354
23355 2002-08-16  Martin Baulig  <martin@gnome.org>
23356
23357         * decl.cs (DeclSpace.Define): Splitted this in Define and
23358         DefineMembers.  DefineMembers is called first and initializes the
23359         MemberCache.
23360
23361         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
23362         DefineMembers() on all our DeclSpaces.
23363
23364         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23365         but call DefineMembers() on all nested interfaces.  We call their
23366         Define() in our new Define() function.
23367
23368         * interface.cs (Interface): Implement IMemberContainer.
23369         (Interface.Define): Moved all code except the attribute stuf to
23370         DefineMembers().
23371         (Interface.DefineMembers): Initialize the member cache.
23372
23373         * typemanager.cs (IMemberFinder): Removed this interface, we don't
23374         need this anymore since we can use MemberCache.FindMembers directly.
23375
23376 2002-08-19  Martin Baulig  <martin@gnome.org>
23377
23378         * typemanager.cs (MemberCache): When creating the cache for an
23379         interface type, add all inherited members.
23380         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23381         to `out bool used_cache' and documented it.
23382         (TypeManager.MemberLookup): If we already used the cache in the first
23383         iteration, we don't need to do the interfaces check.
23384
23385 2002-08-19  Martin Baulig  <martin@gnome.org>
23386
23387         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
23388         here from IMemberFinder and don't implement this interface anymore.
23389         (DeclSpace.MemberCache): Moved here from IMemberFinder.
23390
23391         * typemanager.cs (IMemberFinder): This interface is now only used by
23392         classes which actually support the member cache.
23393         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23394         since we only put DeclSpaces into this Hashtable.
23395         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23396         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23397
23398 2002-08-16  Martin Baulig  <martin@gnome.org>
23399
23400         * typemanager.cs (ICachingMemberFinder): Removed.
23401         (IMemberFinder.MemberCache): New property.
23402         (TypeManager.FindMembers): Merged this with RealFindMembers().
23403         This function will never be called from TypeManager.MemberLookup()
23404         so we can't use the cache here, just the IMemberFinder.
23405         (TypeManager.MemberLookup_FindMembers): Check whether the
23406         IMemberFinder has a MemberCache and call the cache's FindMembers
23407         function.
23408         (MemberCache): Rewrote larger parts of this yet another time and
23409         cleaned it up a bit.
23410
23411 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
23412
23413         * driver.cs (LoadArgs): Support quoting.
23414
23415         (Usage): Show the CSC-like command line arguments.
23416
23417         Improved a few error messages.
23418
23419 2002-08-15  Martin Baulig  <martin@gnome.org>
23420
23421         * typemanager.cs (IMemberContainer.Type): New property.
23422         (IMemberContainer.IsInterface): New property.
23423
23424         The following changes are conditional to BROKEN_RUNTIME, which is
23425         defined at the top of the file.
23426
23427         * typemanager.cs (MemberCache.MemberCache): Don't add the base
23428         class'es members, but add all members from TypeHandle.ObjectType
23429         if we're an interface.
23430         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23431         is the current type.
23432         (MemberCache.CacheEntry.Container): Removed this field.
23433         (TypeHandle.GetMembers): Include inherited members.
23434
23435 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23436
23437         * typemanager.cs: fixed compilation and added a comment on a field that
23438         is never used.
23439
23440 2002-08-15  Martin Baulig  <martin@gnome.org>
23441
23442         * class.cs (ConstructorInitializer.Resolve): In the
23443         Expression.MemberLookup call, use the queried_type as
23444         invocation_type.
23445
23446         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23447         declared' attribute, it's always true.
23448         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23449         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23450         temporary wrapper for FindMembers which tells MemberLookup whether
23451         members from the base classes are included in the return value.
23452         This will go away soon.
23453         (TypeManager.MemberLookup): Use this temporary hack here; once the
23454         new MemberCache is completed, we don't need to do the DeclaredOnly
23455         looping here anymore since the MemberCache will take care of this.
23456         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23457         (MemberCache): When creating the MemberCache for a class, get
23458         members from the current class and all its base classes.
23459         (MemberCache.CacheEntry.Container): New field.  This is a
23460         temporary hack until the Mono runtime is fixed to distinguish
23461         between ReflectedType and DeclaringType.  It allows us to use MCS
23462         with both the MS runtime and the unfixed Mono runtime without
23463         problems and without accecting performance.
23464         (MemberCache.SearchMembers): The DeclaredOnly looping from
23465         TypeManager.MemberLookup is now done here.      
23466
23467 2002-08-14  Martin Baulig  <martin@gnome.org>
23468
23469         * statement.cs (MyStructInfo.MyStructInfo): Don't call
23470         Type.GetFields on dynamic types but get the fields from the
23471         corresponding TypeContainer.
23472         (MyStructInfo.GetStructInfo): Added check for enum types.
23473
23474         * typemanager.cs (MemberList.IsSynchronized): Implemented.
23475         (MemberList.SyncRoot): Implemented.
23476         (TypeManager.FilterWithClosure): No need to check permissions if
23477         closure_start_type == closure_invocation_type, don't crash if
23478         closure_invocation_type is null.
23479
23480 2002-08-13  Martin Baulig  <martin@gnome.org>
23481
23482         Rewrote TypeContainer.FindMembers to use a member cache.  This
23483         gives us a speed increase of about 35% for the self-hosting MCS
23484         build and of about 15-20% for the class libs (both on GNU/Linux).
23485
23486         * report.cs (Timer): New class to get enhanced profiling.  This
23487         whole class is "TIMER" conditional since it remarkably slows down
23488         compilation speed.
23489
23490         * class.cs (MemberList): New class.  This is an IList wrapper
23491         which we're now using instead of passing MemberInfo[]'s around to
23492         avoid copying this array unnecessarily.
23493         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23494         (ICachingMemberFinder, IMemberContainer): New interface.
23495         (TypeManager.FilterWithClosure): If `criteria' is null, the name
23496         has already been checked, otherwise use it for the name comparision.
23497         (TypeManager.FindMembers): Renamed to RealMemberFinder and
23498         provided wrapper which tries to use ICachingMemberFinder.FindMembers
23499         if possible.  Returns a MemberList, not a MemberInfo [].
23500         (TypeHandle): New class, implements IMemberContainer.  We create
23501         one instance of this class per type, it contains a MemberCache
23502         which is used to do the member lookups.
23503         (MemberCache): New class.  Each instance of this class contains
23504         all members of a type and a name-based hash table.
23505         (MemberCache.FindMembers): This is our new member lookup
23506         function.  First, it looks up all members of the requested name in
23507         the hash table.  Then, it walks this list and sorts out all
23508         applicable members and returns them.
23509
23510 2002-08-13  Martin Baulig  <martin@gnome.org>
23511
23512         In addition to a nice code cleanup, this gives us a performance
23513         increase of about 1.4% on GNU/Linux - not much, but it's already
23514         half a second for the self-hosting MCS compilation.
23515
23516         * typemanager.cs (IMemberFinder): New interface.  It is used by
23517         TypeManager.FindMembers to call FindMembers on a TypeContainer,
23518         Enum, Delegate or Interface.
23519         (TypeManager.finder_to_member_finder): New PtrHashtable.
23520         (TypeManager.finder_to_container): Removed.
23521         (TypeManager.finder_to_delegate): Removed.
23522         (TypeManager.finder_to_interface): Removed.
23523         (TypeManager.finder_to_enum): Removed.
23524
23525         * interface.cs (Interface): Implement IMemberFinder.
23526
23527         * delegate.cs (Delegate): Implement IMemberFinder.
23528
23529         * enum.cs (Enum): Implement IMemberFinder.
23530
23531         * class.cs (TypeContainer): Implement IMemberFinder.
23532
23533 2002-08-12  Martin Baulig  <martin@gnome.org>
23534
23535         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23536
23537 2002-08-12  Martin Baulig  <martin@gnome.org>
23538
23539         * ecore.cs (ITypeExpression): New interface for expressions which
23540         resolve to a type.
23541         (TypeExpression): Renamed to TypeLookupExpression.
23542         (Expression.DoResolve): If we're doing a types-only lookup, the
23543         expression must implement the ITypeExpression interface and we
23544         call DoResolveType() on it.
23545         (SimpleName): Implement the new ITypeExpression interface.
23546         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23547         hack, the situation that we're only looking up types can't happen
23548         anymore when this method is called.  Moved the type lookup code to
23549         DoResolveType() and call it.
23550         (SimpleName.DoResolveType): This ITypeExpression interface method
23551         is now doing the types-only lookup.
23552         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23553         (ResolveFlags): Added MaskExprClass.
23554
23555         * expression.cs (MemberAccess): Implement the ITypeExpression
23556         interface.
23557         (MemberAccess.DoResolve): Added support for a types-only lookup
23558         when we're called via ITypeExpression.DoResolveType().
23559         (ComposedCast): Implement the ITypeExpression interface.
23560
23561         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
23562         Expression.Resolve() with ResolveFlags.Type instead.
23563
23564 2002-08-12  Martin Baulig  <martin@gnome.org>
23565
23566         * interface.cs (Interface.Define): Apply attributes.
23567
23568         * attribute.cs (Attribute.ApplyAttributes): Added support for
23569         interface attributes.
23570
23571 2002-08-11  Martin Baulig  <martin@gnome.org>
23572
23573         * statement.cs (Block.Emit): Only check the "this" variable if we
23574         do not always throw an exception.
23575
23576         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23577         whether the property has a set accessor.
23578
23579 2002-08-11  Martin Baulig  <martin@gnome.org>
23580
23581         Added control flow analysis support for structs.
23582
23583         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23584         with control flow analysis turned off.
23585         (IVariable): New interface.
23586         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23587         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23588         (FieldExpr.DoResolve): Resolve the instance expression with flow
23589         analysis turned off and do the definite assignment check after the
23590         resolving when we know what the expression will resolve to.
23591
23592         * expression.cs (LocalVariableReference, ParameterReference):
23593         Implement the new IVariable interface, only call the flow analysis
23594         code if ec.DoFlowAnalysis is true.
23595         (This): Added constructor which takes a Block argument.  Implement
23596         the new IVariable interface.
23597         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23598         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23599         This does the definite assignment checks for struct members.
23600
23601         * class.cs (Constructor.Emit): If this is a non-static `struct'
23602         constructor which doesn't have any initializer, call
23603         Block.AddThisVariable() to tell the flow analysis code that all
23604         struct elements must be initialized before control returns from
23605         the constructor.
23606
23607         * statement.cs (MyStructInfo): New public class.
23608         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23609         argument to this indexer.  If non-zero, check an individual struct
23610         member, not the whole struct.
23611         (FlowBranching.CheckOutParameters): Check struct members.
23612         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23613         overloaded versions of these methods which take an additional
23614         `int field_idx' argument to check struct members.
23615         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23616         overloaded versions of these methods which take an additional
23617         `string field_name' argument to check struct member.s
23618         (VariableInfo): Implement the IVariable interface.
23619         (VariableInfo.StructInfo): New public property.  Returns the
23620         MyStructInfo instance of the variable if it's a struct or null.
23621         (Block.AddThisVariable): New public method.  This is called from
23622         Constructor.Emit() for non-static `struct' constructor which do
23623         not have any initializer.  It creates a special variable for the
23624         "this" instance variable which will be checked by the flow
23625         analysis code to ensure that all of the struct's fields are
23626         initialized before control returns from the constructor.
23627         (UsageVector): Added support for struct members.  If a
23628         variable/parameter is a struct with N members, we reserve a slot
23629         in the usage vector for each member.  A struct is considered fully
23630         initialized if either the struct itself (slot 0) or all its
23631         members are initialized.
23632
23633 2002-08-08  Martin Baulig  <martin@gnome.org>
23634
23635         * driver.cs (Driver.MainDriver): Only report an error CS5001
23636         if there were no compilation errors.
23637
23638         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23639         `UnsafeContext' property to determine whether the parent is in
23640         unsafe context rather than checking the parent's ModFlags:
23641         classes nested in an unsafe class are unsafe as well.
23642
23643 2002-08-08  Martin Baulig  <martin@gnome.org>
23644
23645         * statement.cs (UsageVector.MergeChildren): Distinguish between
23646         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23647         we return.  Added test17() and test18() to test-154.cs.
23648
23649 2002-08-08  Martin Baulig  <martin@gnome.org>
23650
23651         * typemanager.cs (TypeManager.FilterWithClosure): If we have
23652         Family access, make sure the invoking type isn't a subclass of the
23653         queried type (that'd be a CS1540).
23654
23655         * ecore.cs (Expression.MemberLookup): Added overloaded version of
23656         this method which takes an additional `Type invocation_type'.
23657
23658         * expression.cs (BaseAccess.DoResolve): Use the base type as
23659         invocation and query type.
23660         (MemberAccess.DoResolve): If the lookup failed and we're about to
23661         report a CS0122, try a lookup with the ec.ContainerType - if this
23662         succeeds, we must report a CS1540.
23663
23664 2002-08-08  Martin Baulig  <martin@gnome.org>
23665
23666         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23667         (MethodGroupExpr): Implement the IMemberExpr interface.
23668
23669         * expression (MemberAccess.ResolveMemberAccess): No need to have
23670         any special code for MethodGroupExprs anymore, they're now
23671         IMemberExprs.   
23672
23673 2002-08-08  Martin Baulig  <martin@gnome.org>
23674
23675         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23676         Family, FamANDAssem and FamORAssem permissions.
23677         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23678
23679 2002-08-08  Martin Baulig  <martin@gnome.org>
23680
23681         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23682         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23683         or loop block.
23684
23685 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23686
23687         * driver.cs: implemented /resource option to embed managed resources.
23688
23689 2002-08-07  Martin Baulig  <martin@gnome.org>
23690
23691         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23692         (FieldBase.HasFieldInitializer): New public property.
23693         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23694         returns the field initializer and makes sure it is only resolved once.
23695         (TypeContainer.EmitFieldInitializers): Call
23696         FieldBase.GetInitializerExpression to get the initializer, this ensures
23697         that it isn't resolved multiple times.
23698
23699         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23700         the resolving process (SimpleName/MemberLookup) that we're currently
23701         emitting a field initializer (which must not access any instance members,
23702         this is an error CS0236).
23703
23704         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23705         argument, if the `IsFieldInitializer' flag is set, we must report and
23706         error CS0236 and not an error CS0120.   
23707
23708 2002-08-07  Martin Baulig  <martin@gnome.org>
23709
23710         * ecore.cs (IMemberExpr): New public interface.
23711         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23712         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23713         if the expression is an IMemberExpr.
23714
23715         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23716         to be null, implicitly default to `this' if we're non-static in
23717         this case.  Simplified the code a lot by using the new IMemberExpr
23718         interface.  Also fixed bug #28176 here.
23719
23720 2002-08-06  Martin Baulig  <martin@gnome.org>
23721
23722         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23723         ParameterReferences during semantic analysis so that we can do a
23724         type-only search when resolving Cast, TypeOf and SizeOf.
23725         (block): Pass the `current_local_parameters' to the Block's
23726         constructor.
23727
23728         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23729         argument to the constructor.
23730         (ConstructorInitializer.Resolve): Create a temporary implicit
23731         block with the parameters.
23732
23733         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23734         references here if we aren't doing a type-only search.
23735
23736         * statement.cs (Block): Added constructor which takes a
23737         `Parameters parameters' argument.
23738         (Block.Parameters): New public property.
23739
23740         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23741         to `Parameters' and made it public readonly.
23742
23743 2002-08-06  Martin Baulig  <martin@gnome.org>
23744
23745         * ecore.cs (Expression.Warning): Made this public as well.
23746
23747         * report.cs (Report.Debug): Print the contents of collections.
23748
23749 2002-08-06  Martin Baulig  <martin@gnome.org>
23750
23751         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23752         used to tell Resolve() which kinds of expressions it may return.
23753         (Expression.Resolve): Added overloaded version of this method which
23754         takes a `ResolveFlags flags' argument.  This can be used to tell
23755         Resolve() which kinds of expressions it may return.  Reports a
23756         CS0118 on error.
23757         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23758         ResolveFlags.SimpleName.
23759         (Expression.Error118): Added overloaded version of this method which
23760         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23761         which kinds of expressions are allowed.
23762
23763         * expression.cs (Argument.ResolveMethodGroup): New public method.
23764         Resolves an argument, but allows a MethodGroup to be returned.
23765         This is used when invoking a delegate.
23766
23767         * TODO: Updated a bit.
23768
23769 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23770
23771         Fixed compilation with csc.
23772
23773         * ecore.cs: Expression.Error made public. Is this correct? Should
23774         Warning be made public too?
23775
23776         * expression.cs: use ea.Location instead of ea.loc.
23777         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23778
23779 2002-08-06  Martin Baulig  <martin@gnome.org>
23780
23781         * ecore.cs (Expression.loc): Moved the location here instead of
23782         duplicating it in all derived classes.
23783         (Expression.Location): New public property.
23784         (Expression.Error, Expression.Warning): Made them non-static and
23785         removed the location argument.
23786         (Expression.Warning): Added overloaded version which takes an
23787         `int level' argument.
23788         (Expression.Error118): Make this non-static and removed the
23789         expression and location arguments.
23790         (TypeExpr): Added location argument to the constructor.
23791
23792         * expression.cs (StaticCallExpr): Added location argument to
23793         the constructor.
23794         (Indirection, PointerArithmetic): Likewise.
23795         (CheckedExpr, UnCheckedExpr): Likewise.
23796         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23797         (StringPtr): Likewise.
23798
23799
23800 2002-08-05  Martin Baulig  <martin@gnome.org>
23801
23802         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23803
23804         * assign.cs (Assign.DoResolve): Check whether the source
23805         expression is a value or variable.
23806
23807         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23808         while resolving the corresponding blocks.
23809
23810         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23811         an error, don't silently return null.
23812
23813         * statement.cs (Block.AddVariable): Do the error reporting here
23814         and distinguish between CS0128 and CS0136.
23815         (Block.DoResolve): Report all unused labels (warning CS0164).
23816         (LabeledStatement): Pass the location to the constructor.
23817         (LabeledStatement.HasBeenReferenced): New property.
23818         (LabeledStatement.Resolve): Set it to true here.
23819
23820         * statement.cs (Return.Emit): Return success even after reporting
23821         a type mismatch error (CS0126 or CS0127), this is what csc does and
23822         it avoids confusing the users with any consecutive errors.
23823
23824 2002-08-05  Martin Baulig  <martin@gnome.org>
23825
23826         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23827
23828         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23829
23830         * expression.cs (MemberAccess.DoResolve): Silently return if an
23831         error has already been reported.
23832
23833         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23834         error has already been reported.
23835
23836 2002-08-05  Martin Baulig  <martin@gnome.org>
23837
23838         * statement.cs (UsageVector): Only initialize the `parameters'
23839         vector if we actually have any "out" parameters.
23840
23841 2002-08-05  Martin Baulig  <martin@gnome.org>
23842
23843         * expression.cs (Binary.ResolveOperator): When combining delegates,
23844         they must have the same type.
23845
23846 2002-08-05  Martin Baulig  <martin@gnome.org>
23847
23848         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23849         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23850         work with the ms runtime and we also don't need it: if we're a
23851         PropertyBuilder and not in the `indexer_arguments' hash, then we
23852         are a property and not an indexer.
23853
23854         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23855         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23856         since the latter one doesn't work with the ms runtime.
23857
23858 2002-08-03  Martin Baulig  <martin@gnome.org>
23859
23860         Fixed bugs #27998 and #22735.
23861
23862         * class.cs (Method.IsOperator): New public field.
23863         (Method.CheckBase): Report CS0111 if there's already a method
23864         with the same parameters in the current class.  Report CS0508 when
23865         attempting to change the return type of an inherited method.
23866         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23867         and it's not marked abstract or extern.
23868         (PropertyBase): New abstract base class for Property and Indexer.
23869         (PropertyBase.CheckBase): Moved here from Property and made it work
23870         for indexers.
23871         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23872         the same so we can reuse it there.
23873         (Property, Indexer): Derive from PropertyBase.
23874         (MethodSignature.inheritable_property_signature_filter): New delegate
23875         to find properties and indexers.
23876
23877         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23878         argument and improved error reporting.
23879
23880         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23881         EmptyReadOnlyParameters and made it a property.
23882
23883         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23884         version of this method which takes a `PropertyInfo indexer'.
23885         (TypeManager.RegisterIndexer): New method.
23886
23887         * class.cs: Added myself as author of this file :-)
23888
23889 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23890
23891         * class.cs: fixed compilation on windoze.
23892
23893 2002-08-03  Martin Baulig  <martin@gnome.org>
23894
23895         * interface.cs (Interface.GetInterfaceBases): Check whether all
23896         base interfaces are at least as accessible than the current one.
23897
23898         * class.cs (TypeContainer.GetClassBases): Check whether base types
23899         are at least as accessible than the current type.
23900         (TypeContainer.AsAccessible): Implemented and made non-static.
23901         (MemberBase.CheckParameters): Report errors if the accessibility
23902         checks fail.
23903
23904         * delegate.cs (Delegate.Delegate): The default visibility is
23905         internal for top-level types and private for nested types.
23906         (Delegate.Define): Report errors if the accessibility checks fail.
23907
23908         * enum.cs (Enum.Enum): The default visibility is internal for
23909         top-level types and private for nested types.
23910         (Enum.DefineType): Compute the correct visibility.
23911
23912         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23913         function which takes a `bool is_toplevel' instead of a TypeContainer.
23914
23915         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23916         builtin type.
23917
23918 2002-08-02  Martin Baulig  <martin@gnome.org>
23919
23920         * expression.cs (LocalVariableReferenc): Added constructor which
23921         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23922         (LocalVariableReference.IsReadOnly): New property.
23923         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23924         variable is readonly, use our own readonly flag to do this; you can
23925         use the new constructor to get a writable reference to a read-only
23926         variable.
23927
23928         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23929         reference to the local variable.
23930
23931 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23932
23933         * rootcontext.cs (ResolveCore): Also include System.Exception
23934
23935         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23936         we reach an EmptyStatement.
23937
23938         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23939         is also fine.
23940
23941         * expression.cs (Binary.ResolveOperator): Check error result in
23942         two places.
23943
23944         use brtrue/brfalse directly and avoid compares to null.
23945
23946 2002-08-02  Martin Baulig  <martin@gnome.org>
23947
23948         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23949         Fixes bug #28407, added test-155.cs.
23950
23951 2002-08-01  Martin Baulig  <martin@gnome.org>
23952
23953         * class.cs (Event.EmitDefaultMethod): Make this work with static
23954         events.  Fixes #28311, added verify-3.cs.
23955
23956 2002-08-01  Martin Baulig  <martin@gnome.org>
23957
23958         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23959         `is_disposable' fields.
23960         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23961         `hm.is_disposable' if we're using the collection pattern.
23962         (Foreach.EmitCollectionForeach): Use the correct type for the
23963         enumerator's local variable, only emit the try/finally block if
23964         necessary (fixes #27713).
23965
23966 2002-08-01  Martin Baulig  <martin@gnome.org>
23967
23968         * ecore.cs (Expression.report118): Renamed to Error118 and made
23969         it public static.
23970
23971         * statement.cs (Throw.Resolve): Check whether the expression is of
23972         the correct type (CS0118) and whether the type derives from
23973         System.Exception (CS0155).
23974         (Catch.Resolve): New method.  Do the type lookup here and check
23975         whether it derives from System.Exception (CS0155).
23976         (Catch.CatchType, Catch.IsGeneral): New public properties.
23977
23978         * typemanager.cs (TypeManager.exception_type): Added.
23979
23980 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23981
23982         * driver.cs: Updated About function.
23983
23984 2002-07-31  Martin Baulig  <martin@gnome.org>
23985
23986         Implemented Control Flow Analysis.
23987
23988         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23989         (EmitContext.CurrentBranching): Added.
23990         (EmitContext.StartFlowBranching): Added.
23991         (EmitContext.EndFlowBranching): Added.
23992         (EmitContext.KillFlowBranching): Added.
23993         (EmitContext.IsVariableAssigned): Added.
23994         (EmitContext.SetVariableAssigned): Added.
23995         (EmitContext.IsParameterAssigned): Added.
23996         (EmitContext.SetParameterAssigned): Added.
23997         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23998         Added control flow analysis stuff here.
23999
24000         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
24001         resolve the expression as lvalue.
24002         (LocalVariableReference.DoResolve): Check whether the variable has
24003         already been assigned.
24004         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
24005         the parameter as assigned here.
24006         (ParameterReference.DoResolve): Check whether the parameter has already
24007         been assigned.
24008         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
24009         expression as lvalue.
24010
24011         * statement.cs (FlowBranching): New class for the flow analysis code.
24012         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
24013         (LabeledStatement.IsDefined): New public property.
24014         (LabeledStatement.AddUsageVector): New public method to tell flow
24015         analyis that the label may be reached via a forward jump.
24016         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
24017         flow analysis.
24018         (VariableInfo.Number): New public field.  This is used by flow analysis
24019         to number all locals of a block.
24020         (Block.CountVariables): New public property.  This is the number of
24021         local variables in this block (including the locals from all parent
24022         blocks).
24023         (Block.EmitMeta): Number all the variables.
24024
24025         * statement.cs: Added flow analysis support to all classes.
24026
24027 2002-07-31  Martin Baulig  <martin@gnome.org>
24028
24029         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
24030         To get debugging messages, compile mcs with /define:MCS_DEBUG and
24031         then use this argument.
24032
24033         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
24034
24035         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
24036         use this to specify /define options.
24037
24038 2002-07-29  Martin Baulig  <martin@gnome.org>
24039
24040         * statement.cs (Fixed): Moved all code that does variable lookups
24041         and resolvings from Emit to Resolve.
24042
24043         * statement.cs (For): Moved all code that does variable lookups
24044         and resolvings from Emit to Resolve.
24045
24046         * statement.cs (Using): Moved all code that does variable lookups
24047         and resolvings from Emit to Resolve.
24048
24049 2002-07-29  Martin Baulig  <martin@gnome.org>
24050
24051         * attribute.cs (Attribute.Resolve): Explicitly catch a
24052         System.NullReferenceException when creating the
24053         CustromAttributeBuilder and report a different warning message.
24054
24055 2002-07-29  Martin Baulig  <martin@gnome.org>
24056
24057         * support.cs (ParameterData.ParameterName): Added method to
24058         get the name of a parameter.
24059
24060         * typemanager.cs (TypeManager.IsValueType): New public method.
24061
24062 2002-07-29  Martin Baulig  <martin@gnome.org>
24063
24064         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
24065         is a flag which specifies that it's either ref or out.
24066         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
24067         the out parameter to `out Parameter.Modifier mod', also set the
24068         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
24069
24070         * support.cs (InternalParameters.ParameterModifier): Distinguish
24071         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24072         Parameter.Modifier.ISBYREF flag if it's either ref or out.
24073
24074         * expression.cs (Argument.GetParameterModifier): Distinguish
24075         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24076         Parameter.Modifier.ISBYREF flag if it's either ref or out.
24077
24078 2002-07-29  Martin Baulig  <martin@gnome.org>
24079
24080         * expression.cs (ParameterReference.ParameterReference): Added
24081         `Location loc' argument to the constructor.
24082
24083         * cs-parser.jay: Pass location to ParameterReference.
24084
24085 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
24086
24087         * statement.cs (Try): Initialize the location.
24088
24089         * cs-parser.jay: pass location to Try.
24090
24091         * expression.cs (Unary.Reduce): Change the prototype to return
24092         whether a constant fold could be performed or not.  The result is
24093         returned in an out parameters.  In the case of Indirection and
24094         AddressOf, we want to perform the full tests.
24095
24096 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
24097
24098         * statement.cs (Statement.Emit): Flag dead code.
24099
24100 2002-07-27  Andrew Birkett  <andy@nobugs.org>
24101
24102         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24103
24104 2002-07-27  Martin Baulig  <martin@gnome.org>
24105
24106         * class.cs (MethodData.Define): Put back call to
24107         TypeManager.AddMethod(), accidentally commented this out.
24108
24109         * report.cs (Debug): New public method to print debugging information,
24110         this is `[Conditional ("DEBUG")]'.
24111
24112 2002-07-26  Martin Baulig  <martin@gnome.org>
24113
24114         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24115         (switch_statement): Push the current_block to the switch_stack and
24116         pop it again when we're done with the switch.
24117         (switch_section): The new block is a child of the current_block.
24118         Fixes bug #24007, added test-152.cs.
24119
24120 2002-07-27  Martin Baulig  <martin@gnome.org>
24121
24122         * expression.cs (Invocation.EmitArguments): When calling a varargs
24123         function with only its fixed arguments, we need to pass an empty
24124         array.
24125
24126 2002-07-27  Martin Baulig  <martin@gnome.org>
24127
24128         Mono 0.13 has been released.
24129
24130 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
24131
24132         * driver.cs: Rename --resource to --linkres, because that is what
24133         we do currently, we dont support --resource yet.
24134
24135         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24136
24137 2002-07-25  Martin Baulig  <martin@gnome.org>
24138
24139         * class.cs (MethodData): New public class.  This is a `method builder'
24140         class for a method or one accessor of a Property/Indexer/Event.
24141         (MethodData.GetMethodFlags): Moved here from MemberBase.
24142         (MethodData.ApplyAttributes): Likewise.
24143         (MethodData.ApplyObsoleteAttribute): Likewise.
24144         (MethodData.ApplyConditionalAttribute): Likewise.
24145         (MethodData.ApplyDllImportAttribute): Likewise.
24146         (MethodData.CheckAbstractAndExternal): Likewise.
24147         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24148         (MethodData.Emit): Formerly known as Method.Emit().
24149         (MemberBase): Moved everything which was specific to a single
24150         accessor/method to MethodData.
24151         (Method): Create a new MethodData and call Define() and Emit() on it.
24152         (Property, Indexer, Event): Create a new MethodData objects for each
24153         accessor and call Define() and Emit() on them.
24154
24155 2002-07-25  Martin Baulig  <martin@gnome.org>
24156
24157         Made MethodCore derive from MemberBase to reuse the code from there.
24158         MemberBase now also checks for attributes.
24159
24160         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24161         (MemberBase.GetMethodFlags): Moved here from class Method and marked
24162         as virtual.
24163         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24164         `CallingConventions cc' and `Attributes opt_attrs' arguments.
24165         (MemberBase.ApplyAttributes): New virtual method; applies the
24166         attributes to a method or accessor.
24167         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24168         (MemberBase.ApplyConditionalAttribute): Likewise.
24169         (MemberBase.ApplyDllImportAttribute): Likewise.
24170         (MemberBase.CheckAbstractAndExternal): Likewise.
24171         (MethodCore.ParameterTypes): This is now a property instead of a
24172         method, it's initialized from DoDefineParameters().
24173         (MethodCore.ParameterInfo): Removed the set accessor.
24174         (MethodCore.DoDefineParameters): New protected virtual method to
24175         initialize ParameterTypes and ParameterInfo.
24176         (Method.GetReturnType): We can now simply return the MemberType.
24177         (Method.GetMethodFlags): Override the MemberBase version and add
24178         the conditional flags.
24179         (Method.CheckBase): Moved some code from Define() here, call
24180         DoDefineParameters() here.
24181         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24182         here to avoid some larger code duplication.
24183         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24184         ensure that abstract and external accessors don't declare a body.
24185
24186         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24187         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24188         lookup in the attribute's parent classes, so we need to abort as soon
24189         as we found the first match.
24190         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24191         the attribute has no arguments.
24192
24193         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24194         of a Method.
24195
24196 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24197
24198         * cs-parser.jay: reverted previous patch.
24199
24200 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24201
24202         * cs-parser.jay: fixed bug #22119.
24203
24204 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24205
24206         * attribute.cs: fixed compilation. The error was:
24207         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
24208         be assigned to before control leaves the current method."
24209         [FIXME:  Filed as bug #28186: MCS must report this error.]
24210
24211 2002-07-25  Martin Baulig  <martin@gnome.org>
24212
24213         * attribute.cs (Attribute.Conditional_GetConditionName): New static
24214         method to pull the condition name ouf of a Conditional attribute.
24215         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24216         the obsolete message and error flag out of an Obsolete attribute.
24217
24218         * class.cs (Method.GetMethodFlags): New public method to get the
24219         TypeManager.MethodFlags for this method.
24220         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24221         private methods.
24222         (Method.Define): Get and apply the Obsolete and Conditional attributes;
24223         if we're overriding a virtual function, set the new private variable
24224         `parent_method'; call the new TypeManager.AddMethod().
24225
24226         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
24227         the MethodBuilder and the Method in a PtrHashtable.
24228         (TypeManager.builder_to_method): Added for this purpose.
24229         (TypeManager.MethodFlags): Added IsObsoleteError.
24230         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
24231         Obsolete and Conditional arguments in MethodBuilders.  If we discover
24232         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24233         the message from the attribute.
24234
24235 2002-07-24  Martin Baulig  <martin@gnome.org>
24236
24237         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24238         preprocessor directives, ensure that the argument to #define/#undef is
24239         exactly one identifier and that it's actually an identifier.
24240
24241         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24242         did not work ....
24243
24244 2002-07-24  Martin Baulig  <martin@gnome.org>
24245
24246         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24247         initialize it to TypeManager.object_type in the constructor.
24248         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24249         of the `hm.get_current' method if we're using the collection pattern.
24250         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24251         for the explicit conversion to make it work when we're using the collection
24252         pattern and the `Current' property has a different return type than `object'.
24253         Fixes #27713.
24254
24255 2002-07-24  Martin Baulig  <martin@gnome.org>
24256
24257         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24258         does not match, but don't report any errors.  This method is called in
24259         order for all methods in a MethodGroupExpr until a matching method is
24260         found, so we don't want to bail out if the first method doesn't match.
24261         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24262         matches, report the 123.  Fixes #28070.
24263
24264 2002-07-24  Martin Baulig  <martin@gnome.org>
24265
24266         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24267         TypeManager.TypeToCoreType() to the top of the method so the
24268         following equality checks will work.  Fixes #28107.
24269
24270 2002-07-24  Martin Baulig  <martin@gnome.org>
24271
24272         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24273         operand is of type uint, and the other operand is of type sbyte,
24274         short or int, the operands are converted to type long." -
24275         Actually do what this comment already told us.  Fixes bug #28106,
24276         added test-150.cs.
24277
24278 2002-07-24  Martin Baulig  <martin@gnome.org>
24279
24280         * class.cs (MethodBase): New abstract class.  This is now a base
24281         class for Property, Indexer and Event to avoid some code duplication
24282         in their Define() and DefineMethods() methods.
24283         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24284         generic methods for Define() and DefineMethods().
24285         (FieldBase): Derive from MemberBase, not MemberCore.
24286         (Property): Derive from MemberBase, not MemberCore.
24287         (Property.DefineMethod): Moved all the code from this method to the
24288         new MethodBase.DefineAccessor(), just call it with appropriate
24289         argumetnts.
24290         (Property.Define): Call the new Property.DoDefine(), this does some
24291         sanity checks and we don't need to duplicate the code everywhere.
24292         (Event): Derive from MemberBase, not MemberCore.
24293         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24294         accessors, this will also make them work with interface events.
24295         (Indexer): Derive from MemberBase, not MemberCore.
24296         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24297         (Indexer.Define): Use the new MethodBase functions.
24298
24299         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24300         argument to the constructor.
24301         (Interface.FindMembers): Added support for interface events.
24302         (Interface.PopluateEvent): Implemented.
24303
24304         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
24305
24306 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
24307
24308         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24309         but this is required to check for a method name being the same as
24310         the containing class.  
24311
24312         Handle this now.
24313
24314 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24315
24316         * interface.cs: initialize variable.
24317
24318 2002-07-23  Martin Baulig  <martin@gnome.org>
24319
24320         Implemented the IndexerName attribute in interfaces.
24321
24322         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24323         name if this is an explicit interface implementation.
24324         (Indexer.InterfaceIndexerName): New public variable.  If we're
24325         implementing an interface indexer, this is the IndexerName in that
24326         interface.  Otherwise, it's the IndexerName.
24327         (Indexer.DefineMethod): If we're implementing interface indexer,
24328         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
24329         and Pending.ImplementIndexer methods.
24330         (Indexer.Define): Also define the PropertyBuilder if we're
24331         implementing an interface indexer and this is neither an explicit
24332         interface implementation nor do the IndexerName match the one in
24333         the interface.
24334
24335         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24336         If a method is defined here, then we always need to create a proxy
24337         for it.  This is used when implementing interface indexers.
24338         (Pending.IsInterfaceIndexer): New public method.
24339         (Pending.ImplementIndexer): New public method.
24340         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24341         This is used when implementing interface indexers to define a proxy
24342         if necessary.
24343         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24344         define a proxy if necessary.
24345
24346         * interface.cs (Interface.IndexerName): New public variable.
24347         (Interface.PopulateIndexer): Set the IndexerName.
24348         (Interface.DefineIndexers): New private method.  Populate all the
24349         indexers and make sure their IndexerNames match.
24350
24351         * typemanager.cs (IndexerPropertyName): Added support for interface
24352         indexers.
24353
24354 2002-07-22  Martin Baulig  <martin@gnome.org>
24355
24356         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24357         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24358         ret if HasReturnLabel.
24359         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24360         variables.
24361
24362         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24363         and set the ec.LoopBeginTryCatchLevel.
24364         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24365         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24366         the current ec.TryCatchLevel, the branch goes out of an exception
24367         block.  In this case, we need to use Leave and not Br.
24368
24369 2002-07-22  Martin Baulig  <martin@gnome.org>
24370
24371         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24372         block unless the block does not always return or it is contained in
24373         another try { ... } catch { ... } block.  Fixes bug #26506.
24374         Added verify-1.cs to the test suite.
24375
24376 2002-07-22  Martin Baulig  <martin@gnome.org>
24377
24378         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24379         then we do not always return.  Fixes bug #24985.
24380
24381 2002-07-22  Martin Baulig  <martin@gnome.org>
24382
24383         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24384         lookup on a per-class level; ie. walk up the class hierarchy until we
24385         found at least one applicable method, then choose the best among them.
24386         Fixes bug #24463 and test-29.cs.
24387
24388 2002-07-22  Martin Baulig  <martin@gnome.org>
24389
24390         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24391         return types of the methods.  The return type is not part of the
24392         signature and we must not check it to make the `new' modifier work.
24393         Fixes bug #27999, also added test-147.cs.
24394         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24395
24396         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24397         on the method's return type.
24398
24399 2002-07-21  Martin Baulig  <martin@gnome.org>
24400
24401         * assign.cs: Make this work if the rightmost source is a constant and
24402         we need to do an implicit type conversion.  Also adding a few more tests
24403         to test-38.cs which should have caught this.
24404
24405         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24406         target in the makefile for this.  The makefile.gnu is primarily intended
24407         for end-users who don't want to debug the compiler.
24408
24409 2002-07-21  Martin Baulig  <martin@gnome.org>
24410
24411         * assign.cs: Improved the Assign class so it can now handle embedded
24412         assignments (X = Y = Z = something).  As a side-effect this'll now also
24413         consume less local variables.  test-38.cs now passes with MCS, added
24414         a few new test cases to that test.
24415
24416 2002-07-20  Martin Baulig  <martin@gnome.org>
24417
24418         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24419         instructions.  Fixes bug #27977, also added test-146.cs.
24420
24421 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24422
24423         * cs-tokenizer.cs: fixed getHex ().
24424
24425 2002-07-19  Martin Baulig  <martin@gnome.org>
24426
24427         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24428         not Type.GetType() to lookup the array type.  This is needed when
24429         we're constructing an array of a user-defined type.
24430         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24431         single-dimensional arrays, but also for single-dimensial arrays of
24432         type decimal.
24433
24434 2002-07-19  Martin Baulig  <martin@gnome.org>
24435
24436         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24437         this function is called, it's not allowed to share LocalBuilders
24438         among ILGenerators.
24439
24440 2002-07-19  Martin Baulig  <martin@gnome.org>
24441
24442         * expression.cs (Argument.Resolve): Report an error 118 when trying
24443         to pass a type as argument.
24444
24445 2002-07-18  Martin Baulig  <martin@gnome.org>
24446
24447         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24448         Conv_R_Un for the signed `long' type.
24449
24450 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
24451
24452         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24453         `expr' for the temporary result, as that will fail if we do
24454         multiple resolves on the same expression.
24455
24456 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
24457
24458         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24459         ec.TypeContainer for looking up aliases. 
24460
24461         * class.cs (TypeContainer): Remove LookupAlias from here.
24462
24463         * decl.cs (DeclSpace); Move here.
24464
24465 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
24466
24467         * class.cs (FindMembers): Only call filter if the constructor
24468         bulider is not null.
24469
24470         Also handle delegates in `NestedTypes' now.  Now we will perform
24471         type lookups using the standard resolution process.  This also
24472         fixes a bug.
24473
24474         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24475         This uses Expressions (the limited kind that can be parsed by the
24476         tree) instead of strings.
24477
24478         * expression.cs (ComposedCast.ToString): Implement, used to flag
24479         errors since now we have to render expressions.
24480
24481         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
24482         FormArrayType. 
24483
24484         * ecore.cs (SimpleName.ToString): ditto.
24485
24486         * cs-parser.jay: Instead of using strings to assemble types, use
24487         Expressions to assemble the type (using SimpleName, ComposedCast,
24488         MemberAccess).  This should fix the type lookups in declarations,
24489         because we were using a different code path for this.
24490
24491         * statement.cs (Block.Resolve): Continue processing statements
24492         even when there is an error.
24493
24494 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
24495
24496         * class.cs (Event.Define): Also remove the `remove' method from
24497         the list of pending items.
24498
24499         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24500         generate more compact code. 
24501
24502 2002-07-17  Martin Baulig  <martin@gnome.org>
24503
24504         * const.cs (Const.LookupConstantValue): Add support for constant
24505         `unchecked' and `checked' expressions.
24506         Also adding test case test-140.cs for this.
24507
24508 2002-07-17  Martin Baulig  <martin@gnome.org>
24509
24510         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24511         check whether mi.ReturnType implements the IEnumerator interface; the
24512         `==' and the IsAssignableFrom() will fail in this situation.
24513
24514 2002-07-16  Ravi Pratap  <ravi@ximian.com>
24515
24516         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
24517         here too.
24518
24519 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24520
24521         * expression.cs: fixed bug #27811.
24522
24523 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
24524
24525         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24526         Molaro: when we are a ref, the value already contains a pointer
24527         value, do not take the address of it.
24528
24529 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24530         * removed mb-parser.jay and mb-tokenizer.cs
24531
24532 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24533
24534         * expression.cs: check against the building corlib void type.
24535
24536 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24537
24538         * ecore.cs: fix for valuetype static readonly fields: when 
24539         initializing them, we need their address, not the address of a copy.
24540
24541 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24542
24543         * typemanager.cs: register also enum_type in corlib.
24544
24545 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24546
24547         * class.cs: allow calling this (but not base) initializers in structs.
24548
24549 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24550
24551         * ecore.cs: make sure we compare against the building base types
24552         in GetTypeSize ().
24553
24554 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24555
24556         * typemanager.cs: fix TypeToCoreType() to handle void and object
24557         (corlib gets no more typerefs after this change).
24558
24559 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
24560
24561         * expression.cs (ArrayCreation.EmitArrayArguments): use
24562         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24563
24564         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24565         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
24566         array indexes, the runtime actually forbids them.
24567
24568         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24569         for array arguments here.
24570
24571         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24572         instead of the default for ValueTypes.
24573
24574         (New.DoEmit): Use IsValueType instead of
24575         IsSubclassOf (value_type)
24576         (New.DoResolve): ditto.
24577         (Invocation.EmitCall): ditto.
24578
24579         * assign.cs (Assign): ditto.
24580
24581         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24582         Statements *are* currently doing part of their resolution during
24583         Emit.  
24584
24585         Expressions do always resolve during resolve, but statements are
24586         only required to propagate resolution to their children.
24587
24588 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
24589
24590         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24591
24592         (LoadAssembly): Do not add the dll if it is already specified
24593
24594         (MainDriver): Add the System directory to the link path at the end,
24595         after all the other -L arguments. 
24596
24597         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24598         wrong opcode for loading bytes and bools (ldelem.i1 instead of
24599         ldelem.u1) and using the opposite for sbytes.
24600
24601         This fixes Digger, and we can finally run it.
24602
24603         * driver.cs (UnixParseOption): Move the option parsing here.  
24604         (CSCParseOption): Implement CSC-like parsing of options.
24605
24606         We now support both modes of operation, the old Unix way, and the
24607         new CSC-like way.  This should help those who wanted to make cross
24608         platform makefiles.
24609
24610         The only thing broken is that /r:, /reference: and /lib: are not
24611         implemented, because I want to make those have the same semantics
24612         as the CSC compiler has, and kill once and for all the confussion
24613         around this.   Will be doing this tomorrow.
24614
24615         * statement.cs (Unsafe.Resolve): The state is checked during
24616         resolve, not emit, so we have to set the flags for IsUnsfe here.
24617
24618 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24619
24620         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24621         not catch the Error_ObjectRefRequired in SimpleName (as it is
24622         possible to have a class/instance variable name that later gets
24623         deambiguated), we have to check this here.      
24624
24625 2002-07-10  Ravi Pratap  <ravi@ximian.com>
24626
24627         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24628         make static and put into Expression.
24629
24630         (Event.Define): Register the private field of the event with the 
24631         TypeManager so that GetFieldFromEvent can get at it.
24632
24633         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24634         keep track of the private field associated with an event which
24635         has no accessors.
24636
24637         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24638         private field.
24639
24640         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24641
24642 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24643
24644         * expression.cs (Binary.EmitBranchable): this routine emits the
24645         Binary expression in a branchable context.  This basically means:
24646         we need to branch somewhere, not just get the value on the stack.
24647
24648         This works together with Statement.EmitBoolExpression.
24649
24650         * statement.cs (Statement.EmitBoolExpression): Use
24651         EmitBranchable. 
24652
24653 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
24654
24655         * statement.cs (For): Reduce the number of jumps in loops.
24656
24657         (For): Implement loop inversion for the For statement.
24658
24659         (Break): We can be breaking out of a Try/Catch controlled section
24660         (foreach might have an implicit try/catch clause), so we need to
24661         use Leave instead of Br.
24662
24663         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24664         now).  If the instace expression supports IMemoryLocation, we use
24665         the AddressOf method from the IMemoryLocation to extract the
24666         address instead of emitting the instance.
24667
24668         This showed up with `This', as we were emitting the instance
24669         always (Emit) instead of the Address of This.  Particularly
24670         interesting when This is a value type, as we dont want the Emit
24671         effect (which was to load the object).
24672
24673 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24674
24675         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24676
24677         * statement.cs (Checked): Set the CheckedState during the resolve
24678         process too, as the ConvCast operations track the checked state on
24679         the resolve process, and not emit.
24680
24681         * cs-parser.jay (namespace_member_declaration): Flag that we have
24682         found a declaration when we do.  This is used to flag error 1529
24683
24684         * driver.cs: Report ok when we display the help only.
24685
24686 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24687
24688         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24689
24690 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24691
24692         * cs-tokenizer.cs (define): We also have to track locally the
24693         defines.  AllDefines is just used for the Conditional Attribute,
24694         but we also need the local defines for the current source code. 
24695
24696 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24697
24698         * statement.cs (While, For, Do): These loops can exit through a
24699         Break statement, use this information to tell whether the
24700         statement is the last piece of code.
24701
24702         (Break): Flag that we break.
24703
24704         * codegen.cs (EmitContexts): New `Breaks' state variable.
24705
24706 2002-07-03  Martin Baulig  <martin@gnome.org>
24707
24708         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24709         modifiers in method declarations in structs.  Otherwise, you won't
24710         be able to override things like Object.Equals().
24711
24712 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24713
24714         * class.cs (Method, Property, Indexer): Do not allow the public
24715         modifier to be used in explicit interface implementations.
24716
24717         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24718         override modifiers in method declarations in structs
24719
24720 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24721
24722         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24723         integer or real overflow, report an error
24724
24725 2002-07-02  Martin Baulig  <martin@gnome.org>
24726
24727         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24728         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24729         to tell the runtime about our newly created System.Object and
24730         System.ValueType types.
24731
24732 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24733
24734         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24735         struct instead of Ldarg/Starg.
24736
24737 2002-07-02  Martin Baulig  <martin@gnome.org>
24738
24739         * expression.cs (Indirection.Indirection): Call
24740         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24741
24742 2002-07-02  Martin Baulig  <martin@gnome.org>
24743
24744         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24745         ValueType, call TypeManager.TypeToCoreType() on it.
24746         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24747         the OpCodes.Newarr argument.
24748
24749 2002-07-02  Martin Baulig  <martin@gnome.org>
24750
24751         * expression.cs (Invocation.EmitCall): When compiling corlib,
24752         replace all calls to the system's System.Array type to calls to
24753         the newly created one.
24754
24755         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24756         System.Array methods.
24757         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24758         from the system's System.Array type which must be replaced.
24759
24760 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24761
24762         * typemanager.cs: load unverifiable_code_ctor so we can build
24763         corlib using the correct type. Avoid using GetTypeCode() with
24764         TypeBuilders.
24765         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24766         TypeManager.object_type to allow building corlib.
24767
24768 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24769
24770         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24771
24772 2002-07-01  Martin Baulig  <martin@gnome.org>
24773
24774         * class.cs: Make the last change actually work, we need to check
24775         whether `ifaces != null' to avoid a crash.
24776
24777 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24778
24779         * class.cs: when we build structs without fields that implement
24780         interfaces, we need to add the interfaces separately, since there is
24781         no API to both set the size and add the interfaces at type creation
24782         time.
24783
24784 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24785
24786         * expression.cs: the dimension arguments to the array constructors
24787         need to be converted if they are a long.
24788
24789 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24790
24791         * class.cs: don't emit ldarg.0 if there is no parent constructor
24792         (fixes showstopper for corlib).
24793
24794 2002-06-29  Martin Baulig  <martin@gnome.org>
24795
24796         MCS now compiles corlib on GNU/Linux :-)
24797
24798         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24799         ie. check for MethodImplOptions.InternalCall.
24800
24801         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24802         and TypeManager.attribute_type are null, so we must explicitly check
24803         whether parent is not null to find out whether it's an attribute type.
24804         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24805         and SetBuilder, not only if the property is neither abstract nor external.
24806         This is necessary to set the MethodImplOptions on the accessor methods.
24807         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24808         SetBuilder, see Property.Emit().
24809
24810         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24811         populate "System.Object", "System.ValueType" and "System.Attribute" since
24812         they've already been populated from BootCorlib_PopulateCoreTypes().
24813
24814 2002-06-29  Martin Baulig  <martin@gnome.org>
24815
24816         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24817         is the NullLiteral, we also need to make sure that target_type is not
24818         an enum type.   
24819
24820 2002-06-29  Martin Baulig  <martin@gnome.org>
24821
24822         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24823         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24824         before calling BootstrapCorlib_ResolveDelegate ().
24825
24826 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24827
24828         * statement.cs: fixed build-breaker. All tests passed ok.
24829
24830 2002-06-27  Martin Baulig  <martin@gnome.org>
24831
24832         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24833         for System.Decimal when compiling corlib.
24834
24835 2002-06-27  Martin Baulig  <martin@gnome.org>
24836
24837         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24838         switch blocks which contain nothing but a default clause.
24839
24840 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24841
24842        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24843
24844 2002-06-27  Martin Baulig  <martin@gnome.org>
24845
24846         * ecore.cs (PropertyExpr.PropertyExpr): Call
24847         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24848
24849         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24850         is already a TypeBuilder.
24851
24852 2002-06-27  Martin Baulig  <martin@gnome.org>
24853
24854         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24855         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24856         the "from an array-type to System.Array" case.  This makes it work
24857         when compiling corlib.
24858
24859 2002-06-27  Martin Baulig  <martin@gnome.org>
24860
24861         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24862         non-static PropertyExpr, set its InstanceExpression.  This makes
24863         the `ICollection.Count' property work in System/Array.cs.
24864
24865 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24866
24867         * driver.cs: Made error handling more consistent.  Errors now
24868         tracked by Report class, so many methods which used to return int
24869         now return void.  Main() now prints success/failure and 
24870         errors/warnings message.
24871
24872         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24873         the magic number return values (123 and 124).  Now, if the
24874         expected error occurs, the compiler exits with success (exit value
24875         0).  If the compilation completes without seeing that particular
24876         error, the compiler exits with failure (exit value 1).  The
24877         makefile in mcs/errors has been changed to handle the new behaviour.
24878
24879         * report.cs: Made 'expected error' number a property and renamed
24880         it from 'Probe' to 'ExpectedError'.
24881
24882         * genericparser.cs: Removed error handling support, since it is
24883         now all done by Report class.
24884
24885         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24886         class, so parse() no longer returns an int.
24887
24888         * namespace.cs: Use Report.Error instead of GenericParser.error
24889
24890 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24891
24892         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24893         TypeContainer.AddOperator): At the front of the list put the
24894         explicit implementations, so they get resolved/defined first. 
24895
24896 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24897
24898         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24899         interface type is implemented by this TypeContainer.  Used during
24900         explicit interface implementation.
24901
24902         (Property.Define, Indexer.Define, Method.Define): Validate that
24903         the given interface in the explicit implementation is one of the
24904         base classes for the containing type.
24905
24906         Also if we are explicitly implementing an interface, but there is
24907         no match in the pending implementation table, report an error.
24908
24909         (Property.Define): Only define the property if we are
24910         not explicitly implementing a property from an interface.  Use the
24911         correct name also for those properties (the same CSC uses,
24912         although that is really not needed).
24913
24914         (Property.Emit): Do not emit attributes for explicitly implemented
24915         properties, as there is no TypeBuilder.
24916
24917         (Indexer.Emit): ditto.
24918
24919         Hiding then means that we do not really *implement* a pending
24920         implementation, which makes code fail.
24921
24922 2002-06-22  Martin Baulig  <martin@gnome.org>
24923
24924         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24925         the return value of Object.GetType().  [FIXME: we need to do this whenever
24926         we get a type back from the reflection library].
24927
24928 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24929
24930         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24931
24932 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24933
24934         * attribute.cs: Return null if we can not look up the type.
24935
24936         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24937         the interface types found.
24938
24939         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24940         interface types found.
24941
24942         * typemanager.cs (GetInterfaces): Make this routine returns alll
24943         the interfaces and work around the lame differences between
24944         System.Type and System.Reflection.Emit.TypeBuilder in the results
24945         result for GetInterfaces.
24946
24947         (ExpandInterfaces): Given an array of interface types, expand and
24948         eliminate repeated ocurrences of an interface.  This expands in
24949         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24950         be IA, IB, IC.
24951
24952 2002-06-21  Martin Baulig  <martin@gnome.org>
24953
24954         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24955         on System.Enum.
24956
24957 2002-06-21  Martin Baulig  <martin@gnome.org>
24958
24959         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24960         and called with one of the core types, return the corresponding typebuilder for
24961         that type.
24962
24963         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24964         element type.
24965
24966 2002-06-21  Martin Baulig  <martin@gnome.org>
24967
24968         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24969         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24970         (Expression.ConvertReferenceExplicit): Likewise.
24971
24972         * expression.cs (ElementAccess.DoResolve): Likewise.
24973         (ElementAccess.DoResolveLValue): Likewise.
24974
24975 2002-06-10  Martin Baulig  <martin@gnome.org>
24976
24977         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24978         add the "value" parameter to the parameter list.
24979
24980         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24981         to our caller.
24982
24983 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24984
24985         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24986         the argument to an int, uint, long or ulong, per the spec.  Also
24987         catch negative constants in array creation.
24988
24989 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24990
24991         * class.cs: do not allow the same interface to appear twice in
24992         the definition list.
24993
24994 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24995
24996         * ecore.cs: don't use ldlen with System.Array.
24997
24998 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24999
25000         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
25001
25002 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25003
25004         * modifiers.cs: produce correct field attributes for protected
25005         internal. Easy fix so miguel can work on ther harder stuff:-)
25006
25007 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
25008
25009         * pending.cs: New file.  Move the code from class.cs here.
25010         Support clearning the pending flag for all methods (when not doing
25011         explicit interface implementation).
25012
25013 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25014
25015         * rootcontext.cs: added a couple more types needed to bootstrap.
25016
25017 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
25018
25019         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
25020         constructor in the type, instead of any constructor in the type
25021         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
25022         a bug in the Mono runtime when applying the params attribute). 
25023
25024 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
25025         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
25026
25027 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
25028
25029         * expression.cs (Unary.ResolveOperator): Use TypeManager
25030         to resolve the type.
25031
25032 2002-06-13  Ravi Pratap  <ravi@ximian.com>
25033
25034         * cs-parser.jay (enum_member_declaration): Pass in the attributes
25035         attached.
25036
25037         * enum.cs (AddEnumMember): Add support to store the attributes associated 
25038         with each member too.
25039
25040         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
25041         field builders too - this takes care of the enum member case.
25042
25043 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
25044
25045         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
25046         address-of operator on both value types and pointers.
25047
25048 2002-06-10  Martin Baulig  <martin@gnome.org>
25049
25050         * interface.cs (Interface.PopulateIndexer): Add the indexer's
25051         PropertyBuilder to the `property_builders' list.
25052
25053         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
25054         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
25055         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
25056         find any indexers which are inherited from an interface.
25057
25058 2002-06-09  Martin Baulig  <martin@gnome.org>
25059
25060         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
25061         the same type as the constant if necessary.  There's also a test-130.cs
25062         for this.
25063
25064         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
25065
25066         * typemanager.cs (TypeManager.ChangeType): Previously known as
25067         Enum.ChangeEnumType().
25068
25069 2002-06-09  Martin Baulig  <martin@gnome.org>
25070
25071         * expression.cs (Cast.TryReduce): Added support for consts.
25072
25073 2002-06-08  Ravi Pratap  <ravi@ximian.com>
25074
25075         * class.cs (Accessor): Hold attributes information so we can pass
25076         it along.
25077
25078         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
25079         Modify to pass in attributes attached to the methods.
25080
25081         (add_accessor_declaration, remove_accessor_declaration): Ditto.
25082
25083         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
25084         to handle the Accessor kind :-)
25085
25086         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
25087
25088 2002-06-08  Martin Baulig  <martin@gnome.org>
25089
25090         * expression.cs (Unary.TryReduceNegative): Added support for
25091         ULongConstants.
25092
25093 2002-06-08  Martin Baulig  <martin@gnome.org>
25094
25095         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25096         name can't be found in the `defined_names' - the caller will do a
25097         MemberLookup in this case and thus find methods in System.Enum
25098         such as Enum.IsDefined().
25099
25100 2002-06-08  Martin Baulig  <martin@gnome.org>
25101
25102         * enum.cs (Enum.ChangeEnumType): This is a custom version of
25103         Convert.ChangeType() which works with TypeBuilder created types.
25104         (Enum.LookupEnumValue, Enum.Define): Use it here.
25105
25106         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25107         `TypeBuilder.BaseType != null' check.
25108         (TypeContainer.FindMembers): Only lookup parent members if we
25109         actually have a parent.
25110         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25111         (ConstructorInitializer.Resolve): Likewise.
25112
25113         * interface.cs (Interface.FindMembers): Added
25114         `TypeBuilder.BaseType != null' check.
25115
25116         * rootcontext.cs (RootContext.ResolveCore): Added
25117         "System.Runtime.CompilerServices.IndexerNameAttribute" to
25118         classes_second_stage.
25119
25120         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25121         debug_type and trace_type when compiling with --nostdlib.       
25122
25123 2002-06-07  Martin Baulig  <martin@gnome.org>
25124
25125         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25126         (AddField): Set it to true when adding a non-static field.
25127         (DefineType): Use `have_nonstatic_fields' to find out whether we
25128         have non-static fields, not `Fields != null'.
25129
25130 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
25131
25132         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25133         dereferencing a null on the static-field code path)
25134
25135 2002-05-30  Martin Baulig  <martin@gnome.org>
25136
25137         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25138         to take command line arguments.  Use reflection to call the new
25139         custom `Initialize' function on the symbol writer and pass it the
25140         command line arguments.
25141
25142         * driver.cs (--debug-args): New command line argument to pass command
25143         line arguments to the symbol writer.
25144
25145 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
25146
25147         * assign.cs (DoResolve): Forgot to do the implicit conversion to
25148         the target type for indexers and properties.  Thanks to Joe for
25149         catching this.
25150
25151 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
25152
25153         * typemanager.cs (MethodFlags): returns the method flags
25154         (Obsolete/ShouldIgnore) that control warning emission and whether
25155         the invocation should be made, or ignored. 
25156
25157         * expression.cs (Invocation.Emit): Remove previous hack, we should
25158         not do this on matching a base type, we should do this based on an attribute
25159
25160         Only emit calls to System.Diagnostics.Debug and
25161         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25162         on the command line.
25163
25164         * rootcontext.cs: Global settings for tracing and debugging.
25165
25166         * cs-tokenizer.cs (define): New utility function to track
25167         defines.   Set the global settings for TRACE and DEBUG if found.
25168
25169 2002-05-25  Ravi Pratap  <ravi@ximian.com>
25170
25171         * interface.cs (Populate*): Pass in the TypeContainer as well as
25172         the DeclSpace as parameters so that we can create EmitContexts and
25173         then use that to apply attributes etc.
25174
25175         (PopulateMethod, PopulateEvent, PopulateProperty)
25176         (PopulateIndexer): Apply attributes everywhere.
25177
25178         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25179         etc.
25180
25181         (ApplyAttributes): Update accordingly.
25182
25183         We now apply interface attributes for all members too.
25184
25185 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
25186
25187         * class.cs (Indexer.Define); Correctly check if we are explicit
25188         implementation (instead of checking the Name for a ".", we
25189         directly look up if the InterfaceType was specified).
25190
25191         Delay the creation of the PropertyBuilder.
25192
25193         Only create the PropertyBuilder if we are not an explicit
25194         interface implementation.   This means that explicit interface
25195         implementation members do not participate in regular function
25196         lookups, and hence fixes another major ambiguity problem in
25197         overload resolution (that was the visible effect).
25198
25199         (DefineMethod): Return whether we are doing an interface
25200         implementation. 
25201
25202         * typemanager.cs: Temporary hack until we get attributes in
25203         interfaces (Ravi is working on that) and we get IndexerName
25204         support in interfaces.
25205
25206         * interface.cs: Register the indexers as properties.
25207
25208         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25209         warning, I have verified that this is a bug in the .NET runtime
25210         (JavaScript suffers of the same problem).
25211
25212         * typemanager.cs (MemberLookup): When looking up members for
25213         interfaces, the parent of an interface is the implicit
25214         System.Object (so we succeed in searches of Object methods in an
25215         interface method invocation.  Example:  IEnumerable x;  x.ToString
25216         ()) 
25217
25218 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
25219
25220         * class.cs (Event): Events should also register if they do
25221         implement the methods that an interface requires.
25222
25223         * typemanager.cs (MemberLookup); use the new GetInterfaces
25224         method. 
25225
25226         (GetInterfaces): The code used to lookup interfaces for a type is
25227         used in more than one place, factor it here. 
25228
25229         * driver.cs: Track the errors at the bottom of the file, we kept
25230         on going.
25231
25232         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25233         instance if the method we are calling is static!
25234
25235 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
25236
25237         * attribute.cs (ApplyAttributes): Make this function filter out
25238         the IndexerName attribute (as that attribute in reality is never
25239         applied) and return the string constant for the IndexerName
25240         attribute. 
25241
25242         * class.cs (TypeContainer.Emit): Validate that all the indexers
25243         have the same IndexerName attribute, and if so, set the
25244         DefaultName attribute on the class. 
25245
25246         * typemanager.cs: The return value might contain other stuff (not
25247         only methods).  For instance, consider a method with an "Item"
25248         property and an Item method.
25249
25250         * class.cs: If there is a problem with the parameter types,
25251         return. 
25252
25253 2002-05-24  Ravi Pratap  <ravi@ximian.com>
25254
25255         * ecore.cs (ImplicitConversionExists): Wrapper function which also
25256         looks at user defined conversion after making a call to 
25257         StandardConversionExists - we need this for overload resolution.
25258
25259         * expression.cs : Update accordingly the various method calls.
25260
25261         This fixes 2 bugs filed against implicit user defined conversions 
25262
25263 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
25264
25265         * statement.cs: Track the result of the assignment.
25266
25267 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
25268
25269         * expression.cs (MemberAccess): Improved error reporting for
25270         inaccessible members.
25271
25272 2002-05-22  Martin Baulig  <martin@gnome.org>
25273
25274         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
25275         itself with debugging support.
25276
25277 2002-05-22  Martin Baulig  <martin@gnome.org>
25278
25279         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25280         Removed, this isn't needed anymore.
25281
25282 2002-05-20  Martin Baulig  <martin@gnome.org>
25283
25284         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25285         be underlying type for an enum.
25286
25287 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
25288
25289         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25290         that splits out the loading of just the core types.
25291
25292         * rootcontext.cs (ResolveCore): Split the struct resolution in
25293         two, so we can load the enumeration underlying types before any
25294         enums are used.
25295
25296         * expression.cs (Is): Bandaid until we fix properly Switch (see
25297         bug #24985 for details).
25298
25299         * typemanager.cs (ImplementsInterface): The hashtable will contain
25300         a null if there are no interfaces implemented.
25301
25302 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
25303
25304         * cs-parser.jay (indexer_declarator): It is fine to have array
25305         parameters
25306
25307 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25308
25309         * typemanager.cs: (RegisterBuilder): New function used to register
25310         TypeBuilders that implement interfaces.  Since
25311         TypeBuilder.GetInterfaces (as usual) does not work with lame
25312         Reflection.Emit. 
25313         (AddUserType): register interfaces.
25314
25315         (ImplementsInterface): Use the builder_to_ifaces hash if we are
25316         dealing with TypeBuilder.  Also, arrays are showing up as
25317         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25318         methods can not be invoked on them!
25319
25320         * ecore.cs (ExplicitReferenceConversionExists): Made public.
25321         (ImplicitReferenceConversionExists): Split out from
25322         StandardConversionExists. 
25323
25324         * expression.cs (As): We were only implementing one of the three
25325         cases for the as operator.  We now implement them all.
25326         (Is): Implement the various other cases for Is as well.
25327
25328         * typemanager.cs (CACHE): New define used to control if we want or
25329         not the FindMembers cache.  Seems to have a negative impact on
25330         performance currently
25331
25332         (MemberLookup): Nested types have full acess to
25333         enclosing type members
25334
25335         Remove code that coped with instance/static returns for events, we
25336         now catch this in RealFindMembers.
25337
25338         (RealFindMembers): only perform static lookup if the instance
25339         lookup did not return a type or an event.  
25340
25341 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25342
25343         * assign.cs (CompoundAssign): We pass more semantic information
25344         now to Compound Assignments than we did before: now we have all
25345         the information at hand, and now we resolve the target *before* we
25346         do the expression expansion, which allows the "CacheValue" method
25347         to have the effect we intended (before, a [x] += 1 would generate
25348         two differen ArrayAccess expressions from the ElementAccess,
25349         during the resolution process).
25350
25351         (CompoundAssign.DoResolve): Resolve target and original_source here.
25352
25353 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
25354
25355         * expression.cs (ArrayAccess): dropped debugging information. 
25356
25357         * typemanager.cs: Small bug fix: I was always returning i_members,
25358         instead of one of i_members or s_members (depending on which had
25359         the content).
25360
25361         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
25362         method is invoked before any code generation takes place, and it
25363         is a mechanism to inform that the expression will be invoked more
25364         than once, and that the method should use temporary values to
25365         avoid having side effects
25366
25367         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25368
25369         * ecore.cs (Expression.CacheTemporaries): Provide empty default
25370         implementation.
25371
25372         * expression.cs (Indirection, ArrayAccess): Add support for
25373         CacheTemporaries in these two bad boys. 
25374
25375         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25376         ldobj or ldind_ref.  
25377         (StoreFromPtr): Handle stobj as well.
25378
25379         * expression.cs (UnaryMutator): Share more code.
25380
25381         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25382         down: I was not tracking the Filter function as well, which
25383         was affecting the results of the cache.
25384
25385 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
25386
25387         * attribute.cs: Remove the hack to handle the CharSet property on
25388         StructLayouts. 
25389
25390 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
25391
25392         * attribute.cs (DoResolve): More uglyness, we now only try to
25393         resolve the attribute partially, to extract the CharSet
25394         information (only if we are a StructLayout attribute).  Otherwise 
25395
25396         (GetExtraTypeInfo): Add some code to conditionally kill in the
25397         future this.   I am more and more convinced that the .NET
25398         framework has special code to handle the attribute setting on
25399         certain elements.
25400
25401         * expression.cs (IsParamsMethodApplicable): Revert my previous
25402         foreach change here, it was wrong.
25403
25404 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
25405
25406         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25407         (pp_expr): do not abort on unknown input, just return.
25408         (eval): abort if there are pending chars.
25409
25410         * attribute.cs (Attribute.Resolve): Positional parameters are
25411         optional.  Deal with that case.
25412
25413         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25414         the Ansi/Unicode/Auto information for the type.
25415
25416         (TypeContainer.DefineType): instantiate the EmitContext here, as
25417         we will be using it during the type definition (to resolve
25418         attributes) and during the emit phase.
25419
25420         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25421         to pull type information out of the attributes
25422
25423         (Attribute.Resolve): track the constructor builder, and allow for
25424         multiple invocations (structs and classes will use this).
25425
25426         * ecore.cs (MemberLookupFinal): new version with all the
25427         parameters customizable.
25428
25429         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25430         constructors.  Return if the result value is null (as the error
25431         would have been flagged already by MemberLookupFinal)
25432
25433         Do not allow instances of abstract classes or interfaces to be
25434         created.
25435
25436         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25437         We have to compare the assembly property here when dealing with
25438         FamANDAssem and Assembly access modifiers, because we might be
25439         creating an assembly from *modules* (that means that we are not
25440         getting TypeBuilders for types defined in other modules that are
25441         part of this assembly).
25442
25443         (Method.Emit): If the method is marked abstract and has a body,
25444         emit an error. 
25445
25446         (TypeContainer.DefineMembers): If both the defined member and the
25447         parent name match are methods, then do not emit any warnings: let
25448         the Method.Define routine take care of flagging warnings.  But if
25449         there is a mismatch (method overrides something else, or method is
25450         overriwritten by something, then emit warning).
25451
25452         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25453         set to null, this means `do not check for the return type on the
25454         signature'. 
25455
25456         (Method.Define): set the return type for the method signature to
25457         null, so that we get methods with the same name and parameters and
25458         different return types.  This is used to flag warning 114 (you are
25459         hiding a method, and you probably want to use the new/override
25460         keywords instead).
25461
25462         * typemanager.cs (MemberLookup): Implemented proper access
25463         control, closing a long standing set of bug reports.  The problem
25464         was that the Framework only has two bits: Public and NonPublic,
25465         and NonPublic includes private and protected methods, but we need
25466         to enforce the FamANDAssem, FamOrAssem and Family. 
25467
25468 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
25469
25470         * statement.cs (GotoCase): Return true: Ammounts to giving up
25471         knowledge on whether we return or not, and letting the other case
25472         be responsible for it.
25473
25474 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
25475
25476         * driver.cs: Do not load directories for each file processed, only
25477         do it if there is a pattern.
25478
25479         * ecore.cs: Report readonly assigns here as well, as we might have
25480         been resolved only by MemberAccess.
25481
25482         (SimpleName.SimpleNameResolve): Also be useful for LValue
25483         resolution.   We need this to propagate assign to local readonly variables
25484
25485         * typemanager.cs: Use a ptrhashtable for the criteria, because we
25486         do not want to reuse potential criteria memory.
25487
25488         * class.cs (MyEventBuilder): Set reflected_type;
25489
25490         * ecore.cs (Constantify): Added support for constifying bools.
25491
25492         (RootContext.LookupType): Added a cache for values looked up in
25493         the declaration space.
25494
25495         * typemanager.cs (FindMembers): Now is a front-end to
25496         RealFindMembers, and provides a two-level hashtable-based cache to
25497         the request.  
25498
25499         15% performance improvement: from 22.5 to 19.2 seconds.
25500
25501         * expression.cs (IsParamsMethodApplicable): use foreach.
25502         (Invocation.DoResolve): ditto.
25503         (New.DoResolve): ditto.
25504         (ArrayCreation.DoResolve): ditto.
25505
25506         * ecore.cs (FindMostEncompassingType): use foreach.
25507
25508         * delegate.cs (NewDelegate.DoResolve): Use foreach
25509
25510         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25511         (RemoveMethods): use foreach.
25512
25513         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25514         nested foreach statements instead of for, and also break out of
25515         the inner loop once a match is found.
25516
25517         (Invocation.OverloadResolve): Use foreach, simplify the code. 
25518
25519 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
25520
25521         * cfold.cs (BinaryFold): During an enumeration evaluation context,
25522         we actually unwrap the expression to allow for extra information
25523         to be extracted. 
25524
25525         * expression.cs: Use Shr_Un on unsigned operations. 
25526
25527 2002-05-08  Ravi Pratap  <ravi@ximian.com>
25528
25529         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
25530         applicable operators was not being considered correctly. This closes
25531         the bug Miguel reported.
25532
25533 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25534
25535         * attribute.cs: check that the type derives from System.Attribute
25536         and report the correct error in that case (moved the duplicate code to
25537         its own method, too).
25538
25539 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25540
25541         * attribute.cs: lookup attribute type name as the spec says: first the
25542         bare attribute name and then name + "Attribute" (nant compiles with
25543         mcs after this fix).
25544
25545 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
25546
25547         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
25548         Because of the way we parse things, we should try to see if a
25549         UIntConstant can fit in an integer.
25550
25551 2002-05-07  Ravi Pratap  <ravi@ximian.com>
25552
25553         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25554         when we are in an explicit context.
25555
25556         (ConvertReferenceExplicit): When converting from Iface type S to Class
25557         T make sure the rules are implemented as an OR.
25558
25559         * parameter.cs (ParameterType): Make it a property for now although the
25560         purpose really isn't anything immediate.
25561
25562         * expression.cs (Is*Applicable): Do better checking on the parameter type
25563         of a ref/out parameter. The ones from the system assemblies are already 
25564         marked with the correct type so we don't need to do any correction.
25565
25566         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
25567         the object type is standard too so include that.
25568
25569 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25570
25571         * ecore.cs (StandardConversionExists): Augment with missing code:
25572         deal with IntConstant, LongConstants and Enumerations.
25573
25574         * assign.cs: Report the error, instead of failing silently
25575
25576         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25577         typecontainer that they are declared, because the
25578         typecontainer/namespace will have the list of using clauses that
25579         need to be applied.
25580
25581         Assembly Attributes were escaping the normal registration
25582         mechanism. 
25583
25584         (EmitCode): Apply attributes within an EmitContext that represents
25585         the container they were declared on.
25586
25587         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
25588
25589 2002-05-06  Ravi Pratap  <ravi@ximian.com>
25590
25591         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25592         Revamp completely - make much cleaner as we now operate only
25593         on a set of Types.
25594
25595         (FindMostSpecificSource, FindMostSpecificTarget): New methods
25596         to implement the logic detailed in the spec more correctly.
25597
25598         (UserDefinedConversion): Update accordingly.
25599
25600 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25601
25602         * statement.cs: Return flow analysis information up.
25603
25604         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25605         and the default.
25606
25607         (token): Do not consume an extra character before calling
25608         decimal_digits.
25609
25610 2002-05-06  Piers Haken <piersh@friskit.com>
25611
25612         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25613
25614 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25615
25616         * class.cs (Constructor.Emit): Set the IsStatic flag in the
25617         EmitContext during the instance constructor initializer
25618         resolution, to stop access to instance variables.
25619
25620         This is mandated by the spec, last paragraph of the `constructor
25621         initializers' section. 
25622
25623 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
25624
25625         * cs-parser.jay, class.cs (Accessor): new class used to represent
25626         an accessor (get or set).  In the past we used `null' to represent
25627         a missing accessor.  But this is ambiguous because there was no
25628         way to tell in abstract indexers/properties if one of them was
25629         specified.
25630
25631         Now there is a way of addressing that.
25632
25633         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25634         instead of FindMembers.
25635
25636         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25637         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25638
25639         * attribute.cs: Treat indexers and properties as the same in terms
25640         of applying attributes
25641
25642         * ecore.cs (FindMostEncompassedType): Use statically initialized
25643         EmptyExpressions()s like we do elsewhere to avoid creating useless
25644         objects (and we take this out of the tight loop).
25645
25646         (GetConversionOperators): Move the code to extract the actual
25647         operators to a separate routine to clean things up.
25648
25649 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
25650
25651         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25652         events are always registered FieldBuilders.
25653
25654         * class.cs (FieldBase): New class shared by Fields 
25655
25656         * delegate.cs: If we are a toplevel delegate, use our full name.
25657         If we are a nested delegate, then only use our tail name.
25658
25659 2002-05-02  Ravi Pratap  <ravi@ximian.com>
25660
25661         * expression.cs (IsApplicable): Ensure that we add the "&" to
25662         ref/out types before comparing it with the type of the argument.
25663
25664         (IsParamsMethodApplicable): Ditto.
25665
25666         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
25667         silly me ;-)
25668
25669         * delegate.cs : Handle the case when we have more than one applicable
25670         method. Flag an error only when we finish checking all.
25671
25672 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25673
25674         * expression.cs: Add support for boolean static initializers.
25675
25676 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25677
25678         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25679
25680         * parameter.cs (ComputeParameterTypes,
25681         ComputeAndDefineParameterTypes): Better error handling: now we
25682         clear the `types' cache if we fail during any of the type lookups.
25683         We also return the status code correctly to our caller
25684
25685         * delegate.cs: If we fail to define a delegate, abort the extra
25686         steps. 
25687
25688         * expression.cs (Binary.ResolveOperator): for
25689         operator==(object,object) and operator !=(object, object) we also
25690         have to verify that there is an implicit conversion from one to
25691         the other.
25692
25693         (ArrayAccess.DoResolve): Array Access can operate on
25694         non-variables. 
25695
25696 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25697
25698         * assign.cs (CompoundAssign): A new class used as a "flag" that
25699         the assignment actually is happening as part of a compound
25700         assignment operator.
25701
25702         During compound assignment, a few new rules exist to enable things
25703         like:
25704
25705         byte b |= 1 + 2
25706
25707         From the spec:
25708
25709         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25710         to the type of x) if y is implicitly convertible to the type of x,
25711         and the operator is a builtin operator and the return type of the
25712         operator is explicitly convertible to the type of x. 
25713
25714         * rootcontext.cs: Reset warning level to 2.  4 catches various
25715         "interesting" features in mcs, we must clean this up at some
25716         point, but currently am trying to kill other bugs ;-)
25717
25718         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25719         in container classes as well.  
25720
25721         * expression.cs (Binary.ResolveOperator): Handle string case
25722         before anything else (as operator overloading does emit an error
25723         before doing anything else).
25724
25725         This code could go away when we move to a table driven model, but
25726         i could not come up with a good plan last night.
25727
25728 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25729
25730         * typemanager.cs (CSharpName): reimplementation using regex.
25731         * class.cs: added null check for fields in Emit
25732         * rootcontext.cs: set warninglevel to 4
25733
25734 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25735
25736         * typemanager.cs (CSharpName): reimplemented with Lupus
25737         suggestion.
25738
25739 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25740
25741         * statement.cs (If): correclty implement Resolve, because we were
25742         not catching sem errors in there.  The same process is needed
25743         everywhere else. 
25744         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25745
25746
25747         (Statement.Warning_DeadCodeFound): Factorize code.
25748         (While): Report dead code here too.
25749
25750         (Statement): Added Resolve virtual method to allow
25751         for resolution split from the emit code.
25752
25753 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25754
25755         * statement.cs (EmitBoolExpression): No longer try to resolve the
25756         expression here.    
25757         (MakeBoolean): New utility function that resolve, implicitly
25758         converts to boolean and tags the expression. 
25759
25760
25761         (If, Do): Implement dead code elimination.
25762         (While): Implement loop inversion
25763
25764         (Do, While, For, If): Resolve the expression prior to calling our
25765         code generation.
25766
25767 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25768
25769         * class.cs:
25770           - added method Report28 (warning: program has more than one entry point)
25771           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25772           - modified method Method.Define, the part at the end of the method
25773
25774         * rootcontext.cs: added static public Location EntryPointLocation;
25775           
25776         * ../errors/cs0028.cs : Add test case for the above warning.              
25777
25778         * typemanager.cs:
25779           - modified method CSharpName to allow arrays of primitive type to
25780             be printed nicely (e.g. instead of System.Int32[][] it now prints
25781             int[][])
25782           - added method CSharpSignature: returns the signature of a method
25783             in string format to be used in reporting errors, warnings, etc.
25784
25785         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25786         with String.Empty.
25787
25788 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25789
25790         * delegate.cs (Define): Fix extremely silly bug where I was
25791         setting the type of the 'object' parameter of the BeginInvoke
25792         method to System.IAsyncResult instead of System.Object ;-)
25793
25794 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25795
25796         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25797         here. 
25798
25799         (Constructor.Emit): return if we fail to initialize the
25800         constructor.  Another door closed!  
25801
25802         * expression.cs (New.DoResolve): Improve error message (from -6 to
25803         1501).  Use DeclaredOnly lookup to find the exact constructor.
25804
25805         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25806         loop.  This is useful.
25807
25808         * cs-parser.jay: Adjust the default parameters so that destructors
25809         have the proper signature.
25810
25811 2002-04-26  Martin Baulig  <martin@gnome.org>
25812
25813         * driver.cs (LoadAssembly): If `assembly' contains any characters
25814         which are only valid in path names and not in assembly names
25815         (currently slash, backslash and point), use Assembly.LoadFrom ()
25816         instead of Assembly.Load () on the `assembly' (before iteration
25817         over the link_paths).
25818
25819 2002-04-26  Martin Baulig  <martin@gnome.org>
25820
25821         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25822
25823 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25824
25825         * class.cs (Property): use the new typemanager.MemberLookup
25826
25827         (TypeContainer.MemberLookup): Implement using the
25828         TypeManager.MemberLookup now. 
25829
25830         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25831         and return MemberInfos, so that these can be used without an
25832         EmitContext (what we had before).
25833
25834 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25835
25836         * expression.cs: Fix the case where the argument to params if the
25837         type of the params.  I omitted handling this before.   Fixed
25838
25839 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25840
25841         * driver.cs: Call BootCorlib_PopulateCoreType
25842
25843         * class.cs (Property.CheckBase): Check for properties only, not
25844         for all members. 
25845
25846         * interface.cs: Temporary hack: try/catch around the
25847         CustomAttributeBuilder, because I am getting an exception that I
25848         do not understand.
25849
25850         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25851         types whose definitions are required to be there (attributes are
25852         defined before standard types).
25853
25854         Compute definitions as we boot the various types, as they are used
25855         immediately (value_type class will need object_type, but if we do
25856         not initialize object_type, we will pass a null, which will let
25857         the runtime pick the System.Object from the existing corlib, which
25858         is not what we want).
25859
25860 2002-04-22  Patrik Torstensson <totte@labs2.com>
25861
25862         * cs-tokenizer.cs: fixed a number of trim() issues.
25863
25864 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25865
25866         * expression.cs (Argument.Type): Ensure that we return the correct
25867         type when we have out or ref parameters [in which case we 
25868         append a "&"].
25869
25870 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25871
25872         * class.cs (Property, Indexer): Allow extern modifier in there. 
25873
25874         * typemanager.cs (InitBaseTypes): Initializes object_type and
25875         value_type, since those will be used early on during the bootstrap
25876         process to compile corlib.
25877
25878         (InitCoreTypes): Move code from here to InitBaseTypes.
25879
25880 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25881
25882         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25883         single-dimension arrays as using the ldlen opcode.  
25884
25885         Daniel Lewis discovered this optimization.  
25886
25887         * typemanager.cs: Add signature for System.Array::get_Length
25888
25889 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25890
25891         * statement.cs: report the error when the foreach does not apply to an
25892         array nor a collection.
25893
25894 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25895
25896         * expression.cs: Add implicit conversions to the operator ~.
25897
25898         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25899
25900         * typemanager.cs: Locate the decimal constructor.
25901
25902 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25903
25904         * attribute.cs: use the new property of TypeOf.
25905         * expression.cs: added 'get' property around typearg.
25906
25907         These changes fix a build breaker reported by NickD. Is this the
25908         correct way to fix?  If not, please, revert my changes and make it
25909         work :-).
25910
25911 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25912
25913         * attribute.cs: Add support for typeof in attribute invocations.
25914         I am not sure that this is right though.
25915
25916 2002-04-14  Duncan Mak  <duncan@ximian.com>
25917
25918         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25919         Binary.Operator.Division case.
25920
25921 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25922
25923         * class.cs (DefineType): Ensure that we do a proper check on
25924         attribute types and also register it with the TypeManager.
25925
25926         (TypeContainer.Targets): The default for attribute types is
25927         AttributeTargets.All.
25928
25929         * attribute.cs (ApplyAttributes): Registering the attribute type
25930         is done elsewhere, not when we discover we have a Usage attribute.
25931
25932 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25933
25934         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25935         and get rid of is_delegate parameter.
25936
25937         * everywhere : update.
25938
25939 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25940
25941         * cs-parser.jay (compilation_unit): Revamp completely to use
25942         some new ideas that I got from Rhys' grammar to solve the problems
25943         with assembly level attributes.
25944
25945         (outer_declaration): New grammar production.
25946
25947         (attribute_sections): Add.
25948
25949         (opt_attributes): Base on attribute_sections
25950
25951         (namespace_declaration): Allow opt_attributes to tackle the case
25952         when we have assembly level attributes - we are clever in this
25953         regard now ;-)
25954
25955         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25956         attributes in the non-global context.
25957
25958         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25959         instead of SetGlobalAttributes.
25960
25961         * class.cs, rootcontext.cs : Ensure we define and generate 
25962         attribute types before anything else.
25963
25964         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25965         and flag the new error -20 for the case when the attribute type
25966         does not have valid targets specified. csc does not catch this.
25967
25968         * ../errors/errors.txt : update for error # -20
25969
25970 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25971
25972         * support.cs (InternalParameters.ParameterModifier): Do some null
25973         checking and return sane values.
25974
25975         * class.cs (Method.Define): If we are a PInvoke method, ensure
25976         that we are static and extern. Report error # 601
25977
25978         * ../errors/cs0601.cs : Add test case for the above error.
25979
25980 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25981
25982         * rootcontext.cs (attribute_types): We need to keep type of
25983         all attribute types separately and emit code for them first.
25984
25985         (RegisterAttribute) : Implement.
25986
25987         * class.cs (DefineType): Check if the current Type is a custom
25988         attribute type and register it accordingly.
25989
25990         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25991         adding the first attribute twice and rename to
25992
25993         (SetGlobalAttributes): this.
25994
25995         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25996         lookups.
25997
25998         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25999         if we are processing global arguments. Hmm, I am unsure of this.
26000
26001 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26002
26003         * expression.cs: added static array of strings to avoid calling
26004         Enum.ToString () for Operator in Binary. Significant recover of
26005         performance.
26006
26007 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
26008
26009         * class.cs (FindMembers): Allow the Builders of the various
26010         members to be null.  If they are skip them.  This only happens
26011         during the PInvoke declaration.
26012
26013 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
26014
26015         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
26016         failure, so we do not keep going afterwards.
26017
26018         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
26019         wanted to pass `false' as the `is_delegate' argument.  If this is
26020         the case, why not use delegate_type == null to mean `is_delegate =
26021         false' and anything else as is_delegate = true.
26022
26023 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
26024
26025         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
26026         code for the section, not the beginning of the tests.
26027
26028 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
26029
26030         * cfold.cs: Handle operator + (Enum x, Underlying x) 
26031
26032         * expression.cs (Binary): same.  Warn about errors where we have
26033         Enum/Enum in operator + as well.
26034
26035 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
26036
26037         * statement.cs:
26038                 - added support for switch(bool)
26039                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
26040                 - add TableSwitchEmit() to handle table-based switch statements
26041
26042 2002-04-05  Ravi Pratap  <ravi@ximian.com>
26043
26044         * expression.cs (Invocation.OverloadResolve): Factor out code which
26045         does parameter compatibility checking with arguments so that we can 
26046         re-use the code even from Delegate.VerifyApplicability
26047
26048         (VerifyArgumentsCompat): Move above code here.
26049
26050         * delegate.cs (VerifyApplicability): Get rid of duplicate code
26051         and instead make a call to the above method.
26052
26053 2002-03-31  Ravi Pratap  <ravi@ximian.com>
26054
26055         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
26056         We use it to keep track of classes which are attribute types.
26057
26058 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
26059
26060         * delegate.cs (Delegate.Define): Correctly define the types in the
26061         presence of fixed and array parameters.
26062
26063         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
26064         doing FindMembers.
26065
26066         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
26067         include NonPublic after the first iteration.
26068
26069         * class.cs (Indexer.CheckBase): Only check if both parents are
26070         non-null. 
26071
26072         * cs-parser.jay (accessor_body): If empty, set to null.
26073
26074         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
26075         same code path here to resolve constants names that we did have in
26076         MemberAccess.DoResolve.  There is too much code duplicated here.
26077
26078 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
26079
26080         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
26081
26082         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
26083         to MakeUnionSet.
26084
26085         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
26086         tokens, numbers and strings.
26087
26088         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26089         parenthesis.
26090
26091         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26092         asyncronous parameters and the regular parameters.  
26093
26094         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26095         specify the target directory.
26096
26097         * expression.cs: (This.DoResolve): Simplify
26098         (As.Emit): Optimize, do not generate IsInst if the expression is
26099         always of the given type.
26100
26101         (Is.DoResolve): Bug fix, we were reporting both always/never for
26102         the is expression.
26103
26104         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26105         creating too many unnecessary arrays.
26106
26107 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
26108
26109         * class.cs (EmitFieldInitializer): Use Assign expression to assign
26110         fields instead of rolling our own initializer.   Takes care of all
26111         implicit conversions, and drops unnecessary static checks/argument.
26112
26113 2002-03-31  Dick Porter  <dick@ximian.com>
26114
26115         * driver.cs: use the GetDirectories() return values properly, and
26116         use "/" as path separator.
26117
26118 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
26119
26120         * expression.cs (Unary): Optimize - - expr into expr.
26121         (Binary): Optimize a + (-b) into a -b.
26122
26123         * codegen.cs (CodeGen): Made all methods static.
26124
26125 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
26126
26127         * rootcontext.cs: 
26128
26129         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26130         TypeBuilder property.
26131
26132         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26133         instead. 
26134
26135         * tree.cs: Removed the various RecordXXXX, and replaced with a
26136         single RecordDecl.  Removed all the accessor methods, and just
26137         left a single access point Type 
26138
26139         * enum.cs: Rename DefineEnum to DefineType.
26140
26141         * decl.cs: New abstract method `DefineType' used to unify the
26142         Defines for Enumerations, Interfaces, TypeContainers and
26143         Delegates.
26144
26145         (FindType): Moved LookupInterfaceOrClass here.  Moved the
26146         LookupBaseClasses method that used to live in class.cs and
26147         interface.cs here, and renamed to FindType.
26148
26149         * delegate.cs: Implement DefineType.  Take advantage of the
26150         refactored pattern for locating the parent builder without taking
26151         the parent_builder argument (which we know does not work if we are
26152         nested, and triggering a toplevel definition).
26153
26154 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26155
26156         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26157         accessibility of a member has changed during override and report
26158         an error if so.
26159
26160         * class.cs (Method.Define, Property.Define): Only complain on
26161         overrides if the method is private, any other accessibility is
26162         fine (and since we just checked the permission is the same, we are
26163         good to go).
26164
26165         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26166         and elif are processed always.  The other pre-processing
26167         directives are only processed if we are "taking" the path
26168
26169 2002-03-29  Martin Baulig  <martin@gnome.org>
26170
26171         * class.cs (Method.Emit): Only emit symbolic debugging info if the
26172         current location is not Null.
26173
26174         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26175         a separate method so we can profile it.
26176
26177         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26178         `span.Seconds' are just seconds, but no minutes or hours.
26179         (MainDriver): Profile the CodeGen.SaveSymbols calls.
26180
26181 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26182
26183         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26184         Remove the gratuitous set of Final:
26185
26186                                 // If an interface implementation, then we can set Final.
26187                                 if (((flags & MethodAttributes.Abstract) == 0) &&
26188                                     implementing.DeclaringType.IsInterface)
26189                                         flags |= MethodAttributes.Final;
26190
26191         I do not know what I was smoking when I used that.
26192
26193
26194         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26195         step into fixing the name resolution issues for delegates and
26196         unifying the toplevel name resolution.
26197
26198 2002-03-28  Martin Baulig  <martin@gnome.org>
26199
26200         * class.cs (Method.Emit): If we have a symbol writer, call its
26201         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26202         tell it about the current method.
26203
26204         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26205         writer that we're going to emit the first byte of IL code for a new
26206         statement (a new source line).
26207         (EmitContext.EmitTopBlock): If we have a symbol writer, call
26208         EmitContext.Mark() before emitting any code.
26209
26210         * location.cs (SymbolDocument): Return null when we're Null.
26211
26212         * statement.cs (Statement): Moved the `Location loc' variable here.
26213         (Statement.EmitBoolExpression): If we have a symbol writer, call
26214         ec.Mark() before emitting any code to tell it that we're at the
26215         beginning of a new statement.
26216         (StatementExpression): Added `Location' argument to the constructor.
26217         (Block): Added public readonly variable `StartLocation' and public
26218         variable `EndLocation'.  The latter is to be set using SetEndLocation().
26219         (Block): Added constructor which takes a start and end location.
26220         (Block.SetEndLocation): New method. This sets the end location.
26221         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26222         local variables we create.
26223         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26224         each statement and do also mark the begin and end of the block.
26225
26226         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26227         tell it the current lexer.Location, use Location.Null for the end of the
26228         block.
26229         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26230         current block, set its end location using SetEndLocation().
26231         (statement_expression): StatementExpression constructor now takes the
26232         lexer.Location as additional argument.
26233         (for_statement, declare_local_variables): Likewise.
26234         (declare_local_variables): When creating a new implicit block, use the
26235         new Block constructor and pass it the lexer.Location.
26236
26237 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26238
26239         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26240         members also on the parent interfaces recursively.
26241
26242 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
26243
26244         * report.cs: Use new formats, since Gonzalo finished the missing
26245         bits. 
26246
26247         * expression.cs (Binary.ResolveOperator): added missing operator|
26248         operator& and operator^ for bool/bool.
26249
26250         * cs-parser.jay: CheckDef now takes a Location argument that is
26251         used to report errors more precisly (instead of reporting the end
26252         of a definition, we try to track something which is a lot closer
26253         to the source of the problem).
26254
26255         * cs-tokenizer.cs: Track global token use, so we can properly flag
26256         the use of #define/#undef after the first token has been seen.
26257
26258         Also, rename the reportXXXX to Error_DescriptiveName
26259
26260         * decl.cs (DeclSpace.IsTopLevel): Move property here from
26261         TypeContainer, so that Enum and Interface can use this too.
26262
26263         * class.cs (TypeContainer.LookupInterfaceOrClass,
26264         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26265         `builder' argument.  Typically this was used to pass the parent
26266         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26267         the definition).  
26268
26269         The problem is that a nested class could trigger the definition of
26270         a toplevel class, and the builder would be obviously wrong in that
26271         case. 
26272
26273         So we drop this argument, and we compute dynamically the
26274         TypeBuilder/ModuleBuilder (the correct information was available
26275         to us anyways from DeclSpace.Parent)
26276
26277         * interface.cs (Interface.DefineInterface): Drop builder
26278         parameter cleanup like class.cs
26279
26280         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
26281         like class.cs
26282
26283         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26284         values. 
26285
26286         (Try.Emit): Propagate the returns value from the statement.
26287
26288         (Return.Emit): Even if we are leavning 
26289
26290         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26291
26292         * modifiers.cs: Fix the computation of MethodAttributes flags.
26293
26294 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26295
26296         * driver.cs: allow compilation of files that start with '/'.
26297         Add a default case when checking the argument of --target.
26298
26299 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
26300
26301         * interface.cs: Implement the same search algorithm for types in
26302         the interface code.
26303
26304         * delegate.cs: Do not allow multiple definition.
26305
26306         * Recovered ChangeLog that got accidentally amputated
26307
26308         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26309
26310         * rootcontext.cs: Load manually enum to allow core classes to
26311         contain enumerations.
26312
26313         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26314         Update to new static methods in TypeManager.
26315
26316         * typemanager.cs (GetMethod, GetConstructor): Use our
26317         implementation of FindMembers to find the members, since during
26318         corlib compilation, the types are TypeBuilders and GetMethod and
26319         GetConstructor do not work.
26320
26321         Make all methods in TypeManager static.
26322
26323         (InitCodeHelpers): Split the functionality from
26324         the InitCodeTypes function.
26325
26326         * driver.cs: Call InitCodeHelpers after we have populated the
26327         types. 
26328
26329         * cs-parser.jay (delegate_declaration): we did not used to compute
26330         the delegate name correctly for void delegates.
26331
26332 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
26333
26334         * rootcontext.cs (RootContext): Init the interface_resolve_order
26335         and type_container_resolve_order always.
26336
26337         (ResolveCore, BootstrapCorlib_ResolveClass,
26338         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26339         compiler when compiling with --nostdlib
26340
26341         * class.cs (TypeContainer.DefineType): Check that our parent is
26342         not null.  This test is most important when we are bootstraping
26343         the core types.
26344
26345         * codegen.cs: Split out the symbol writing code.
26346
26347 2002-03-25  Martin Baulig  <martin@gnome.org>
26348
26349         * driver.cs (-g): Made -g an alias for --debug.
26350
26351 2002-03-24  Martin Baulig  <martin@gnome.org>
26352
26353         * codegen.cs (SymbolWriter): New public variable. Returns the
26354         current symbol writer.
26355         (CodeGen): Added `bool want_debugging_support' argument to the
26356          constructor. If true, tell the ModuleBuild that we want debugging
26357         support and ask it for the ISymbolWriter.
26358         (Save): If we have a symbol writer, call it's Close() method after
26359         saving the assembly.
26360
26361         * driver.c (--debug): New command line argument to create a
26362         debugger information file.
26363
26364         * location.cs (SymbolDocument): New public property. Returns an
26365         ISymbolDocumentWriter object for the current source file or null
26366         if we don't have a symbol writer.
26367
26368 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
26369
26370         * driver.cs (LoadAssembly): Correctly return when all the paths
26371         have been tried and not before.
26372
26373         * statement.cs (Switch.Emit): return the actual coverage for this
26374         statement (returns/not-returns)
26375
26376         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26377         switch of the statement if we are the last switch section.  That
26378         kills two problems: try/catch problems (we used to emit an empty
26379         nop at the end) and switch statements where all branches would
26380         return. 
26381
26382 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
26383
26384         * driver.cs: Add default assemblies (the equivalent to the
26385         Microsoft CSC.RSP file)
26386
26387         * cs-tokenizer.cs: When updating `cols and setting it to zero,
26388         also update tokens_seen and set it to false.
26389
26390         * driver.cs: Implement --recurse for Mike.
26391
26392         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26393         correctly splitting out the paths.
26394
26395 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
26396
26397         * interface.cs (Interface.PopulateProperty): Instead of using
26398         `parent' as the declaration space for the set parameters, use
26399         `this' 
26400
26401         * support.cs (InternalParameters): InternalParameters constructor
26402         takes a DeclSpace instead of a TypeContainer.
26403
26404         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26405         types are being initialized, load the address of it before calling
26406         the function.  
26407
26408         (New): Provide a mechanism to disable the generation of local
26409         value type temporaries when the caller will be providing us with
26410         an address to store it.
26411
26412         (ArrayCreation.EmitDynamicInitializers): Use it.
26413
26414 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
26415
26416         * expression.cs (Invocation.EmitArguments): Only probe for array
26417         property if there is more than one argument.  Sorry about that.
26418
26419         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26420         empty param arrays.
26421
26422         * class.cs (Method.LabelParameters): Fix incorrect code path that
26423         prevented the `ParamArrayAttribute' from being applied to the
26424         params attribute.
26425
26426 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
26427
26428         * support.cs (ReflectionParameters): Correctly compute whether the
26429         last argument is a params array.  Fixes the problem with
26430         string.Split ('a')
26431
26432         * typemanager.cs: Make the assemblies array always be non-null
26433         (empty, but non-null)
26434
26435         * tree.cs (RecordDecl): New function that abstracts the recording
26436         of names.  This reports error 101, and provides a pointer to the
26437         previous declaration.  Fixes a crash in the compiler.
26438
26439         * cs-parser.jay (constructor_declaration): Update to new grammar,
26440         and provide a constructor_body that can be empty.
26441
26442 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
26443
26444         * driver.cs: Add support for --resources.
26445
26446         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26447         Make all types for the various array helper methods be integer.
26448
26449         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26450         CheckState to ConvCast.
26451
26452         (ConvCast): Now it takes a `checked' state argument, to avoid
26453         depending on the emit context for the conversion, and just using
26454         the resolve time setting.
26455
26456         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26457         instead of Invocation.EmitArguments.  We do not emit the original
26458         arguments, instead we emit those which have been converted to
26459         unsigned int expressions.
26460
26461         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26462
26463         * codegen.cs: ditto.
26464
26465         * expression.cs (LocalVariableReference): Drop the use of the
26466         Store function that depended on the variable index.
26467
26468         * statement.cs (VariableInfo): Drop the `Idx' property from this
26469         class, as this is not taking into account the indexes for
26470         temporaries tat we generate during the execution, getting the
26471         indexes wrong.
26472
26473         * class.cs: First emit class initializers, then call the parent
26474         constructor. 
26475
26476         * expression.cs (Binary): Fix opcode emision.
26477         (UnaryMutator.EmitCode): Support checked code generation
26478
26479         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26480         matches for events for both the Static and Instance scans,
26481         pointing to the same element.   Fix that.
26482
26483 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
26484
26485         * rootcontext.cs (ResolveTree): Always set the
26486         interface_resolve_order, because nested interfaces will be calling
26487         into us.
26488
26489         * class.cs (GetInterfaceOrClass): Track the same resolution
26490         process used by TypeManager.LookupType.  This fixes the nested
26491         type lookups in class declarations (separate path from
26492         LookupType). 
26493
26494         (TypeContainer.DefineType): Also define nested interfaces.
26495         (TypeContainer.RegisterOrder): New public function used to
26496         register the order in which child interfaces need to be closed.
26497
26498         Nested interfaces need to be closed after their parents have been
26499         created. 
26500
26501         * interface.cs (InterfaceAttr): Put all the logic for computing
26502         the interface attribute here. 
26503
26504         (DefineInterface): Register our interface order with the
26505         RootContext or with the TypeContainer depending on the case.
26506
26507 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26508
26509         * cs-parser.jay: rework foreach statement to work with the new
26510         changes to the policy on SimpleNames.
26511
26512         * report.cs: support Stacktrace on warnings as well.
26513
26514         * makefile: drop --unsafe and /unsafe from the compile.
26515
26516 2002-03-13  Ravi Pratap  <ravi@ximian.com>
26517
26518         * ecore.cs (StandardConversionExists): Modify to take an Expression
26519         as the first parameter. Ensure we do null -> reference type conversion
26520         checking.
26521
26522         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26523         temporary Expression objects.
26524
26525 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26526
26527         * interface.cs: workaround bug in method overloading resolution
26528         (there is already a bugzilla bug for it).
26529
26530 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26531
26532         We could also solve this problem by having a separate path for
26533         performing type lookups, instead of DoResolve, we could have a
26534         ResolveType entry point, and only participating pieces of the
26535         production (simplename, deref, array) would implement this. 
26536
26537         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26538         signal SimpleName to only resolve type names and not attempt to
26539         resolve anything else.
26540
26541         * expression.cs (Cast): Set the flag.
26542
26543         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26544
26545         * class.cs: Only report 108 if there is no `new' modifier.
26546
26547         * cs-parser.jay: rework foreach statement to work with the new
26548         changes to the policy on SimpleNames.
26549
26550         * report.cs: support Stacktrace on warnings as well.
26551
26552         * makefile: drop --unsafe and /unsafe from the compile.
26553
26554 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
26555
26556         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26557         lookups here, instead of doing that at parse time.  This means
26558         that our grammar will not introduce `LocalVariableReferences' as
26559         expressions at this point.  That solves the problem of code like
26560         this:
26561
26562         class X {
26563            static void Main ()
26564            { int X = 1;
26565             { X x = null }}}
26566
26567         This is only half the fix.  The full fix requires parameters to
26568         also be handled in this way.
26569
26570         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26571         makes the use more obvious of the DeclSpace.  The
26572         ec.TypeContainer.TypeBuilder is now only used to pull the
26573         TypeBuilder for it.
26574
26575         My theory is that I can get rid of the TypeBuilder completely from
26576         the EmitContext, and have typecasts where it is used (from
26577         DeclSpace to where it matters).  
26578
26579         The only pending problem is that the code that implements Aliases
26580         is on TypeContainer, and probably should go in DeclSpace.
26581
26582         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26583         lookups here, instead of doing that at parse time.  This means
26584         that our grammar will not introduce `LocalVariableReferences' as
26585         expressions at this point.  That solves the problem of code like
26586         this:
26587
26588         class X {
26589            static void Main ()
26590            { int X = 1;
26591             { X x = null }}}
26592
26593         This is only half the fix.  The full fix requires parameters to
26594         also be handled in this way.
26595
26596         * class.cs (Property.DefineMethod): When implementing an interface
26597         method, set newslot, when implementing an abstract method, do not
26598         set the flag (before we tried never setting it, or always setting
26599         it, which is the difference).
26600         (Indexer.DefineMethod): same.
26601         (Method.DefineMethod): same.
26602
26603         * ecore.cs: Only set the status used flag if we get back a Field.
26604
26605         * attribute.cs: Temporary hack, so Paolo can keep working.
26606
26607 2002-03-08  Ravi Pratap  <ravi@ximian.com>
26608
26609         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26610         the unmanaged type in the case we have a MarshalAs attribute.
26611
26612         (Resolve): Handle the case when we are parsing the special MarshalAs
26613         attribute [we need to store the unmanaged type to use later]
26614
26615         * typemanager.cs (marshal_as_attr_type): Built in type for the 
26616         MarshalAs Attribute.
26617
26618         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
26619         on parameters and accordingly set the marshalling info.
26620
26621 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
26622
26623         * class.cs: Optimizing slightly by removing redundant code after
26624         we switched to the `NoTypes' return value.
26625         (Property.DefineMethod): use NoTypes here too.
26626
26627         This fixes the bug I introduced in my last batch of changes.
26628
26629 2002-03-05  Ravi Pratap  <ravi@ximian.com>
26630
26631         * tree.cs (RecordEnum): Add. We now keep track of enums too.
26632
26633         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26634         Enums since those are types too. 
26635
26636         * cs-parser.jay (enum_declaration): Record enums as we parse them.
26637
26638         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
26639         thanks to a call during the lookup process.
26640
26641 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
26642
26643         * statement.cs (Foreach): Lots of work to accomodate a particular
26644         kind of foreach statement that I had not kept in mind.  It is
26645         possible to have foreachs on classes that provide a GetEnumerator
26646         method that return objects that implement the "pattern" for using
26647         a foreach, there is no need to support GetEnumerator
26648         specifically. 
26649
26650         This is needed to compile nant.
26651
26652         * decl.cs: Only report 114 if the member is not `Finalize' and if
26653         the warning level is at least 2.
26654
26655         * class.cs: Moved the compare function from Method to
26656         MethodSignature. 
26657
26658         (MethodSignature.InheritableMemberSignatureCompare): Add new
26659         filter function that is used to extract inheritable methods from a
26660         class. 
26661
26662         (Method.Define): Use the new `inheritable_method_signature_filter'
26663         delegate
26664
26665         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26666         command. 
26667
26668 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
26669
26670         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26671
26672         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26673
26674         * expression.cs: Pass location information to
26675         ConvertImplicitStandard. 
26676
26677         * class.cs: Added debugging code to track return values from
26678         interfaces. 
26679
26680 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26681
26682         * expression.cs (Is.DoResolve): If either side of the `is' is an
26683         interface, do not flag the warning.
26684
26685         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26686         for interfaces
26687
26688         * report.cs: Allow for --fatal to be used with --probe.
26689
26690         * typemanager.cs (NoTypes): Move the definition for the empty Type
26691         array here. 
26692
26693         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26694         properties. 
26695         (TypeContainer.DefineProxy): New function used to proxy to parent
26696         implementations when implementing interfaces.
26697         (TypeContainer.ParentImplements): used to lookup if our parent
26698         implements a public function that is required by an interface.
26699         (TypeContainer.VerifyPendingMethods): Hook this up.
26700
26701         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26702         `modules' and `assemblies' arraylists into arrays.  We only grow
26703         these are the very early start up of the program, so this improves
26704         the speedof LookupType (nicely measured).
26705
26706         * expression.cs (MakeByteBlob): Replaced unsafe code with
26707         BitConverter, as suggested by Paolo.
26708
26709         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26710         folding of string concatenation, but if either side is a string,
26711         and the other is not, then return null, and let the runtime use
26712         the concatenation on the string plus the object (using
26713         `Object.ToString'). 
26714
26715 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26716
26717         Constant Folding has been implemented now.
26718
26719         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26720         the error instead on types that are not supported in one's
26721         complement. 
26722
26723         * constant.cs (Constant and all children): New set of functions to
26724         perform implict and explicit conversions.
26725
26726         * ecore.cs (EnumConstant): Implement the new functions to perform
26727         conversion by proxying to the child expression.
26728
26729         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26730         own separate setting that can not be turned off from the command
26731         line using --unchecked or --checked and is only controlled using
26732         the checked/unchecked statements and expressions.  This setting is
26733         used by the constant folder to flag errors.
26734
26735         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26736         ConstantCheckState as well.   
26737
26738         During Resolve, they also have to flag the state, because the
26739         constant folder runs completely in the Resolve phase.
26740
26741         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26742         well.
26743
26744 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26745
26746         * cfold.cs: New file, this file contains the constant folder.
26747
26748         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26749         argument to track whether we are using the resulting address to
26750         load or store a value and provide better error messages. 
26751
26752         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26753         new AddressOf arguments.
26754
26755         * statement.cs (Foreach.EmitCollectionForeach): Update
26756
26757         * expression.cs (Argument.Emit): Call AddressOf with proper
26758         arguments to track usage.
26759
26760         (New.DoEmit): Call AddressOf with new arguments.
26761
26762         (Unary.Emit): Adjust AddressOf call.
26763
26764 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26765
26766         * cs-parser.jay (member_access): Change the case for pre-defined types
26767         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26768         this suggestion.
26769
26770         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26771         a method body.
26772
26773         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26774         essentially like methods and apply attributes like MethodImplOptions to them too.
26775
26776         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26777         not being null.
26778
26779         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26780         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26781         is the DeclSpace.
26782
26783         * Update code everywhere accordingly.
26784
26785         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26786
26787         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26788
26789 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26790
26791         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26792         try performing lookups against those instead of jumping straight into using
26793         the 'using' clauses.
26794
26795         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26796
26797         (LookupType): Perform lookups in implicit parents too.
26798
26799         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26800         sequence as RootContext.LookupType. 
26801
26802         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26803         the various cases of namespace lookups into this method.
26804
26805 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26806
26807         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26808         in positional arguments)
26809
26810         * class.cs (Operator): Update the AllowedModifiers to contain
26811         extern. 
26812
26813         * cs-parser.jay: Update operator declaration to allow for the
26814         operator body to be empty.
26815
26816         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26817         values. 
26818
26819 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26820
26821         * class.cs (Method.Emit): Label parameters.
26822
26823         * driver.cs: Return 1 or 0 as the program exit code.
26824
26825 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26826
26827         * expression.cs: Special case the `null' object when trying to
26828         auto-compute the type, as anything can be explicitly converted to
26829         that. 
26830
26831         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26832         spotting this Paolo.
26833
26834         (Expression.ImplicitNumericConversion): Perform comparissions of
26835         the type using the underlying type in the case of an enumeration
26836         rather than using the enumeration type for the compare.
26837
26838         Cope with the underlying == type case, which is not possible to
26839         catch before. 
26840
26841         (Expression.ConvertNumericExplicit): Perform comparissions of
26842         the type using the underlying type in the case of an enumeration
26843         rather than using the enumeration type for the compare.
26844
26845         * driver.cs: If the user does not supply an extension, assume .exe
26846
26847         * cs-parser.jay (if_statement): Rewrote so that we can track the
26848         location for the if statement.
26849
26850         * expression.cs (Binary.ConstantFold): Only concat strings when
26851         the operation is "+", not everything ;-)
26852
26853         * statement.cs (Statement.EmitBoolExpression): Take a location
26854         argument. 
26855         (If, While, Do): Track location.
26856
26857         * expression.cs (Binary.ResolveOperator): In the object + string
26858         case, I was missing a call to ConvertImplicit
26859
26860 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26861
26862         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26863         Location arguments. Ensure we use RootContext.LookupType to do our work
26864         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26865
26866         * interface.cs (PopulateMethod): Handle the type of the parameter being
26867         null gracefully.
26868
26869         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26870         have a params method with no fixed arguments and a call is made with no
26871         arguments.
26872
26873 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26874
26875         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26876         the verbatim-string-literal
26877
26878         * support.cs (InternalParameters.ParameterModifier): handle null
26879         fixed parameters.
26880         (InternalParameters.ParameterType): ditto.
26881
26882         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26883         duplicating the name of the variable parameter.
26884         (GetParameterByName): Fix bug where we were not looking up array
26885         paramters if they were the only present (thanks Paolo!).
26886         (GetParameterInfo): We only have an empty set of types if both
26887         fixed and array are set to null.
26888         (GetParameterInfo-idx): Handle FixedParameter == null
26889
26890         * cs-parser.jay: Handle the case where there is no catch
26891         statements (missing null test).
26892
26893 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26894
26895         * driver.cs (MainDriver): Be conservative on our command line
26896         handling.
26897
26898         Catch DirectoryNotFoundException when calling GetFiles.
26899
26900         (SplitPathAndPattern): Used to split the input specification into
26901         a path and a pattern that we can feed to Directory.GetFiles.
26902
26903 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26904
26905         * statement.cs (Fixed): Implement the last case of the Fixed
26906         statement (string handling).
26907
26908         * expression.cs (StringPtr): New class used to return a char * to
26909         a string;  Used by the Fixed statement.
26910
26911         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26912
26913         * expression.cs (Binary.ResolveOperator): Remove redundant
26914         MemberLookup pn parent type.
26915         Optimize union call, we do not need a union if the types are the same.
26916         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26917         type.
26918
26919         Specialize the use of MemberLookup everywhere, instead of using
26920         the default settings. 
26921
26922         (StackAlloc): Implement stackalloc keyword.
26923
26924         * cs-parser.jay: Add rule to parse stackalloc.
26925
26926         * driver.cs: Handle /h, /help, /?
26927
26928         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26929         before we supported unsafe code.
26930
26931         * makefile: add --unsafe to the self compilation of mcs.
26932
26933 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26934
26935         * expression.cs (PointerArithmetic): New class that is used to
26936         perform pointer arithmetic.
26937         (Binary.Resolve): Handle pointer arithmetic
26938         Handle pointer comparission.
26939         (ArrayPtr): Utility expression class that is used to take the
26940         address of an array.
26941
26942         (ElementAccess): Implement array access for pointers
26943
26944         * statement.cs (Fixed): Implement fixed statement for arrays, we
26945         are missing one more case before we are done.
26946
26947         * expression.cs (Indirection): Implement EmitAssign and set the
26948         ExprClass to Variable.  This allows pointer dereferences to be
26949         treated as variables, and to have values assigned to them.
26950
26951         * ecore.cs (Expression.StoreFromPtr): New utility function to
26952         store values dereferencing.
26953
26954 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26955
26956         * expression.cs (Binary.ResolveOperator): Ensure that we are
26957         not trying to operate on a void type - this fixes the reported
26958         bug.
26959
26960         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26961         the parent implementation is sealed.
26962
26963         * ../errors/cs0239.cs : Add.
26964
26965         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26966
26967         * typemanager.cs (unverifiable_code_type): Corresponds to 
26968         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26969         which have unsafe code in them.
26970
26971         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26972         unsafe context.
26973
26974 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26975
26976         * cs-tokenizer.cs: Add support for @"litreal strings"
26977
26978         Make tokenizer accept pre-processor directives
26979         on any column (remove the old C-like limitation). 
26980
26981         * rootcontext.cs (EmitCode): Emit any global attributes.
26982         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26983
26984         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26985
26986         * cs-parser.jay: Add support for global attributes.  
26987
26988 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26989
26990         * expression.cs (Indirection): New helper class.  Unary will
26991         create Indirection classes to be able to implement the
26992         IMemoryLocation interface on it.
26993
26994 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26995
26996         * cs-parser.jay (fixed_statement): reference the right statement.
26997
26998         * statement.cs (Fixed.Emit): Finish implementing the fixed
26999         statement for the &x case.
27000
27001 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
27002
27003         * class.cs (Property.Define, Method.Define): Remove newslot when
27004         `implementing'.  
27005
27006         * modifiers.cs: My use of NewSlot when `Abstract' was set was
27007         wrong.  NewSlot should only be used if the `new' keyword is present.
27008
27009         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
27010         locating our system dir.  Sorry about this.
27011
27012 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
27013
27014         * driver.cs (GetSystemDir): Compute correctly the location of our
27015         system assemblies.  I was using the compiler directory instead of
27016         the library directory.
27017
27018 2002-02-13  Ravi Pratap  <ravi@ximian.com>
27019
27020         * expression.cs (BetterFunction): Put back in what Miguel commented out
27021         since it is the correct fix. The problem is elsewhere ;-)
27022
27023         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
27024         parameters of the parms method are themselves compatible or not !
27025
27026         (StandardConversionExists): Fix very dangerous bug where we were forgetting
27027         to check that a class implements an interface before saying that an implicit
27028         conversion was allowed. Use ImplementsInterface to do the checking.
27029
27030 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
27031
27032         * class.cs (Method.Define): Track whether we are an explicit
27033         implementation or not.  And only call DefineMethodOverride if we
27034         are an explicit implementation.
27035
27036         (Property.DefineMethod): Ditto.
27037
27038 2002-02-11  Ravi Pratap  <ravi@ximian.com>
27039
27040         * expression.cs (BetterFunction): Catch hideous bug which was
27041          preventing us from detecting ambiguous calls due to implicit casts i.e
27042         cs0121.
27043
27044 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
27045
27046         * support.cs (Pair): Remove un-needed method.  I figured why I was
27047         getting the error in cs-parser.jay, the variable in a foreach loop
27048         is readonly, and the compiler does not really treat this as a variable.
27049
27050         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
27051         instead of EQUALS in grammar.  
27052
27053         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
27054
27055         * expression.cs (Unary.DoResolve): Check whether the argument is
27056         managed or not.
27057
27058 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
27059
27060         * support.cs: Api for Pair to set a value.  Despite the fact that
27061         the variables are public the MS C# compiler refuses to compile
27062         code that accesses the field if the variable is part of a foreach
27063         statement. 
27064
27065         * statement.cs (Fixed): Begin implementation of the fixed
27066         statement.
27067
27068         (Block.AddVariable): Return the VariableInfo on success and null
27069         on failure instead of true/false. 
27070
27071         * cs-parser.jay (foreach): Catch errors on variables already
27072         defined (we were ignoring this value before) and properly unwind
27073         the block hierarchy
27074
27075         (fixed_statement): grammar for the fixed statement.
27076
27077 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
27078
27079         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
27080         pointer types to be incretemented.
27081
27082         (SizeOf): Implement.
27083
27084         * cs-parser.jay (pointer_member_access): Implement
27085         expr->IDENTIFIER production.
27086
27087         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
27088         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27089         on safe contexts.
27090
27091         (Unary): Implement indirection.
27092
27093         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27094         use in non-unsafe context).
27095
27096         (SimpleName.DoResolve): Check for pointers in field access on safe
27097         contexts. 
27098
27099         (Expression.LoadFromPtr): Factor the load-indirect code in this
27100         function.  This was duplicated in UnboxCast and ParameterReference
27101
27102 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
27103
27104         * expression.cs (ComposedCast): report an error if a pointer cast
27105         is used in a safe region.
27106
27107         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27108         pointer type casts in unsafe context.
27109
27110         * codegen.cs (EmitContext): Set up IsUnsafe.
27111
27112         * cs-parser.jay (non_expression_type): Add productions for pointer
27113         casts. 
27114
27115         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27116         code.  We should not use force into static mode if the method is
27117         not virtual.  Fixes bug in MIS
27118
27119         * statement.cs (Do.Emit, While.Emit, For.Emit,
27120         Statement.EmitBoolExpression): Add support to Do and While to
27121         propagate infinite loop as `I do return' semantics.
27122
27123         Improve the For case to also test for boolean constants.
27124
27125         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27126         to the list of attributes we can add.
27127
27128         Remove `EmitContext' argument.
27129
27130         * class.cs (Method.Define): Apply parameter attributes.
27131         (Constructor.Define): Apply parameter attributes.
27132         (MethodCore.LabelParameters): Move here the core of labeling
27133         parameters. 
27134
27135         * support.cs (ReflectionParameters.ParameterModifier,
27136         InternalParameters.ParameterModifier): Use IsByRef on the type and
27137         only return the OUT bit for these parameters instead of in/out/ref
27138         flags.
27139
27140         This is because I miss-understood things.  The ParameterInfo.IsIn
27141         and IsOut represent whether the parameter has the [In] and [Out]
27142         attributes set.  
27143
27144 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
27145
27146         * ecore.cs (FieldExpr.Emit): Release temporaries.
27147
27148         * assign.cs (LocalTemporary.Release): new function.
27149
27150         * codegen.cs (EmitContext.GetTemporaryStorage,
27151         EmitContext.FreeTemporaryStorage): Rework the way we deal with
27152         temporary storage.  Now we can "put back" localbuilders when we
27153         are done with them
27154
27155 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
27156
27157         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27158         need to make a copy of the variable to generate verifiable code.
27159
27160 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
27161
27162         * driver.cs: Compute dynamically the system directory.
27163
27164         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27165         Slower, but more generally useful.  Used by the abstract
27166         registering implementation. 
27167
27168         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27169         the rules for the special rule on Type/instances.  First check if
27170         we have the same name, and if so, try that special static path
27171         rather than the instance path.
27172
27173 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
27174
27175         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27176         for, while and if.
27177
27178         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27179         Enum, ValueType, Delegate or Array for non-corlib compiles.
27180
27181         * cs-tokenizer.cs: Catch long identifiers (645)
27182
27183         * typemanager.cs (IndexerPropetyName): Ravi never tested this
27184         piece of code.
27185
27186         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27187         fix, we were returning too early, so we were not registering
27188         pending methods from abstract classes.
27189
27190         Do not register pending methods if the class is abstract.
27191
27192         * expression.cs (Conditional.DoResolve): Report circular implicit
27193         conversions when we neecd to compute it for conditional
27194         expressions. 
27195
27196         (Is.DoResolve): If the expression is always of the provided type,
27197         flag warning 183.  If the expression can not ever be of the
27198         provided type flag warning 184.
27199
27200         * class.cs: Catch 169 as well.
27201
27202         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27203         read. 
27204
27205 2002-01-18  Nick Drochak  <ndrochak@gol.com>
27206
27207         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
27208
27209 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
27210
27211         * interface.cs: (PopulateMethod): Check for pointers being defined
27212         only if the unsafe context is active.
27213         (PopulateProperty): ditto.
27214         (PopulateIndexer): ditto.
27215
27216         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27217         specified.  If pointers are present, make sure that they are
27218         present in an unsafe context.
27219         (Constructor, Constructor.Define): ditto.
27220         (Field, Field.Define): ditto.
27221         (Property, Property.Define): ditto.
27222         (Event, Event.Define): ditto.
27223
27224         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27225         hashtable if there are classes or structs defined.
27226
27227         * expression.cs (LocalVariableReference.DoResolve): Simplify this
27228         code, as the constant resolution moved.
27229
27230         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27231         the metadata, so we can flag error 133. 
27232
27233         * decl.cs (MemberCore.UnsafeOK): New function to test that a
27234         pointer is being declared in an unsafe context.
27235
27236 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
27237
27238         * modifiers.cs (Modifiers.Check): Require a Location argument.
27239         Report error 227 for Unsafe use.
27240
27241         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27242
27243         * statement.cs (For.Emit): If the test is null, then report that
27244         we do `return', as we wont reach anything afterwards.
27245
27246         (Switch.SwitchGoverningType): Track the expression that matched
27247         the conversion.
27248
27249         * driver.cs: Allow negative numbers as an error code to flag.
27250
27251         * cs-parser.jay: Handle 1551.
27252
27253         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27254
27255 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27256
27257         * cs-parser.jay: Report 1518 (type declaration can only contain
27258         class, struct, interface, enum or delegate)
27259
27260         (switch_label): Report 1523 (keywords `case' or `default' must
27261         preced code)
27262
27263         (opt_switch_sections): Report 1522 (empty switch)
27264
27265         * driver.cs: Report 1515 (response file specified multiple times)
27266         Report 1516 (Source file specified multiple times).
27267
27268         * expression.cs (Argument.Resolve): Signal 1510
27269
27270         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27271         access not allowed in static code)
27272
27273 2002-01-11  Ravi Pratap  <ravi@ximian.com>
27274
27275         * typemanager.cs (IsPointerType): Utility method which we are going
27276         to need a lot.
27277
27278         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27279         the object type, so we take care of that.
27280
27281         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27282
27283         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27284         added to non-params parameters :-)
27285
27286         * typemanager.cs (CSharpName): Include 'void' type too. 
27287
27288         (void_ptr_type): Include in the set of core types.
27289
27290         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
27291         duplicating code.
27292
27293         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
27294         an unsafe context.
27295
27296         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
27297         completely forgotten about it.
27298
27299 2002-01-10  Ravi Pratap  <ravi@ximian.com>
27300
27301         * cs-parser.jay (pointer_type): Add. This begins our implementation
27302         of parsing rules for unsafe code.
27303
27304         (unsafe_statement): Implement.
27305
27306         (embedded_statement): Modify to include the above.
27307
27308         * statement.cs (Unsafe): Implement new class for unsafe blocks.
27309
27310         * codegen.cs (EmitContext.InUnsafe): Add. This determines
27311         if the current context is an unsafe one.
27312
27313         * cs-parser.jay (local_variable_pointer_type): Since local variable types
27314         are handled differently, we need separate rules for them.
27315
27316         (local_variable_declaration): Update to use local_variable_pointer_type
27317         to allow variable declarations of unmanaged pointer types.
27318
27319         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27320         in unsafe contexts.
27321
27322         * ../errors/cs0214.cs : Add.
27323
27324 2002-01-16  Nick Drochak  <ndrochak@gol.com>
27325
27326         * makefile: remove 'response' file when cleaning.
27327
27328 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27329
27330         * cs-parser.jay: Report 1524.
27331
27332 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
27333
27334         * typemanager.cs (RegisterMethod): drop checking if we have
27335         registered this from here
27336
27337 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
27338
27339         * class.cs (Method.EmitDestructor): Implement calling our base
27340         destructor. 
27341
27342         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27343         value of InFinally.
27344
27345         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27346         this routine and will wrap the call in a try/catch block.  Deal
27347         with the case.
27348
27349 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
27350
27351         * ecore.cs (Expression.MemberLookup): instead of taking a
27352         parameter `same_type' that was used to tell whether we could
27353         access private members we compute our containing type from the
27354         EmitContext.
27355
27356         (FieldExpr): Added partial support for volatile fields.  This does
27357         not work for volatile fields exposed from assemblies, as I can not
27358         figure out how to extract the modreq from it.
27359
27360         Updated all the source files to use this.
27361
27362         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27363         because it is referenced by MemberLookup very often. 
27364
27365 2002-01-09  Ravi Pratap  <ravi@ximian.com>
27366
27367         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27368         TypeBuilder.GetCustomAttributes to retrieve what we need.
27369
27370         Get rid of redundant default_member_attr_type as this is the same as
27371         default_member_type which already exists.
27372
27373         * interface.cs, attribute.cs : Update accordingly.
27374
27375 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
27376
27377         * typemanager.cs: Enable IndexerPropertyName again.  It does not
27378         work for TYpeBuilders though.  Ravi, can you please fix this?
27379
27380         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27381
27382         * expression.cs (Argument.Emit): Handle the case of ref objects
27383         being passed to ref functions;  
27384
27385         (ParameterReference.EmitLoad): Loads the content of the pointer
27386         without dereferencing.
27387
27388 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27389
27390         * cs-tokenizer.cs: Implemented the pre-processing expressions.
27391
27392 2002-01-08  Ravi Pratap  <ravi@ximian.com>
27393
27394         * class.cs (Indexer.DefineMethod): Incorporate the interface
27395         type in the name of the method if we are doing explicit interface
27396         implementation.
27397
27398         * expression.cs (ConversionExists): Remove as it is completely obsolete.
27399
27400         (BetterConversion): Fix extremely trivial bug where we were referring to
27401         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27402         again !
27403
27404         * ../errors/bug16.cs : Add although we have fixed it.
27405
27406 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27407
27408         * expression.cs (BaseIndexer): Begin implementation.
27409
27410         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27411
27412         * cs-parser.jay (indexer_declarator): Use qualified_identifier
27413         production directly to remove a shift/reduce, and implement
27414         explicit interface implementation.
27415
27416         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27417         after a floating point suffix.
27418
27419         * expression.cs (DoNumericPromotions): Improved the conversion for
27420         uint/uint.  If we have a constant, we avoid doing a typecast to a
27421         larger type.
27422
27423         * class.cs (Indexer): Implement explicit interface implementation
27424         for indexers.
27425
27426 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27427
27428         * class.cs: make the default instance constructor public and hidebysig.
27429
27430 2001-01-03  Ravi Pratap  <ravi@ximian.com>
27431
27432         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27433         so we can call it from elsewhere.
27434
27435         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27436         we emit it internally if the class has a defined indexer; otherwise the user
27437         emits it by decorating the class definition with the DefaultMemberAttribute.
27438
27439         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27440         attribute is not used on a type which defines an indexer.
27441
27442         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27443         character when we skip whitespace.
27444
27445         * ../errors/cs0646.cs : Add.
27446
27447 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
27448
27449         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27450         again. 
27451
27452         * makefile: Add practical target `mcs3.exe' which builds the third
27453         generation compiler. 
27454
27455         * expression.cs (New): Fix structures constructor calling.
27456
27457         * class.cs (Property, Method, Indexer): Emit Final flag on the
27458         method if we are an interface implementation and we are not
27459         abstract. 
27460
27461         * ecore.cs (PropertyExpr): New public field `IsBase', tells
27462         whether this property is referencing a `base' method.
27463
27464         * expression.cs (Invocation.EmitCall): take an extra argument:
27465         is_base, this is used to determine whether the `call' or
27466         `callvirt' opcode should be used.
27467
27468
27469         * delegate.cs: update EmitCall.
27470
27471         * class.cs (Method.Define): Set NewSlot for the cases where we are
27472         not implementing an interface method.
27473
27474         (Property.Define): ditto.
27475
27476 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
27477
27478         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27479         'r'.  Allows mcs to parse itself fully.
27480
27481 2002-01-02  Ravi Pratap  <ravi@ximian.com>
27482
27483         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27484         of the number of initializers that require the InitializeArray method.
27485
27486         (CheckIndices): Store the Expression in all cases - not the plain value. Also
27487         update the above field where necessary.
27488
27489         (MakeByteBlob): Update accordingly.
27490
27491         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
27492         greater than 2.
27493
27494         (EmitDynamicInitializers): Update in accordance with the new optimization.
27495
27496         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27497         same OpCode applies.
27498
27499         * cs-parser.jay : Fix some glaring errors I introduced.
27500
27501 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
27502
27503         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27504         so that we can check for name clashes there too.
27505
27506         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27507         for interface indexers.
27508
27509         * interfaces.cs (Define): Emit the default member attribute.
27510
27511         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27512         variable was being referred to while setting the value ;-)
27513
27514 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
27515
27516         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27517         byte-by-byte information when we know the data is zero.
27518
27519         Make the block always a multiple of 4, because
27520         DefineInitializedData has a bug.
27521
27522         * assign.cs: Fix, we should assign from the temporary, not from
27523         the source. 
27524
27525         * expression.cs (MakeByteBlob): Fix my incorrect code.
27526
27527 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
27528
27529         * typemanager.cs (EnumToUnderlying): This function is used to get
27530         the underlying type from an enumeration, because it does not
27531         always work. 
27532
27533         * constant.cs: Use the I4_S form for values between -128 and 127.
27534
27535         * statement.cs (Block.LookupLabel): Looks up a label.
27536         (Block): Drop support for labeled blocks.
27537
27538         (LabeledStatement): New kind of statement that represents a label
27539         only.
27540
27541         (Goto): Finally implement this bad boy.
27542
27543         * cs-parser.jay: Update to reflect new mechanism to implement
27544         labels.
27545
27546 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
27547
27548         * codegen.cs (EmitContext.This): a codegen property that keeps the
27549         a single instance of this instead of creating many different this
27550         instances. 
27551
27552         * delegate.cs (Delegate.DoResolve): Update to use the property;
27553
27554         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27555
27556         * expression.cs (BaseAccess.DoResolve): Ditto.
27557
27558 2001-12-29  Ravi Pratap  <ravi@ximian.com>
27559
27560         * typemanager.cs (methodimpl_attr_type): Add to hold the type
27561         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27562
27563         (InitCoreTypes): Update accordingly.
27564
27565         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27566         so we can quickly store the state.
27567
27568         (ApplyAttributes): Set the correct implementation flags
27569         for InternalCall methods.
27570
27571 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
27572
27573         * expression.cs (EmitCall): if a method is not virtual, then do
27574         not use callvirt on it.
27575
27576         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27577         user defined stuff) requires the use of stobj, which takes an
27578         address on the stack instead of an array and an index.  So emit
27579         the Ldelema operation for it.
27580
27581         (EmitStoreOpcode): Use stobj for valuetypes.
27582
27583         (UnaryMutator.EmitCode): Use the right 1 value depending on
27584         whether we are dealing with int64/uint64, float or doubles.
27585
27586         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27587         constructors that I implemented last night.
27588
27589         (Constructor.IsDefault): Fix to work properly for static
27590         constructors.
27591
27592         * cs-parser.jay (CheckDef): report method signature errors.
27593         Update error number 103 to be 132.
27594
27595         * decl.cs: New AdditionResult enumeration value: MethodExists.
27596         Although we do this check for methods later on in the semantic
27597         analysis, catching repeated default constructors is so easy that
27598         we catch these here. 
27599
27600         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27601         promotions code.
27602
27603         (ParameterReference.EmitAssign, Emit): handle
27604         bools as bytes.
27605
27606         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27607         (ArrayAccess.EmitStoreOpcode): ditto.
27608
27609         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27610
27611         * expression.cs (MakeByteBlob): Complete all the missing types
27612         (uint, short, ushort, byte, sbyte)
27613
27614         * class.cs: Only init instance field initializers on instance
27615         constructors. 
27616
27617         Rename `constructors' to instance_constructors. 
27618
27619         (TypeContainer.AddConstructor): Only add constructors to the list
27620         if it is not static.
27621
27622         Make sure that we handle default_static_constructor independently
27623         everywhere where we handle instance_constructors
27624
27625 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
27626
27627         * class.cs: Do not lookup or create a base initializer for a
27628         static constructor.
27629
27630         (ConstructorInitializer.Resolve): use the proper type to lookup
27631         for constructors.
27632
27633         * cs-parser.jay: Report error 1585 (modifiers between type and name).
27634
27635         * enum.cs, interface.cs: Remove CloseType, this is taken care by
27636         in DeclSpace. 
27637
27638         * decl.cs: CloseType is now an virtual method, the default
27639         implementation just closes this type.
27640
27641 2001-12-28  Ravi Pratap  <ravi@ximian.com>
27642
27643         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27644         to PreserveSig by default. Also emit HideBySig on such methods.
27645
27646         Basically, set the defaults to standard values.
27647
27648         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27649         argument, if candidate is better, it can't be worse than the best !
27650
27651         (Invocation): Re-write bits to differentiate between methods being
27652         applicable in their expanded form and their normal form - for params
27653         methods of course.
27654
27655         Get rid of use_standard everywhere as only standard conversions are allowed
27656         in overload resolution. 
27657
27658         More spec conformance.
27659
27660 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27661
27662         * driver.cs: Add --timestamp, to see where the compiler spends
27663         most of its time.
27664
27665         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27666         `this' in static code.
27667
27668         (SimpleName.DoResolve): Implement in terms of a helper function
27669         that allows static-references to be passed upstream to
27670         MemberAccess.
27671
27672         (Expression.ResolveWithSimpleName): Resolve specially simple
27673         names when called by MemberAccess to implement the special
27674         semantics. 
27675
27676         (Expression.ImplicitReferenceConversion): Handle conversions from
27677         Null to reference types before others, as Null's type is
27678         System.Object. 
27679
27680         * expression.cs (Invocation.EmitCall): Handle the special case of
27681         calling methods declared on a reference type from a ValueType
27682         (Base classes System.Object and System.Enum)
27683
27684         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27685         the left hand side is a TypeExpr, not on every enumeration. 
27686
27687         (Binary.Resolve): If types are reference types, then do a cast to
27688         object on operators != and == of both arguments.
27689
27690         * typemanager.cs (FindMembers): Extract instance and static
27691         members if requested.
27692
27693         * interface.cs (PopulateProperty): Use void_type instead of null
27694         as the return type for the setter method.
27695
27696         (PopulateIndexer): ditto.
27697
27698 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27699
27700         * support.cs (ReflectionParameters): Fix minor bug where we
27701         were examining the wrong parameter for the ParamArray attribute.
27702
27703         Cope with requests for the type of the parameter at position
27704         greater than the params parameter's. We now return the element
27705         type of the params array as that makes more sense.
27706
27707         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27708         accordingly as we no longer have to extract the element type
27709         ourselves.
27710
27711         (Invocation.OverloadResolve): Update.
27712
27713 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27714
27715         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27716         against IEnumerator, test whether the return value is a descendant
27717         of the IEnumerator interface.
27718
27719         * class.cs (Indexer.Define): Use an auxiliary method to implement
27720         the other bits of the method definition.  Begin support for
27721         explicit interface implementation.
27722
27723         (Property.DefineMethod): Use TypeManager.void_type instead of null
27724         for an empty return value.
27725
27726 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27727
27728         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27729         dealing with a FieldExpr which is composed of a FieldBuilder, in
27730         the code path we did extract the constant, but we should have
27731         obtained the underlying value to be able to cast it (otherwise we
27732         end up in an infinite loop, this is what Ravi was running into).
27733
27734         (ArrayCreation.UpdateIndices): Arrays might be empty.
27735
27736         (MemberAccess.ResolveMemberAccess): Add support for section
27737         14.5.4.1 that deals with the special case of E.I when E is a type
27738         and something else, that I can be a reference to a static member.
27739
27740         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27741         handle a particular array type to create byte blobs, it is just
27742         something we dont generate byteblobs for.
27743
27744         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27745         arguments. 
27746
27747         * location.cs (Push): remove the key from the hashtable that we
27748         are about to add.   This happens for empty files.
27749
27750         * driver.cs: Dispose files after we have parsed them.
27751
27752         (tokenize): new function that only runs the tokenizer on its
27753         input, for speed testing.
27754
27755 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27756
27757         * class.cs (Event.Define): Define the private field only if there
27758         are no accessors defined.
27759
27760         * expression.cs (ResolveMemberAccess): If there is no associated
27761         field with the event, that means we have an event defined with its
27762         own accessors and we should flag error cs0070 since transforming
27763         ourselves into a field is not valid in that case.
27764
27765         * ecore.cs (SimpleName.DoResolve): Same as above.
27766
27767         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27768         and charset to sane values.
27769
27770 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27771
27772         * assign.cs (DoResolve): Perform check on events only if they 
27773         are being accessed outside the declaring type.
27774
27775         * cs-parser.jay (event_declarations): Update rules to correctly
27776         set the type of the implicit parameter etc.
27777
27778         (add_accessor, remove_accessor): Set current local parameters.
27779
27780         * expression.cs (Binary): For delegate addition and subtraction,
27781         cast the return value from the method into the appropriate delegate
27782         type.
27783
27784 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27785
27786         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27787         of these as the workaround is unnecessary.
27788
27789         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27790         delegate data - none of that is needed at all.
27791
27792         Re-write bits to extract the instance expression and the delegate method
27793         correctly.
27794
27795         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27796         on delegates too.
27797
27798         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27799         of attaching attributes instead of duplicating code everywhere.
27800
27801         * everywhere : Update code to do attribute emission using the above method.
27802
27803 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27804
27805         * expression.cs (IsParamsMethodApplicable): if there are not
27806         parameters, return immediately.
27807
27808         * ecore.cs: The 0 literal can be implicity converted to an enum
27809         type. 
27810
27811         (SimpleName.DoResolve): First lookup the type, then lookup the
27812         members. 
27813
27814         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27815         want to get its address.  If the InstanceExpression is not
27816         addressable, store the result in a temporary variable, then get
27817         the address of it.
27818
27819         * codegen.cs: Only display 219 errors on warning level or above. 
27820
27821         * expression.cs (ArrayAccess): Make it implement the
27822         IMemoryLocation interface.
27823
27824         (Binary.DoResolve): handle the operator == (object a, object b)
27825         and operator != (object a, object b) without incurring into a
27826         BoxedCast (because 5 != o should never be performed).
27827
27828         Handle binary enumerator operators.
27829
27830         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27831         value type, otherwise use Ldelem_ref.
27832
27833         Use precomputed names;
27834
27835         (AddressOf): Implement address of
27836
27837         * cs-parser.jay (labeled_statement): Fix recursive block
27838         addition by reworking the production.
27839
27840         * expression.cs (New.DoEmit): New has a special case:
27841                 
27842                  If we are dealing with a ValueType, we have a few
27843                  situations to deal with:
27844                 
27845                     * The target of New is a ValueType variable, that is
27846                       easy, we just pass this as the variable reference
27847                 
27848                     * The target of New is being passed as an argument,
27849                       to a boxing operation or a function that takes a
27850                       ValueType.
27851                 
27852                       In this case, we need to create a temporary variable
27853                       that is the argument of New.
27854
27855
27856 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27857
27858         * rootcontext.cs (LookupType): Check that current_type is not null before
27859         going about looking at nested types.
27860
27861         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27862         not implement the IAssignMethod interface any more.
27863
27864         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27865         where we tranform them into FieldExprs if they are being resolved from within
27866         the declaring type.
27867
27868         * ecore.cs (SimpleName.DoResolve): Do the same here.
27869
27870         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27871
27872         * ../errors/bug10.cs : Add.
27873
27874         * ../errors/cs0070.cs : Add.
27875
27876         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27877
27878         * assign.cs : Get rid of EventIsLocal everywhere.
27879
27880 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27881
27882         * ecore.cs (ConvertIntLiteral): finished the implementation.
27883
27884         * statement.cs (SwitchLabel): Convert the value we are using as a
27885         key before looking up the table.
27886
27887 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27888
27889         * codegen.cs (EmitTopBlock): Require a Location argument now.
27890
27891         * cs-parser.jay (constructor_declarator): We need to setup
27892         current_local_parameters before we parse the
27893         opt_constructor_initializer, to allow the variables to be bound
27894         to the constructor arguments.
27895
27896         * rootcontext.cs (LookupType): First lookup nested classes in our
27897         class and our parents before we go looking outside our class.
27898
27899         * expression.cs (ConstantFold): Extract/debox the values at the
27900         beginnning. 
27901
27902         * rootcontext.cs (EmitCode): Resolve the constants first before we
27903         resolve the types.  This is not really needed, but it helps debugging.
27904
27905         * statement.cs: report location.
27906
27907         * cs-parser.jay: pass location to throw statement.
27908
27909         * driver.cs: Small bug fix.
27910
27911         * report.cs: Updated format to be 4-zero filled digits.
27912
27913 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27914
27915         * expression.cs (CheckIndices): Fix minor bug where the wrong
27916         variable was being referred to ;-)
27917
27918         (DoEmit): Do not call EmitStaticInitializers when the 
27919         underlying type is System.Object.
27920
27921 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27922
27923         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27924         and do the usual workaround for SRE.
27925
27926         * class.cs (MyEventBuilder.EventType): New member to get at the type
27927         of the event, quickly.
27928
27929         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27930
27931         * assign.cs (Assign.DoResolve): Handle the case when the target
27932         is an EventExpr and perform the necessary checks.
27933
27934         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27935         interface.
27936
27937         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27938
27939         (EventExpr): Set the type in the constructor itself since we 
27940         are meant to be born fully resolved.
27941
27942         (EventExpr.Define): Revert code I wrote earlier.
27943                 
27944         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27945         instance expression is null. The instance expression is a This in that case
27946         or a null, depending on whether it is a static method or not.
27947
27948         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27949         refers to more than one method.
27950
27951         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27952         and accordingly flag errors.
27953
27954 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27955
27956         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27957
27958 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27959
27960         * location.cs (ToString): Provide useful rutine.
27961
27962 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27963
27964         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27965         objects, return the actual integral boxed.
27966
27967         * statement.cs (SwitchLabel): define an ILLabel for each
27968         SwitchLabel. 
27969
27970         (Switch.CheckSwitch): If the value is a Literal, extract
27971         the underlying literal.
27972
27973         Also in the unused hashtable we had, add the SwitchLabel so we can
27974         quickly look this value up.
27975
27976         * constant.cs: Implement a bunch of new constants.  Rewrite
27977         Literal based on this.  Made changes everywhere to adapt to this.
27978
27979         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27980         dereferencing array only once, and also copes with enumrations.
27981
27982         bytes are two bytes wide, not one.
27983
27984         (Cast): Perform constant conversions.
27985
27986         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27987         wrappers to the literals here.
27988
27989         * expression.cs (DoNumericPromotions): long literals can converted
27990         to ulong implicity (this is taken care of elsewhere, but I was
27991         missing this spot).
27992
27993         * ecore.cs (Expression.Literalize): Make the return type Literal,
27994         to improve type checking.
27995
27996         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27997
27998 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27999
28000         * literal.cs: Revert code from ravi that checked the bounds.  The
28001         bounds are sane by the definition of the type itself. 
28002
28003         * typemanager.cs: Fix implementation of ImplementsInterface.  We
28004         need to actually look up in our parent hierarchy for interfaces
28005         implemented. 
28006
28007         * const.cs: Use the underlying type for enumerations
28008
28009         * delegate.cs: Compute the basename for the delegate creation,
28010         that should fix the delegate test case, and restore the correct
28011         Type Lookup semantics in rootcontext
28012
28013         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
28014         referencing a nested type with the Reflection API is using the "+"
28015         sign. 
28016
28017         * cs-parser.jay: Do not require EOF token at the end.
28018
28019 2001-12-20  Ravi Pratap  <ravi@ximian.com>
28020
28021         * rootcontext.cs (LookupType): Concatenate type names with
28022         a '.' instead of a '+' The test suite passes again.
28023
28024         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
28025         field of the enumeration.
28026
28027         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
28028         the case when the member is an EventExpr.
28029
28030         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
28031         static has an associated instance expression.
28032
28033         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
28034
28035         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
28036
28037         * class.cs (Event.Define): Register event and perform appropriate checks
28038         for error #111.
28039
28040         We define the Add and Remove methods even if the use provides none because
28041         in that case, we provide default implementations ourselves.
28042
28043         Define a private field of the type of the event. This is done by the CSC compiler
28044         and we should be doing it too ;-)
28045
28046         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
28047         More methods we use in code we generate.
28048
28049         (multicast_delegate_type, delegate_type): Two separate types since the distinction
28050         is important.
28051
28052         (InitCoreTypes): Update accordingly for the above.
28053
28054         * class.cs (Event.Emit): Generate code for default accessors that we provide
28055
28056         (EmitDefaultMethod): Do the job in the above.
28057
28058         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
28059         appropriate place.
28060
28061 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
28062
28063         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
28064         builders even if we were missing one.
28065
28066         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
28067         pass the Basename as our class name instead of the Name.  The
28068         basename will be correctly composed for us.
28069
28070         * parameter.cs (Paramters): Now takes a Location argument.
28071
28072         * decl.cs (DeclSpace.LookupType): Removed convenience function and
28073         make all the code call directly LookupType in RootContext and take
28074         this chance to pass the Location information everywhere.
28075
28076         * Everywhere: pass Location information.
28077
28078 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
28079
28080         * class.cs (Constructor.Define): Updated way of detecting the
28081         length of the parameters.
28082
28083         (TypeContainer.DefineType): Use basename as the type name for
28084         nested types.
28085
28086         (TypeContainer.Define): Do not recursively define types here, as
28087         definition is taken care in order by the RootContext.
28088
28089         * tree.cs: Keep track of namespaces in a per-file basis.
28090
28091         * parameter.cs (Parameter.ComputeSignature): Update to use
28092         DeclSpace. 
28093
28094         (Parameters.GetSignature): ditto.
28095
28096         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28097         instead of a TypeContainer.
28098
28099         (Interface.SemanticAnalysis): Use `this' instead of our parent to
28100         resolve names.  Because we need to be resolve in our context, not
28101         our parents.
28102
28103         * driver.cs: Implement response files.
28104
28105         * class.cs (TypeContainer.DefineType): If we are defined, do not
28106         redefine ourselves.
28107
28108         (Event.Emit): Emit the code for add/remove handlers.
28109         (Event.Define): Save the MethodBuilders for add/remove.
28110
28111         * typemanager.cs: Use pair here too.
28112
28113         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28114         DictionaryEntry requires the first argument to be non-null.  
28115
28116         (enum_declaration): Compute full name for registering the
28117         enumeration.
28118
28119         (delegate_declaration): Instead of using
28120         formal_parameter_list, use opt_formal_parameter_list as the list
28121         can be empty.
28122
28123         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28124         (EventParsing): New property that controls whether `add' and
28125         `remove' are returned as tokens or identifiers (for events);
28126
28127 2001-12-19  Ravi Pratap  <ravi@ximian.com>
28128
28129         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28130         use MyEventBuilder only and let it wrap the real builder for us.
28131
28132         (MyEventBuilder): Revamp constructor etc.
28133
28134         Implement all operations that we perform on EventBuilder in precisely the same
28135         way here too.
28136
28137         (FindMembers): Update to use the EventBuilder member.
28138
28139         (Event.Emit): Update accordingly.
28140
28141 2001-12-18  Ravi Pratap  <ravi@ximian.com>
28142
28143         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28144         by calling the appropriate methods.
28145
28146         (GetCustomAttributes): Make stubs as they cannot possibly do anything
28147         useful.
28148
28149         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28150
28151 2001-12-17  Ravi Pratap  <ravi@ximian.com>
28152
28153         * delegate.cs (Delegate.Populate): Check that the return type
28154         and various parameters types are indeed accessible.
28155
28156         * class.cs (Constructor.Define): Same here.
28157
28158         (Field.Define): Ditto.
28159
28160         (Event.Define): Ditto.
28161
28162         (Operator.Define): Check that the underlying Method defined itself
28163         correctly - so it's MethodBuilder should not be null.
28164
28165         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28166         expression happens to be null.
28167
28168         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28169         members but as of now we don't seem to be able to do anything really useful with it.
28170
28171         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28172         not the EventBuilder.
28173
28174 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
28175
28176         * cs-tokenizer.cs: Add support for defines.
28177         Add support for #if, #elif, #else, #endif
28178
28179         (eval_var): evaluates a variable.
28180         (eval): stubbed for evaluating functions.
28181
28182         * cs-parser.jay: Pass the defines information
28183
28184         * driver.cs: Add --define command line option.
28185
28186         * decl.cs: Move MemberCore here.
28187
28188         Make it the base class for DeclSpace.  This allows us to catch and
28189         report 108 and 109 for everything now.
28190
28191         * class.cs (TypeContainer.Define): Extract all the members
28192         before populating and emit the warning 108 (new keyword required
28193         to override) instead of having each member implement this.
28194
28195         (MemberCore.Define): New abstract method, we will be using this in
28196         the warning reporting engine in Populate.
28197
28198         (Operator.Define): Adjust to new MemberCore protocol. 
28199
28200         * const.cs (Const): This does not derive from Expression, it is a
28201         temporary object we use to create fields, it is a MemberCore. 
28202
28203         * class.cs (Method.Define): Allow the entry point to be in a
28204         specific class.
28205
28206         * driver.cs: Rewrite the argument handler to clean it up a bit.
28207
28208         * rootcontext.cs: Made it just an auxiliary namespace feature by
28209         making everything static.
28210
28211         * driver.cs: Adapt code to use RootContext type name instead of
28212         instance variable.
28213
28214         * delegate.cs: Remove RootContext argument.
28215
28216         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28217         argument. 
28218
28219         * class.cs (Event.Define): The lookup can fail.
28220
28221         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
28222
28223         * expression.cs: Resolve the this instance before invoking the code.
28224
28225 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
28226
28227         * cs-parser.jay: Add a production in element_access that allows
28228         the thing to become a "type" reference.  This way we can parse
28229         things like "(string [])" as a type.
28230
28231         Note that this still does not handle the more complex rules of
28232         casts. 
28233
28234
28235         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
28236
28237         * ecore.cs: (CopyNewMethods): new utility function used to
28238         assemble the list of methods from running FindMembers.
28239
28240         (MemberLookup): Rework FindMembers so that 
28241
28242 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
28243
28244         * class.cs (TypeContainer): Remove Delegates who fail to be
28245         defined.
28246
28247         * delegate.cs (Populate): Verify that we dont get null return
28248         values.   TODO: Check for AsAccessible.
28249
28250         * cs-parser.jay: Use basename to emit error 574 (destructor should
28251         have the same name as container class), not the full name.
28252
28253         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28254         possible representation.  
28255
28256         Also implements integer type suffixes U and L.
28257
28258 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
28259
28260         * expression.cs (ArrayCreation.DoResolve): We need to do the
28261         argument resolution *always*.
28262
28263         * decl.cs: Make this hold the namespace.  Hold the root context as
28264         well.
28265         (LookupType): Move here.
28266
28267         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28268
28269         * location.cs (Row, Name): Fixed the code, it was always returning
28270         references to the first file.
28271
28272         * interface.cs: Register properties defined through interfaces.
28273
28274         * driver.cs: Add support for globbing on the command line
28275
28276         * class.cs (Field): Make it derive from MemberCore as well.
28277         (Event): ditto.
28278
28279 2001-12-15  Ravi Pratap  <ravi@ximian.com>
28280
28281         * class.cs (Event::Define): Check that the type of the event is a delegate
28282         type else flag error #66.
28283
28284         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28285         same.
28286
28287         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28288         values of EntryPoint, CharSet etc etc.
28289
28290         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28291
28292         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28293         be null and we should ignore this. I am not sure if this is really clean. Apparently,
28294         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28295         which needs this to do its work.
28296
28297         * ../errors/cs0066.cs : Add.
28298
28299 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
28300
28301         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28302         helper functions.
28303
28304         * class.cs: (MethodSignature.MethodSignature): Removed hack that
28305         clears out the parameters field.
28306         (MemberSignatureCompare): Cleanup
28307
28308         (MemberCore): New base class used to share code between MethodCore
28309         and Property.
28310
28311         (RegisterRequiredImplementations) BindingFlags.Public requires
28312         either BindingFlags.Instace or Static.  Use instance here.
28313
28314         (Property): Refactored code to cope better with the full spec.
28315
28316         * parameter.cs (GetParameterInfo): Return an empty array instead
28317         of null on error.
28318
28319         * class.cs (Property): Abstract or extern properties have no bodies.
28320
28321         * parameter.cs (GetParameterInfo): return a zero-sized array.
28322
28323         * class.cs (TypeContainer.MethodModifiersValid): Move all the
28324         method modifier validation to the typecontainer so we can reuse
28325         this on properties.
28326
28327         (MethodCore.ParameterTypes): return an empty sized array of types.
28328
28329         (Property.Define): Test property modifier validity.
28330
28331         Add tests for sealed/override too.
28332
28333         (Method.Emit): abstract or extern methods have no bodies.
28334
28335 2001-12-14  Ravi Pratap  <ravi@ximian.com>
28336
28337         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28338         thing.
28339
28340         (Method::Define, ::Emit): Modify accordingly.
28341
28342         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28343
28344         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28345
28346         * makefile: Pass in /unsafe.
28347
28348 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
28349
28350         * class.cs (MakeKey): Kill routine.
28351
28352         * class.cs (TypeContainer.Define): Correctly define explicit
28353         method implementations (they require the full interface name plus
28354         the method name).
28355
28356         * typemanager.cs: Deply the PtrHashtable here and stop using the
28357         lame keys.  Things work so much better.
28358
28359         This of course broke everyone who depended on `RegisterMethod' to
28360         do the `test for existance' test.  This has to be done elsewhere.
28361
28362         * support.cs (PtrHashtable): A hashtable that avoid comparing with
28363         the object stupid Equals method (because, that like fails all over
28364         the place).  We still do not use it.
28365
28366         * class.cs (TypeContainer.SetRequiredInterface,
28367         TypeContainer.RequireMethods): Killed these two routines and moved
28368         all the functionality to RegisterRequiredImplementations.
28369
28370         (TypeContainer.RegisterRequiredImplementations): This routine now
28371         registers all the implementations required in an array for the
28372         interfaces and abstract methods.  We use an array of structures
28373         which can be computed ahead of time to reduce memory usage and we
28374         also assume that lookups are cheap as most classes will not
28375         implement too many interfaces.
28376
28377         We also avoid creating too many MethodSignatures.
28378
28379         (TypeContainer.IsInterfaceMethod): Update and optionally does not
28380         clear the "pending" bit if we find that there are problems with
28381         the declaration.
28382
28383         (TypeContainer.VerifyPendingMethods): Update to report errors of
28384         methods that look like implementations but are not.
28385
28386         (TypeContainer.Define): Add support for explicit interface method
28387         implementation. 
28388
28389 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
28390
28391         * typemanager.cs: Keep track of the parameters here instead of
28392         being a feature of the TypeContainer.
28393
28394         * class.cs: Drop the registration of parameters here, as
28395         InterfaceMethods are also interface declarations.
28396
28397         * delegate.cs: Register methods with the TypeManager not only with
28398         the TypeContainer.  This code was buggy.
28399
28400         * interface.cs: Full registation here.
28401
28402 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
28403
28404         * expression.cs: Remove reducer for binary expressions, it can not
28405         be done this way.
28406
28407         * const.cs: Put here the code that used to go into constant.cs
28408
28409         * constant.cs: Put here the code for constants, this is a new base
28410         class for Literals.
28411
28412         * literal.cs: Make Literal derive from Constant.
28413
28414 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
28415
28416         * statement.cs (Return.Emit): Report error 157 if the user
28417         attempts to return from a finally block.
28418
28419         (Return.Emit): Instead of emitting a return, jump to the end of
28420         the function.
28421
28422         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28423         LocalBuilder to store the result of the function.  ReturnLabel is
28424         the target where we jump.
28425
28426
28427 2001-12-09  Radek Doulik  <rodo@ximian.com>
28428
28429         * cs-parser.jay: remember alias in current namespace
28430
28431         * ecore.cs (SimpleName::DoResolve): use aliases for types or
28432         namespaces
28433
28434         * class.cs (LookupAlias): lookup alias in my_namespace
28435
28436         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28437         aliases hashtable
28438         (LookupAlias): lookup alias in this and if needed in parent
28439         namespaces
28440
28441 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
28442
28443         * support.cs: 
28444
28445         * rootcontext.cs: (ModuleBuilder) Made static, first step into
28446         making things static.  I need this to avoid passing the
28447         TypeContainer when calling ParameterType.
28448
28449         * support.cs (InternalParameters.ParameterType): Remove ugly hack
28450         that did string manipulation to compute the type and then call
28451         GetType.  Use Parameter.ParameterType instead.
28452
28453         * cs-tokenizer.cs: Consume the suffix for floating values.
28454
28455         * expression.cs (ParameterReference): figure out whether this is a
28456         reference parameter or not.  Kill an extra variable by computing
28457         the arg_idx during emission.
28458
28459         * parameter.cs (Parameters.GetParameterInfo): New overloaded
28460         function that returns whether a parameter is an out/ref value or not.
28461
28462         (Parameter.ParameterType): The type of the parameter (base,
28463         without ref/out applied).
28464
28465         (Parameter.Resolve): Perform resolution here.
28466         (Parameter.ExternalType): The full type (with ref/out applied).
28467
28468         * statement.cs (Using.Emit, Using.EmitExpression): Implement
28469         support for expressions on the using statement.
28470
28471 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
28472
28473         * statement.cs (Using.EmitLocalVariableDecls): Split the
28474         localvariable handling of the using statement.
28475
28476         (Block.EmitMeta): Keep track of variable count across blocks.  We
28477         were reusing slots on separate branches of blocks.
28478
28479         (Try.Emit): Emit the general code block, we were not emitting it. 
28480
28481         Check the type of the declaration to be an IDisposable or
28482         something that can be implicity converted to it. 
28483
28484         Emit conversions if required.
28485
28486         * ecore.cs (EmptyExpression): New utility class.
28487         (Expression.ImplicitConversionExists): New utility function.
28488
28489 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
28490
28491         * statement.cs (Using): Implement.
28492
28493         * expression.cs (LocalVariableReference): Support read only variables.
28494
28495         * statement.cs: Remove the explicit emit for the Leave opcode.
28496         (VariableInfo): Add a readonly field.
28497
28498 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
28499
28500         * ecore.cs (ConvCast): new class used to encapsulate the various
28501         explicit integer conversions that works in both checked and
28502         unchecked contexts.
28503
28504         (Expression.ConvertNumericExplicit): Use new ConvCast class to
28505         properly generate the overflow opcodes.
28506
28507 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28508
28509         * statement.cs: The correct type for the EmptyExpression is the
28510         element_type, not the variable type.  Ravi pointed this out.
28511
28512 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28513
28514         * class.cs (Method::Define): Handle PInvoke methods specially
28515         by using DefinePInvokeMethod instead of the usual one.
28516
28517         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28518         above to do the task of extracting information and defining the method.
28519
28520 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28521
28522         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28523         of the condition for string type.
28524
28525         (Emit): Move that here. 
28526
28527         (ArrayCreation::CheckIndices): Keep string literals in their expression
28528         form.
28529
28530         (EmitDynamicInitializers): Handle strings appropriately.
28531
28532 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28533
28534         * codegen.cs (EmitContext): Replace multiple variables with a
28535         single pointer to the current Switch statement.
28536
28537         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28538         EmitContext.
28539
28540 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28541
28542         * statement.cs 
28543
28544         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28545         default'.
28546
28547         (Foreach.Emit): Foreach on arrays was not setting
28548         up the loop variables (for break/continue).
28549
28550         (GotoCase): Semi-implented.
28551
28552 2001-12-03  Ravi Pratap  <ravi@ximian.com>
28553
28554         * attribute.cs (CheckAttribute): Handle system attributes by using
28555         Attribute.GetAttributes to examine information we need.
28556
28557         (GetValidPlaces): Same here.
28558
28559         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28560
28561         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28562
28563         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28564
28565         (Method::Define): Set appropriate flags if we have a DllImport attribute.
28566
28567         (Method::Emit): Handle the case when we are a PInvoke method.
28568
28569 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28570
28571         * expression.cs: Use ResolveWithSimpleName on compound names.
28572
28573 2001-12-02  Ravi Pratap  <ravi@ximian.com>
28574
28575         * constant.cs (EmitConstant): Make sure we resolve the associated expression
28576         before trying to reduce it.
28577
28578         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28579
28580         * constant.cs (LookupConstantValue): Implement.
28581
28582         (EmitConstant): Use the above in emitting the constant.
28583
28584         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28585         that are user-defined by doing a LookupConstantValue on them.
28586
28587         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28588         too, like above.
28589
28590 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
28591
28592         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28593
28594         (BaseAccess.DoResolve): Implement.
28595
28596         (MemberAccess.DoResolve): Split this routine into a
28597         ResolveMemberAccess routine that can be used independently
28598
28599 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
28600
28601         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28602         As that share bits of the implementation.  Is returns a boolean,
28603         while As returns the Type that is being probed.
28604
28605 2001-12-01  Ravi Pratap  <ravi@ximian.com>
28606
28607         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28608         instead of a Literal - much easier.
28609
28610         (EnumInTransit): Remove - utterly useless :-)
28611
28612         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28613
28614         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28615
28616         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28617         chain when we have no associated expression.
28618
28619 2001-11-30  Ravi Pratap  <ravi@ximian.com>
28620
28621         * constant.cs (Define): Use Location while reporting the errror.
28622
28623         Also emit a warning when 'new' is used and there is no inherited
28624         member to hide.
28625
28626         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
28627         populated.
28628
28629         (LookupEnumValue): Implement to lookup an enum member's value and define it
28630         if necessary.
28631
28632         (Populate): Re-write accordingly to use the above routine.
28633
28634 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
28635
28636         * expression.cs (This): Fix prototype for DoResolveLValue to
28637         override the base class DoResolveLValue.
28638
28639         * cs-parser.cs: Report errors cs574 and cs575 (destructor
28640         declarations) 
28641
28642         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28643         (we need to load the address of the field here).  This fixes
28644         test-22. 
28645
28646         (FieldExpr.DoResolveLValue): Call the DoResolve
28647         function to initialize the Instance expression.
28648
28649         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28650         correctly the GetEnumerator operation on a value type.
28651
28652         * cs-parser.jay: Add more simple parsing error catches.
28653
28654         * statement.cs (Switch): Add support for string switches.
28655         Handle null specially.
28656
28657         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
28658
28659 2001-11-28  Ravi Pratap  <ravi@ximian.com>
28660
28661         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28662
28663         (declare_local_constant): New helper function.
28664
28665         * statement.cs (AddConstant): Keep a separate record of constants
28666
28667         (IsConstant): Implement to determine if a variable is a constant.
28668
28669         (GetConstantExpression): Implement.
28670
28671         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28672
28673         * statement.cs (IsVariableDefined): Re-write.
28674
28675 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28676
28677         * class.cs (TypeContainer::FindMembers): Look for constants
28678         in the case when we are looking for MemberTypes.Field
28679
28680         * expression.cs (MemberAccess::DoResolve): Check that in the
28681         case we are a FieldExpr and a Literal, we are not being accessed
28682         by an instance reference.
28683
28684         * cs-parser.jay (local_constant_declaration): Implement.
28685
28686         (declaration_statement): Implement for constant declarations.
28687
28688 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28689
28690         * statement.cs (Switch): Catch double defaults.
28691
28692         (Switch): More work on the switch() statement
28693         implementation.  It works for integral values now, need to finish
28694         string support.
28695
28696
28697 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28698
28699         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28700         integer literals into other integer literals.  To be used by
28701         switch. 
28702
28703 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28704
28705         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28706         some memory.
28707
28708         (EmitDynamicInitializers): Cope with the above since we extract data
28709         directly from ArrayData now.
28710
28711         (ExpectInitializers): Keep track of whether initializers are mandatory
28712         or not.
28713
28714         (Bounds): Make it a hashtable to prevent the same dimension being 
28715         recorded for every element in that dimension.
28716
28717         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28718         from being found.
28719
28720         Also fix bug which was causing the indices to be emitted in the reverse
28721         order.
28722
28723 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28724
28725         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28726         unfinished.  They do not work, because the underlying code is
28727         sloppy.
28728
28729 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28730
28731         * cs-parser.jay: Remove bogus fixme.
28732
28733         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28734         on Switch statement.
28735
28736 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28737
28738         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28739         the same. 
28740
28741         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28742         parameter. Apparently, any expression is allowed. 
28743
28744         (ValidateInitializers): Update accordingly.
28745
28746         (CheckIndices): Fix some tricky bugs thanks to recursion.
28747
28748         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28749         I was being completely brain-dead.
28750
28751         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28752         and re-write acordingly.
28753
28754         (DelegateInvocation): Re-write accordingly.
28755
28756         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28757
28758         (MakeByteBlob): Handle types more correctly.
28759
28760         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28761         initialization from expressions but it is incomplete because I am a complete
28762         Dodo :-|
28763
28764 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28765
28766         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28767         on If.  Basically, we have to return `true' (ie, we do return to
28768         our caller) only if both branches of the if return.
28769
28770         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28771         short-circuit operators, handle them as short circuit operators. 
28772
28773         (Cast.DoResolve): Resolve type.
28774         (Cast.Cast): Take an expression as the target type.
28775
28776         * cs-parser.jay (cast_expression): Remove old hack that only
28777         allowed a limited set of types to be handled.  Now we take a
28778         unary_expression and we resolve to a type during semantic
28779         analysis.
28780
28781         Use the grammar productions from Rhys to handle casts (this is
28782         not complete like Rhys syntax yet, we fail to handle that corner
28783         case that C# has regarding (-x), but we will get there.
28784
28785 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28786
28787         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28788         field which is an array type.
28789
28790         * cs-parser.jay (declare_local_variables): Support array initialization too.
28791
28792         * typemanager.cs (MakeKey): Implement.
28793
28794         (everywhere): Use the above appropriately.
28795
28796         * cs-parser.jay (for_statement): Update for array initialization while
28797         declaring variables.
28798
28799         * ecore.cs : The error message was correct, it's the variable's names that
28800         were misleading ;-) Make the code more readable.
28801
28802         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28803         the correct type etc.
28804
28805         (ConvertExplicit): Handle Enum types by examining the underlying type.
28806
28807 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28808
28809         * parameter.cs (GetCallingConvention): Always return
28810         CallingConventions.Standard for now.
28811
28812 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28813
28814         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28815         and `r' after calling DoNumericPromotions.
28816
28817         * ecore.cs: Fix error message (the types were in the wrong order).
28818
28819         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28820         BindingFlags.Instance as well 
28821
28822         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28823         implicit int literal conversion in an empty cast so that we
28824         propagate the right type upstream.
28825
28826         (UnboxCast): new class used to unbox value types.
28827         (Expression.ConvertExplicit): Add explicit type conversions done
28828         by unboxing.
28829
28830         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28831         the target type before applying the implicit LongLiterals to ULong
28832         literal cast.
28833
28834 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28835
28836         * cs-parser.jay (for_statement): Reworked the way For works: now
28837         we declare manually any variables that are introduced in
28838         for_initializer to solve the problem of having out-of-band code
28839         emition (that is what got for broken).
28840
28841         (declaration_statement): Perform the actual variable declaration
28842         that used to be done in local_variable_declaration here.
28843
28844         (local_variable_declaration): Do not declare anything, just pass
28845         the information on a DictionaryEntry
28846
28847 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28848
28849         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28850         re-write of the logic to now make it recursive.
28851
28852         (UpdateIndices): Re-write accordingly.
28853
28854         Store element data in a separate ArrayData list in the above methods.
28855
28856         (MakeByteBlob): Implement to dump the array data into a byte array.
28857
28858 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28859
28860         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28861         into CheckIndices.
28862
28863         * constant.cs (Define): Implement.
28864
28865         (EmitConstant): Re-write fully.
28866
28867         Pass in location info.
28868
28869         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28870         respectively.
28871
28872         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28873         DictionaryEntry since we need location info too.
28874
28875         (constant_declaration): Update accordingly.
28876
28877         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28878         code into another method : UpdateIndices.
28879
28880 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28881
28882         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28883         some type checking etc.
28884
28885 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28886
28887         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28888         bits to provide dimension info if the user skips doing that.
28889
28890         Update second constructor to store the rank correctly.
28891
28892 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28893
28894         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28895         and try to implement.
28896
28897         * ../errors/cs0150.cs : Add.
28898
28899         * ../errors/cs0178.cs : Add.
28900
28901 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28902
28903         * statement.cs: Implement foreach on multi-dimensional arrays. 
28904
28905         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28906         name of the params argument.
28907
28908         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28909         initializing the array.
28910
28911         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28912         we can use this elsewhere.
28913
28914         * statement.cs: Finish implementation of foreach for single
28915         dimension arrays.
28916
28917         * cs-parser.jay: Use an out-of-band stack to pass information
28918         around, I wonder why I need this.
28919
28920         foreach_block: Make the new foreach_block the current_block.
28921
28922         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28923         function used to return a static Parameters structure.  Used for
28924         empty parameters, as those are created very frequently.
28925
28926         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28927
28928 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28929
28930         * interface.cs : Default modifier is private, not public. The
28931         make verify test passes again.
28932
28933 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28934
28935         * support.cs (ReflectionParameters): Fix logic to determine
28936         whether the last parameter is a params one. Test 9 passes again.
28937
28938         * delegate.cs (Populate): Register the builders we define with
28939         RegisterParameterForBuilder. Test 19 passes again.
28940
28941         * cs-parser.jay (property_declaration): Reference $6 instead
28942         of $$ to get at the location.
28943
28944         (indexer_declaration): Similar stuff.
28945
28946         (attribute): Ditto.
28947
28948         * class.cs (Property): Register parameters for the Get and Set methods
28949         if they exist. Test 23 passes again.
28950
28951         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28952         call to EmitArguments as we are sure there aren't any params arguments. 
28953         Test 32 passes again.
28954
28955         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28956         IndexOutOfRangeException. 
28957
28958         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28959         Test 33 now passes again.
28960
28961 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28962
28963         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28964         broke a bunch of things.  Will have to come up with a better way
28965         of tracking locations.
28966
28967         * statement.cs: Implemented foreach for single dimension arrays.
28968
28969 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28970
28971         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28972         an error.  This removes the lookup from the critical path.
28973
28974         * cs-parser.jay: Removed use of temporary_loc, which is completely
28975         broken. 
28976
28977 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28978
28979         * support.cs (ReflectionParameters.ParameterModifier): Report
28980         whether the argument is a PARAMS argument or not.
28981
28982         * class.cs: Set the attribute `ParamArrayAttribute' on the
28983         parameter argument.
28984
28985         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28986         and cons_param_array_attribute (ConstructorInfo for
28987         ParamArrayAttribute)., 
28988
28989         * codegen.cs: Emit the return using the `Return' statement, that
28990         way we can report the error correctly for missing return values. 
28991
28992         * class.cs (Method.Emit): Clean up.
28993
28994         * expression.cs (Argument.Resolve): Take another argument: the
28995         location where this argument is used.  Notice that this is not
28996         part of the "Argument" class as to reduce the size of the
28997         structure (we know the approximate location anyways).
28998
28999         Test if the argument is a variable-reference, if not, then
29000         complain with a 206.
29001
29002         (Argument.Emit): Emit addresses of variables.
29003
29004         (Argument.FullDesc): Simplify.
29005
29006         (Invocation.DoResolve): Update for Argument.Resolve.
29007
29008         (ElementAccess.DoResolve): ditto.
29009
29010         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
29011         method should be virtual, as this method is always virtual.
29012
29013         (NewDelegate.DoResolve): Update for Argument.Resolve.
29014
29015         * class.cs (ConstructorInitializer.DoResolve): ditto.
29016
29017         * attribute.cs (Attribute.Resolve): ditto.
29018
29019 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
29020
29021         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
29022
29023         * expression.cs (ParameterReference): Drop IStackStorage and implement
29024         IAssignMethod instead. 
29025
29026         (LocalVariableReference): ditto.
29027
29028         * ecore.cs (FieldExpr): Drop IStackStorage and implement
29029         IAssignMethod instead. 
29030
29031 2001-11-13  Miguel de Icaza <miguel@ximian.com>
29032
29033         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
29034         enumerations that are used in heavily used structures derive from
29035         byte in a laughable and pathetic attempt to reduce memory usage.
29036         This is the kind of pre-optimzations that you should not do at
29037         home without adult supervision.
29038
29039         * expression.cs (UnaryMutator): New class, used to handle ++ and
29040         -- separatedly from the other unary operators.  Cleans up the
29041         code, and kills the ExpressionStatement dependency in Unary.
29042
29043         (Unary): Removed `method' and `Arguments' from this class, making
29044         it smaller, and moving it all to SimpleCall, so I can reuse this
29045         code in other locations and avoid creating a lot of transient data
29046         strucutres when not required.
29047
29048         * cs-parser.jay: Adjust for new changes.
29049
29050 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
29051
29052         * enum.cs (Enum.Populate): If there is a failure during
29053         definition, return
29054
29055         * cs-parser.jay (opt_enum_base): we used to catch type errors
29056         here, but this is really incorrect.  The type error should be
29057         catched during semantic analysis.
29058
29059 2001-12-11  Ravi Pratap  <ravi@ximian.com>
29060
29061         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
29062         current_local_parameters as expected since I, in my stupidity, had forgotten
29063         to do this :-)
29064
29065         * attribute.cs (GetValidPlaces): Fix stupid bug.
29066
29067         * class.cs (Method::Emit): Perform check on applicability of attributes.
29068
29069         (Constructor::Emit): Ditto.
29070
29071         (Field::Emit): Ditto.
29072
29073         (Field.Location): Store location information.
29074
29075         (Property, Event, Indexer, Operator): Ditto.
29076
29077         * cs-parser.jay (field_declaration): Pass in location for each field.
29078
29079         * ../errors/cs0592.cs : Add.
29080
29081 2001-11-12  Ravi Pratap  <ravi@ximian.com>
29082
29083         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
29084
29085         (InitCoreTypes): Update accordingly.
29086
29087         (RegisterAttrType, LookupAttr): Implement.
29088
29089         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
29090         info about the same.
29091
29092         (Resolve): Update to populate the above as necessary.
29093
29094         (Error592): Helper.
29095
29096         (GetValidPlaces): Helper to the above.
29097
29098         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29099
29100         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29101
29102 2001-11-12  Ravi Pratap  <ravi@ximian.com>
29103
29104         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29105
29106         * ../errors/cs0617.cs : Add.
29107
29108 2001-11-11  Ravi Pratap  <ravi@ximian.com>
29109
29110         * enum.cs (Emit): Rename to Populate to be more consistent with what
29111         we expect it to do and when exactly it is called.
29112
29113         * class.cs, rootcontext.cs : Update accordingly.
29114
29115         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29116         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29117
29118         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29119
29120         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29121         of a fieldinfo using the above, when dealing with a FieldBuilder.
29122
29123 2001-11-10  Ravi Pratap  <ravi@ximian.com>
29124
29125         * ../errors/cs0031.cs : Add.
29126
29127         * ../errors/cs1008.cs : Add.
29128
29129         * ../errrors/cs0543.cs : Add.
29130
29131         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29132         enum type.
29133
29134         (FindMembers): Implement.
29135
29136         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29137         enums and delegates too.
29138
29139         (enum_types): Rename to builder_to_enum.
29140
29141         (delegate_types): Rename to builder_to_delegate.
29142
29143         * delegate.cs (FindMembers): Implement.
29144
29145 2001-11-09  Ravi Pratap  <ravi@ximian.com>
29146
29147         * typemanager.cs (IsEnumType): Implement.
29148
29149         * enum.cs (Emit): Re-write parts to account for the underlying type
29150         better and perform checking etc.
29151
29152         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29153         of the underlying type.
29154
29155         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29156         value
29157
29158         * enum.cs (error31): Helper to report error #31.
29159
29160         * cs-parser.jay (enum_declaration): Store location of each member too.
29161
29162         * enum.cs (member_to_location): New hashtable. 
29163
29164         (AddEnumMember): Update location hashtable.
29165
29166         (Emit): Use the location of each member while reporting errors.
29167
29168 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29169
29170         * cs-parser.jay: A for_initializer if is a
29171         local_variable_declaration really ammount to have an implicit
29172         block with the variable declaration and no initializer for for.
29173
29174         * statement.cs (For.Emit): Cope with null initializers.
29175
29176         This fixes the infinite loop on for initializers.
29177
29178 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
29179
29180         * enum.cs: More cleanup.
29181
29182         * ecore.cs: Remove dead code.
29183
29184         * class.cs (Property.Emit): More simplification.
29185         (Event.Emit): ditto.
29186
29187         Reworked to have less levels of indentation.
29188
29189 2001-11-08  Ravi Pratap  <ravi@ximian.com>
29190
29191         * class.cs (Property): Emit attributes.
29192
29193         (Field): Ditto.
29194
29195         (Event): Ditto.
29196
29197         (Indexer): Ditto.
29198
29199         (Operator): Ditto.
29200
29201         * enum.cs (Emit): Ditto.
29202
29203         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29204         Enums too.
29205
29206         * class.cs (Field, Event, etc.): Move attribute generation into the
29207         Emit method everywhere.
29208
29209         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29210         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29211         as we had no way of defining nested enums !
29212
29213         * rootcontext.cs : Adjust code accordingly.
29214
29215         * typemanager.cs (AddEnumType): To keep track of enum types separately.
29216
29217 2001-11-07  Ravi Pratap  <ravi@ximian.com>
29218
29219         * expression.cs (EvalConstantExpression): Move into ecore.cs
29220
29221         * enum.cs (Enum): Rename some members and make them public and readonly
29222         according to our convention.
29223
29224         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29225         nothing else.
29226
29227         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29228
29229         (Enum::Emit): Write a simple version for now which doesn't try to compute
29230         expressions. I shall modify this to be more robust in just a while.
29231
29232         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29233
29234         (TypeContainer::CloseType): Create the Enum types too.
29235
29236         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29237
29238         * expression.cs (EvalConstantExpression): Get rid of completely.
29239
29240         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29241         user-defined values and other cases.
29242
29243         (IsValidEnumLiteral): Helper function.
29244
29245         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
29246         out there in the case we had a literal FieldExpr.
29247
29248         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29249
29250         (Literalize): Revamp a bit to take two arguments.
29251
29252         (EnumLiteral): New class which derives from Literal to wrap enum literals.
29253
29254 2001-11-06  Ravi Pratap  <ravi@ximian.com>
29255
29256         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29257
29258         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29259
29260         (Resolve): Use the above to ensure we have proper initializers.
29261
29262 2001-11-05  Ravi Pratap  <ravi@ximian.com>
29263
29264         * expression.cs (Expression::EvalConstantExpression): New method to 
29265         evaluate constant expressions.
29266
29267         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29268
29269 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
29270
29271         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29272         in an array.
29273
29274         (Binary.ResolveOperator): Handle operator != (object a, object b)
29275         and operator == (object a, object b);
29276
29277         (Binary.DoNumericPromotions): Indicate whether the numeric
29278         promotion was possible.
29279
29280         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29281         Implement.  
29282
29283         Made the ArrayAccess implement interface IAssignMethod instead of
29284         IStackStore as the order in which arguments are passed reflects
29285         this.
29286
29287         * assign.cs: Instead of using expr.ExprClass to select the way of
29288         assinging, probe for the IStackStore/IAssignMethod interfaces.
29289
29290         * typemanager.cs: Load InitializeArray definition.
29291
29292         * rootcontext.cs (RootContext.MakeStaticData): Used to define
29293         static data that can be used to initialize arrays. 
29294
29295 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
29296
29297         * expression.cs: Handle operator== and operator!= for booleans.
29298
29299         (Conditioal.Reduce): Implement reducer for the ?: operator.
29300
29301         (Conditional.Resolve): Implement dead code elimination.
29302
29303         (Binary.Resolve): Catch string literals and return a new
29304         concatenated string.
29305
29306         (Unary.Reduce): Implement reduction of unary expressions.
29307
29308         * ecore.cs: Split out the expression core handling here.
29309
29310         (Expression.Reduce): New method used to perform constant folding
29311         and CSE.  This is needed to support constant-expressions. 
29312
29313         * statement.cs (Statement.EmitBoolExpression): Pass true and false
29314         targets, and optimize for !x.
29315
29316 2001-11-04  Ravi Pratap  <ravi@ximian.com>
29317
29318         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29319         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29320         set custom atttributes.
29321
29322         * literal.cs (Literal::GetValue): New abstract method to return the actual
29323         value of the literal, cast as an object.
29324
29325         (*Literal): Implement GetValue method.
29326
29327         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29328         expressions to the arraylist but objects of type Argument.
29329
29330         * class.cs (TypeContainer::Emit): Emit our attributes too.
29331
29332         (Method::Emit, Constructor::Emit): Ditto.
29333
29334         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29335         to be ignoring earlier.
29336
29337 2001-11-03  Ravi Pratap  <ravi@ximian.com>
29338
29339         * attribute.cs (AttributeSection::Define): Implement to do the business
29340         of constructing a CustomAttributeBuilder.
29341
29342         (Attribute): New trivial class. Increases readability of code.  
29343
29344         * cs-parser.jay : Update accordingly.
29345
29346         (positional_argument_list, named_argument_list, named_argument): New rules
29347
29348         (attribute_arguments): Use the above so that we are more correct.
29349
29350 2001-11-02  Ravi Pratap  <ravi@ximian.com>
29351
29352         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29353         to perform all checks for a method with a params parameter.
29354
29355         (Invocation::OverloadResolve): Update to use the above method and therefore
29356         cope correctly with params method invocations.
29357
29358         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
29359         params too.
29360
29361         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29362         constructors in our parent too because we can't afford to miss out on 
29363         protected ones ;-)
29364
29365         * attribute.cs (AttributeSection): New name for the class Attribute
29366
29367         Other trivial changes to improve readability.
29368
29369         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29370         use the new class names.
29371
29372 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29373
29374         * class.cs (Method::Define): Complete definition for params types too
29375
29376         (Indexer::Define): Ditto.
29377
29378         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29379         Cope everywhere with a request for info about the array parameter.
29380
29381 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29382
29383         * tree.cs (RecordNamespace): Fix up to check for the correct key.
29384
29385         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
29386         local_variable_type to extract the string corresponding to the type.
29387
29388         (local_variable_type): Fixup the action to use the new helper method.
29389
29390         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
29391         go.
29392
29393         * expression.cs : Clean out code which uses the above.
29394
29395 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29396
29397         * typemanager.cs (RegisterMethod): Check if we already have an existing key
29398         and bale out if necessary by returning a false.
29399
29400         (RegisterProperty): Ditto.
29401
29402         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29403         and print out appropriate error messages.
29404
29405         * interface.cs (everywhere): Ditto.
29406
29407         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29408         location to constructor.
29409
29410         * class.cs (Property, Event, Indexer): Update accordingly.
29411
29412         * ../errors/cs111.cs : Added.
29413
29414         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29415         of a method, as laid down by the spec.
29416
29417         (Invocation::OverloadResolve): Use the above method.
29418
29419 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29420
29421         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29422         now take a TypeContainer and a Parameters object.
29423
29424         (ParameterData): Modify return type of ParameterModifier method to be 
29425         Parameter.Modifier and not a string.
29426
29427         (ReflectionParameters, InternalParameters): Update accordingly.
29428
29429         * expression.cs (Argument::GetParameterModifier): Same here.
29430
29431         * support.cs (InternalParameters::ParameterType): Find a better way of determining
29432         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29433         symbol in it at all so maybe this is only for now.
29434
29435 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29436
29437         * support.cs (InternalParameters): Constructor now takes an extra argument 
29438         which is the actual Parameters class.
29439
29440         (ParameterDesc): Update to provide info on ref/out modifiers.
29441
29442         * class.cs (everywhere): Update call to InternalParameters to pass in
29443         the second argument too.
29444
29445         * support.cs (ParameterData): Add ParameterModifier, which is a method 
29446         to return the modifier info [ref/out etc]
29447
29448         (InternalParameters, ReflectionParameters): Implement the above.
29449
29450         * expression.cs (Argument::ParameterModifier): Similar function to return
29451         info about the argument's modifiers.
29452
29453         (Invocation::OverloadResolve): Update to take into account matching modifiers 
29454         too.
29455
29456         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29457         a new SetFormalParameters object which we pass to InternalParameters.
29458
29459 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29460
29461         * expression.cs (NewArray): Merge into the ArrayCreation class.
29462
29463 2001-10-29  Ravi Pratap  <ravi@ximian.com>
29464
29465         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
29466         NewUserdefinedArray into one as there wasn't much of a use in having
29467         two separate ones.
29468
29469         * expression.cs (Argument): Change field's name to ArgType from Type.
29470
29471         (Type): New readonly property which returns the proper type, taking into 
29472         account ref/out modifiers.
29473
29474         (everywhere): Adjust code accordingly for the above.
29475
29476         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29477         whether we are emitting for a ref or out parameter.
29478
29479         * expression.cs (Argument::Emit): Use the above field to set the state.
29480
29481         (LocalVariableReference::Emit): Update to honour the flag and emit the
29482         right stuff.
29483
29484         * parameter.cs (Attributes): Set the correct flags for ref parameters.
29485
29486         * expression.cs (Argument::FullDesc): New function to provide a full desc.
29487
29488         * support.cs (ParameterData): Add method ParameterDesc to the interface.
29489
29490         (ReflectionParameters, InternalParameters): Implement the above method.
29491
29492         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29493         reporting errors.
29494
29495         (Invocation::FullMethodDesc): Ditto. 
29496
29497 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
29498
29499         * cs-parser.jay: Add extra production for the second form of array
29500         creation. 
29501
29502         * expression.cs (ArrayCreation): Update to reflect the above
29503         change. 
29504
29505         * Small changes to prepare for Array initialization.
29506
29507 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
29508
29509         * typemanager.cs (ImplementsInterface): interface might be null;
29510         Deal with this problem;
29511
29512         Also, we do store negative hits on the cache (null values), so use
29513         this instead of calling t.GetInterfaces on the type everytime.
29514
29515 2001-10-28  Ravi Pratap  <ravi@ximian.com>
29516
29517         * typemanager.cs (IsBuiltinType): New method to help determine the same.
29518
29519         * expression.cs (New::DoResolve): Get rid of array creation code and instead
29520         split functionality out into different classes.
29521
29522         (New::FormArrayType): Move into NewBuiltinArray.
29523
29524         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29525         quite useless.
29526
29527         (NewBuiltinArray): New class to handle creation of built-in arrays.
29528
29529         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29530         account creation of one-dimensional arrays.
29531
29532         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29533
29534         (NewUserdefinedArray::DoResolve): Implement.
29535
29536         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29537
29538         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29539         we maintain inside the TypeManager. This is necessary to perform lookups on the
29540         module builder.
29541
29542         (LookupType): Update to perform GetType on the module builders too.     
29543
29544         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29545
29546         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29547
29548 2001-10-23  Ravi Pratap  <ravi@ximian.com>
29549
29550         * expression.cs (New::DoResolve): Implement guts of array creation.
29551
29552         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29553
29554 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
29555
29556         * expression.cs: Fix bug I introduced lsat night that broke
29557         Delegates. 
29558
29559         (Expression.Resolve): Report a 246 error (can not resolve name)
29560         if we find a SimpleName in the stream.
29561
29562         (Expression.ResolveLValue): Ditto.
29563
29564         (Expression.ResolveWithSimpleName): This function is a variant of
29565         ResolveName, this one allows SimpleNames to be returned without a
29566         warning.  The only consumer of SimpleNames is MemberAccess
29567
29568 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
29569
29570         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29571         might arrive here.  I have my doubts that this is correct.
29572
29573         * statement.cs (Lock): Implement lock statement.
29574
29575         * cs-parser.jay: Small fixes to support `lock' and `using'
29576
29577         * cs-tokenizer.cs: Remove extra space
29578
29579         * driver.cs: New flag --checked, allows to turn on integer math
29580         checking. 
29581
29582         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29583         Threading.Monitor.Exit 
29584
29585 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
29586
29587         * expression.cs (IndexerAccess::DoResolveLValue): Set the
29588         Expression Class to be IndexerAccess.
29589
29590         Notice that Indexer::DoResolve sets the eclass to Value.
29591
29592 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
29593
29594         * class.cs (TypeContainer::Emit): Emit code for indexers.
29595
29596         * assign.cs (IAssignMethod): New interface implemented by Indexers
29597         and Properties for handling assignment.
29598
29599         (Assign::Emit): Simplify and reuse code. 
29600
29601         * expression.cs (IndexerAccess, PropertyExpr): Implement
29602         IAssignMethod, clean up old code. 
29603
29604 2001-10-22  Ravi Pratap  <ravi@ximian.com>
29605
29606         * typemanager.cs (ImplementsInterface): New method to determine if a type
29607         implements a given interface. Provides a nice cache too.
29608
29609         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29610         method.
29611
29612         (ConvertReferenceExplicit): Ditto.
29613
29614         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
29615         various methods, with correct names etc.
29616
29617         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
29618         Operator.UnaryNegation.
29619
29620         * cs-parser.jay (operator_declarator): Be a little clever in the case where
29621         we have a unary plus or minus operator.
29622
29623         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
29624         UnaryMinus.
29625
29626         * everywhere : update accordingly.
29627
29628         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29629         respectively.
29630
29631         * class.cs (Method::Define): For the case where we are implementing a method
29632         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
29633         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29634
29635 2001-10-21  Ravi Pratap  <ravi@ximian.com>
29636
29637         * interface.cs (FindMembers): Implement to work around S.R.E
29638         lameness.
29639
29640         * typemanager.cs (IsInterfaceType): Implement.
29641
29642         (FindMembers): Update to handle interface types too.
29643
29644         * expression.cs (ImplicitReferenceConversion): Re-write bits which
29645         use IsAssignableFrom as that is not correct - it doesn't work.
29646
29647         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29648         and accordingly override EmitStatement.
29649
29650         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29651         using the correct logic :-)
29652
29653 2001-10-19  Ravi Pratap  <ravi@ximian.com>
29654
29655         * ../errors/cs-11.cs : Add to demonstrate error -11 
29656
29657 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
29658
29659         * assign.cs (Assign::Resolve): Resolve right hand side first, and
29660         then pass this as a hint to ResolveLValue.
29661
29662         * expression.cs (FieldExpr): Add Location information
29663
29664         (FieldExpr::LValueResolve): Report assignment to readonly
29665         variable. 
29666
29667         (Expression::ExprClassFromMemberInfo): Pass location information.
29668
29669         (Expression::ResolveLValue): Add new method that resolves an
29670         LValue. 
29671
29672         (Expression::DoResolveLValue): Default invocation calls
29673         DoResolve. 
29674
29675         (Indexers): New class used to keep track of indexers in a given
29676         Type. 
29677
29678         (IStackStore): Renamed from LValue, as it did not really describe
29679         what this did.  Also ResolveLValue is gone from this interface and
29680         now is part of Expression.
29681
29682         (ElementAccess): Depending on the element access type
29683
29684         * typemanager.cs: Add `indexer_name_type' as a Core type
29685         (System.Runtime.CompilerServices.IndexerNameAttribute)
29686
29687         * statement.cs (Goto): Take a location.
29688
29689 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29690
29691         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29692         if two delegates are compatible.
29693
29694         (NewDelegate::DoResolve): Update to take care of the case when
29695         we instantiate a delegate from another delegate.
29696
29697         * typemanager.cs (FindMembers): Don't even try to look up members
29698         of Delegate types for now.
29699
29700 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29701
29702         * delegate.cs (NewDelegate): New class to take care of delegate
29703         instantiation.
29704
29705         * expression.cs (New): Split the delegate related code out into 
29706         the NewDelegate class.
29707
29708         * delegate.cs (DelegateInvocation): New class to handle delegate 
29709         invocation.
29710
29711         * expression.cs (Invocation): Split out delegate related code into
29712         the DelegateInvocation class.
29713
29714 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29715
29716         * expression.cs (New::DoResolve): Implement delegate creation fully
29717         and according to the spec.
29718
29719         (New::DoEmit): Update to handle delegates differently.
29720
29721         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29722         because of which we were printing out arguments in reverse order !
29723
29724         * delegate.cs (VerifyMethod): Implement to check if the given method
29725         matches the delegate.
29726
29727         (FullDelegateDesc): Implement.
29728
29729         (VerifyApplicability): Implement.
29730
29731         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29732         delegate invocations too.
29733
29734         (Invocation::Emit): Ditto.
29735
29736         * ../errors/cs1593.cs : Added.
29737
29738         * ../errors/cs1594.cs : Added.
29739
29740         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29741
29742 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29743
29744         * typemanager.cs (intptr_type): Core type for System.IntPtr
29745
29746         (InitCoreTypes): Update for the same.
29747
29748         (iasyncresult_type, asynccallback_type): Ditto.
29749
29750         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29751         correct.
29752
29753         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29754         too.
29755
29756         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29757         the builders for the 4 members of a delegate type :-)
29758
29759         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29760         type.
29761
29762         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29763
29764         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29765
29766 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29767
29768         * statement.cs (Break::Emit): Implement.   
29769         (Continue::Emit): Implement.
29770
29771         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29772         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29773         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29774         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29775         end loop
29776
29777         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29778         properties that track the label for the current loop (begin of the
29779         loop and end of the loop).
29780
29781 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29782
29783         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29784         use of emitting anything at all.
29785
29786         * class.cs, rootcontext.cs : Get rid of calls to the same.
29787
29788         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29789
29790         (Populate): Define the constructor correctly and set the implementation
29791         attributes.
29792
29793         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29794         have been defined.
29795
29796         (AddDelegateType): Implement.
29797
29798         (IsDelegateType): Implement helper method.
29799
29800         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29801
29802         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29803         and accordingly handle it.
29804
29805         * delegate.cs (Populate): Take TypeContainer argument.
29806         Implement bits to define the Invoke method. However, I still haven't figured out
29807         how to take care of the native int bit :-(
29808
29809         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29810         Qualify the name of the delegate, not its return type !
29811
29812         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29813         conversion.
29814
29815         (StandardConversionExists): Checking for array types turns out to be recursive.
29816
29817         (ConvertReferenceExplicit): Implement array conversion.
29818
29819         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29820
29821 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29822
29823         * cs-parser.jay (delegate_declaration): Store the fully qualified
29824         name as it is a type declaration.
29825
29826         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29827         readonly.
29828
29829         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29830         as TypeContainer::DefineType.
29831
29832         (Populate): Method in which all the definition of the various methods (Invoke)
29833         etc is done.
29834
29835         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29836         see.
29837
29838         (CloseDelegate): Finally creates the delegate.
29839
29840         * class.cs (TypeContainer::DefineType): Update to define delegates.
29841         (Populate, Emit and CloseType): Do the same thing here too.
29842
29843         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29844         delegates in all these operations.
29845
29846 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29847
29848         * expression.cs: LocalTemporary: a new expression used to
29849         reference a temporary that has been created.
29850
29851         * assign.cs: Handle PropertyAccess back here, so that we can
29852         provide the proper semantic access to properties.
29853
29854         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29855         a few more explicit conversions. 
29856
29857         * modifiers.cs: `NEW' modifier maps to HideBySig.
29858
29859         * expression.cs (PropertyExpr): Make this into an
29860         ExpressionStatement, and support the EmitStatement code path. 
29861
29862         Perform get/set error checking, clean up the interface.
29863
29864         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29865         them into toplevel access objects.
29866
29867 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29868
29869         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29870         SRE.
29871
29872         * typemanager.cs: Keep track here of our PropertyBuilders again to
29873         work around lameness in SRE.
29874
29875 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29876
29877         * expression.cs (LValue::LValueResolve): New method in the
29878         interface, used to perform a second resolution pass for LValues. 
29879
29880         (This::DoResolve): Catch the use of this in static methods.
29881
29882         (This::LValueResolve): Implement.
29883
29884         (This::Store): Remove warning, assigning to `this' in structures
29885         is 
29886
29887         (Invocation::Emit): Deal with invocation of
29888         methods on value types.  We need to pass the address to structure
29889         methods rather than the object itself.  (The equivalent code to
29890         emit "this" for structures leaves the entire structure on the
29891         stack instead of a pointer to it). 
29892
29893         (ParameterReference::DoResolve): Compute the real index for the
29894         argument based on whether the method takes or not a `this' pointer
29895         (ie, the method is static).
29896
29897         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29898         value types returned from functions when we need to invoke a
29899         method on the sturcture.
29900
29901
29902 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29903
29904         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29905         defining the type in the Modulebuilder or Typebuilder. This is to take
29906         care of nested types which need to be defined on the TypeBuilder using
29907         DefineNestedMethod.
29908
29909         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29910         methods in RootContext, only ported to be part of TypeContainer.
29911
29912         (TypeContainer::GetInterfaceOrClass): Ditto.
29913
29914         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29915
29916         * interface.cs (Interface::DefineInterface): New method. Does exactly
29917         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29918         too.
29919
29920         (Interface::GetInterfaces): Move from RootContext here and port.
29921
29922         (Interface::GetInterfaceByName): Same here.
29923
29924         * rootcontext.cs (ResolveTree): Re-write.
29925
29926         (PopulateTypes): Re-write.
29927
29928         * class.cs (TypeContainer::Populate): Populate nested types too.
29929         (TypeContainer::Emit): Emit nested members too.
29930
29931         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29932         instead just use the name argument passed in as it is already fully
29933         qualified.
29934
29935         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29936         to TypeContainer mapping to see if a type is user-defined.
29937
29938         * class.cs (TypeContainer::CloseType): Implement. 
29939
29940         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29941         the default constructor.
29942
29943         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29944         twice.
29945
29946         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29947
29948         * interface.cs (CloseType): Create the type here.
29949
29950         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29951         the hierarchy.
29952
29953         Remove all the methods which are now in TypeContainer.
29954
29955 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29956
29957         * delegate.cs (Define): Re-write bits to define the delegate
29958         correctly.
29959
29960 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29961
29962         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29963
29964         * expression.cs (ImplicitReferenceConversion): handle null as well
29965         as a source to convert to any reference type.
29966
29967         * statement.cs (Return): Perform any implicit conversions to
29968         expected return type.  
29969
29970         Validate use of return statement.  
29971
29972         * codegen.cs (EmitContext): Pass the expected return type here.
29973
29974         * class.cs (Method, Constructor, Property): Pass expected return
29975         type to EmitContext.
29976
29977 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29978
29979         * expression.cs: Make DoResolve take an EmitContext instead of a
29980         TypeContainer.
29981
29982         Replaced `l' and `location' for `loc', for consistency.
29983
29984         (Error, Warning): Remove unneeded Tc argument.
29985
29986         * assign.cs, literal.cs, constant.cs: Update to new calling
29987         convention. 
29988
29989         * codegen.cs: EmitContext now contains a flag indicating whether
29990         code is being generated in a static method or not.
29991
29992         * cs-parser.jay: DecomposeQI, new function that replaces the old
29993         QualifiedIdentifier.  Now we always decompose the assembled
29994         strings from qualified_identifier productions into a group of
29995         memberaccesses.
29996
29997 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29998
29999         * rootcontext.cs: Deal with field-less struct types correctly now
30000         by passing the size option to Define Type.
30001
30002         * class.cs: Removed hack that created one static field. 
30003
30004 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
30005
30006         * statement.cs: Moved most of the code generation here. 
30007
30008 2001-10-09  Ravi Pratap  <ravi@ximian.com>
30009
30010         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
30011         seem very right.
30012
30013         (ElementAccess): Remove useless bits for now - keep checks as the spec
30014         says.
30015
30016 2001-10-08  Ravi Pratap  <ravi@ximian.com>
30017
30018         * expression.cs (ElementAccess::DoResolve): Remove my crap code
30019         and start performing checks according to the spec.
30020
30021 2001-10-07  Ravi Pratap  <ravi@ximian.com>
30022
30023         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
30024         rank_specifiers instead.
30025
30026         (rank_specifiers): Change the order in which the rank specifiers are stored
30027
30028         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
30029
30030         * expression.cs (ElementAccess): Implement the LValue interface too.
30031
30032 2001-10-06  Ravi Pratap  <ravi@ximian.com>
30033
30034         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
30035         except that user defined conversions are not included.
30036
30037         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
30038         perform the conversion of the return type, if necessary.
30039
30040         (New::DoResolve): Check whether we are creating an array or an object
30041         and accordingly do the needful.
30042
30043         (New::Emit): Same here.
30044
30045         (New::DoResolve): Implement guts of array creation.
30046
30047         (New::FormLookupType): Helper function.
30048
30049 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
30050
30051         * codegen.cs: Removed most of the code generation here, and move the
30052         corresponding code generation bits to the statement classes. 
30053
30054         Added support for try/catch/finalize and throw.
30055
30056         * cs-parser.jay: Added support for try/catch/finalize.
30057
30058         * class.cs: Catch static methods having the flags override,
30059         virtual or abstract.
30060
30061         * expression.cs (UserCast): This user cast was not really doing
30062         what it was supposed to do.  Which is to be born in fully resolved
30063         state.  Parts of the resolution were being performed at Emit time! 
30064
30065         Fixed this code.
30066
30067 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
30068
30069         * expression.cs: Implicity convert the result from UserCast.
30070
30071 2001-10-05  Ravi Pratap  <ravi@ximian.com>
30072
30073         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
30074         prevented it from working correctly. 
30075
30076         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
30077         merely ConvertImplicit.
30078
30079 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
30080
30081         * typemanager.cs: Make the LookupTypeContainer function static,
30082         and not per-instance.  
30083
30084         * class.cs: Make static FindMembers (the one that takes a Type
30085         argument). 
30086
30087         * codegen.cs: Add EmitForeach here.
30088
30089         * cs-parser.jay: Make foreach a toplevel object instead of the
30090         inline expansion, as we need to perform semantic analysis on it. 
30091
30092 2001-10-05  Ravi Pratap  <ravi@ximian.com>
30093
30094         * expression.cs (Expression::ImplicitUserConversion): Rename to
30095         UserDefinedConversion.
30096
30097         (Expression::UserDefinedConversion): Take an extra argument specifying 
30098         whether we look for explicit user conversions too.
30099
30100         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30101
30102         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30103
30104         (ExplicitUserConversion): Make it a call to UserDefinedConversion
30105         with the appropriate arguments.
30106
30107         * cs-parser.jay (cast_expression): Record location too.
30108
30109         * expression.cs (Cast): Record location info.
30110
30111         (Expression::ConvertExplicit): Take location argument.
30112
30113         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30114         to determine if we are doing explicit conversions.
30115
30116         (UserCast::Emit): Update accordingly.
30117
30118         (Expression::ConvertExplicit): Report an error if everything fails.
30119
30120         * ../errors/cs0030.cs : Add.
30121
30122 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
30123
30124         * modifiers.cs: If the ABSTRACT keyword is present, also set the
30125         virtual and newslot bits. 
30126
30127         * class.cs (TypeContainer::RegisterRequiredImplementations):
30128         Record methods we need.
30129
30130         (TypeContainer::MakeKey): Helper function to make keys for
30131         MethodBases, since the Methodbase key is useless.
30132
30133         (TypeContainer::Populate): Call RegisterRequiredImplementations
30134         before defining the methods.   
30135
30136         Create a mapping for method_builders_to_methods ahead of time
30137         instead of inside a tight loop.
30138
30139         (::RequireMethods):  Accept an object as the data to set into the
30140         hashtable so we can report interface vs abstract method mismatch.
30141
30142 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30143
30144         * report.cs: Make all of it static.
30145
30146         * rootcontext.cs: Drop object_type and value_type computations, as
30147         we have those in the TypeManager anyways.
30148
30149         Drop report instance variable too, now it is a global.
30150
30151         * driver.cs: Use try/catch on command line handling.
30152
30153         Add --probe option to debug the error reporting system with a test
30154         suite. 
30155
30156         * report.cs: Add support for exiting program when a probe
30157         condition is reached.
30158
30159 2001-10-03  Ravi Pratap  <ravi@ximian.com>
30160
30161         * expression.cs (Binary::DoNumericPromotions): Fix the case when
30162         we do a forcible conversion regardless of type, to check if 
30163         ForceConversion returns a null.
30164
30165         (Binary::error19): Use location to report error.
30166
30167         (Unary::error23): Use location here too.
30168
30169         * ../errors/cs0019.cs : Check in.
30170
30171         * ../errors/cs0023.cs : Check in.
30172
30173         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30174         case of a non-null MethodInfo object with a length of 0 !
30175
30176         (Binary::ResolveOperator): Flag error if overload resolution fails to find
30177         an applicable member - according to the spec :-)
30178         Also fix logic to find members in base types.
30179
30180         (Unary::ResolveOperator): Same here.
30181
30182         (Unary::report23): Change name to error23 and make first argument a TypeContainer
30183         as I was getting thoroughly confused between this and error19 :-)
30184
30185         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30186         (::FindMostEncompassedType): Implement.
30187         (::FindMostEncompassingType): Implement.
30188         (::StandardConversionExists): Implement.
30189
30190         (UserImplicitCast): Re-vamp. We now need info about most specific
30191         source and target types so that we can do the necessary conversions.
30192
30193         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30194         mathematical union with no duplicates.
30195
30196 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30197
30198         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30199         in order from base classes to child classes, so that we can in
30200         child classes look up in our parent for method names and
30201         attributes (required for handling abstract, virtual, new, override
30202         constructs: we need to instrospect our base class, and if we dont
30203         populate the classes in order, the introspection might be
30204         incorrect.  For example, a method could query its parent before
30205         the parent has any methods and would determine that the parent has
30206         no abstract methods (while it could have had them)).
30207
30208         (RootContext::CreateType): Record the order in which we define the
30209         classes.
30210
30211 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
30212
30213         * class.cs (TypeContainer::Populate): Also method definitions can
30214         fail now, keep track of this.
30215
30216         (TypeContainer::FindMembers): Implement support for
30217         DeclaredOnly/noDeclaredOnly flag.
30218
30219         (Constructor::Emit) Return the ConstructorBuilder.
30220
30221         (Method::Emit) Return the MethodBuilder. 
30222         Check for abstract or virtual methods to be public.
30223
30224         * rootcontext.cs (RootContext::CreateType): Register all the
30225         abstract methods required for the class to be complete and the
30226         interface methods that must be implemented. 
30227
30228         * cs-parser.jay: Report error 501 (method requires body if it is
30229         not marked abstract or extern).
30230
30231         * expression.cs (TypeOf::Emit): Implement.
30232
30233         * typemanager.cs: runtime_handle_type, new global type.
30234
30235         * class.cs (Property::Emit): Generate code for properties.
30236
30237 2001-10-02  Ravi Pratap  <ravi@ximian.com>
30238
30239         * expression.cs (Unary::ResolveOperator): Find operators on base type
30240         too - we now conform exactly to the spec.
30241
30242         (Binary::ResolveOperator): Same here.
30243
30244         * class.cs (Operator::Define): Fix minor quirk in the tests.
30245
30246         * ../errors/cs0215.cs : Added.
30247
30248         * ../errors/cs0556.cs : Added.
30249
30250         * ../errors/cs0555.cs : Added.
30251
30252 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30253
30254         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30255         single integer which is really efficient
30256
30257 2001-10-01  Ravi Pratap  <ravi@ximian.com>
30258
30259         *  expression.cs (Expression::ImplicitUserConversion): Use location
30260         even in the case when we are examining True operators.
30261  
30262         * class.cs (Operator::Define): Perform extensive checks to conform
30263         with the rules for operator overloading in the spec.
30264
30265         * expression.cs (Expression::ImplicitReferenceConversion): Implement
30266         some of the other conversions mentioned in the spec.
30267
30268         * typemanager.cs (array_type): New static member for the System.Array built-in
30269         type.
30270
30271         (cloneable_interface): For System.ICloneable interface.
30272
30273         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30274         we start resolving the tree and populating types.
30275
30276         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30277  
30278 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30279
30280         * expression.cs (Expression::ExprClassFromMemberInfo,
30281         Expression::Literalize): Create literal expressions from
30282         FieldInfos which are literals.
30283
30284         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30285         type casts, because they were wrong.  The test suite in tests
30286         caught these ones.
30287
30288         (ImplicitNumericConversion): ushort to ulong requires a widening
30289         cast. 
30290
30291         Int32 constant to long requires widening cast as well.
30292
30293         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30294         for integers because the type on the stack is not i4.
30295
30296 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
30297
30298         * expression.cs (report118): require location argument. 
30299
30300         * parameter.cs: Do not dereference potential null value.
30301
30302         * class.cs: Catch methods that lack the `new' keyword when
30303         overriding a name.  Report warnings when `new' is used without
30304         anything being there to override.
30305
30306         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30307
30308         * class.cs: Only add constructor to hashtable if it is non-null
30309         (as now constructors can fail on define).
30310
30311         (TypeManager, Class, Struct): Take location arguments.
30312
30313         Catch field instance initialization in structs as errors.
30314
30315         accepting_filter: a new filter for FindMembers that is static so
30316         that we dont create an instance per invocation.
30317
30318         (Constructor::Define): Catch errors where a struct constructor is
30319         parameterless 
30320
30321         * cs-parser.jay: Pass location information for various new
30322         constructs. 
30323
30324         * delegate.cs (Delegate): take a location argument.
30325
30326         * driver.cs: Do not call EmitCode if there were problesm in the
30327         Definition of the types, as many Builders wont be there. 
30328
30329         * decl.cs (Decl::Decl): Require a location argument.
30330
30331         * cs-tokenizer.cs: Handle properly hex constants that can not fit
30332         into integers, and find the most appropiate integer for it.
30333
30334         * literal.cs: Implement ULongLiteral.
30335
30336         * rootcontext.cs: Provide better information about the location of
30337         failure when CreateType fails.
30338
30339 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
30340
30341         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30342         as well.
30343
30344         * expression.cs (Binary::CheckShiftArguments): Add missing type
30345         computation.
30346         (Binary::ResolveOperator): Add type to the logical and and logical
30347         or, Bitwise And/Or and Exclusive Or code paths, it was missing
30348         before.
30349
30350         (Binary::DoNumericPromotions): In the case where either argument
30351         is ulong (and most signed types combined with ulong cause an
30352         error) perform implicit integer constant conversions as well.
30353
30354 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30355
30356         * expression.cs (UserImplicitCast): Method should always be
30357         non-null. 
30358         (Invocation::BetterConversion): Simplified test for IntLiteral.
30359
30360         (Expression::ImplicitNumericConversion): Split this routine out.
30361         Put the code that performs implicit constant integer conversions
30362         here. 
30363
30364         (Expression::Resolve): Become a wrapper around DoResolve so we can
30365         check eclass and type being set after resolve.
30366
30367         (Invocation::Badness): Remove this dead function
30368
30369         (Binary::ResolveOperator): Do not compute the expensive argumnets
30370         unless we have a union for it.
30371
30372         (Probe::Emit): Is needs to do an isinst and then
30373         compare against null.
30374
30375         (::CanConvert): Added Location argument.  If the Location argument
30376         is null (Location.Null), then we do not report errors.  This is
30377         used by the `probe' mechanism of the Explicit conversion.  We do
30378         not want to generate an error for something that the user
30379         explicitly requested to be casted.  But the pipeline for an
30380         explicit cast first tests for potential implicit casts.
30381
30382         So for now, if the Location is null, it means `Probe only' to
30383         avoid adding another argument.   Might have to revise this
30384         strategy later.
30385
30386         (ClassCast): New class used to type cast objects into arbitrary
30387         classes (used in Explicit Reference Conversions).
30388
30389         Implement `as' as well.
30390
30391         Reverted all the patches from Ravi below: they were broken:
30392
30393                 * The use of `level' as a mechanism to stop recursive
30394                   invocations is wrong.  That was there just to catch the
30395                   bug with a strack trace but not as a way of addressing
30396                   the problem.
30397
30398                   To fix the problem we have to *understand* what is going
30399                   on and the interactions and come up with a plan, not
30400                   just get things going.
30401
30402                 * The use of the type conversion cache that I proposed
30403                   last night had an open topic: How does this work across
30404                   protection domains.  A user defined conversion might not
30405                   be public in the location where we are applying the
30406                   conversion, a different conversion might be selected
30407                   (ie, private A->B (better) but public B->A (worse),
30408                   inside A, A->B applies, but outside it, B->A will
30409                   apply).
30410
30411                 * On top of that (ie, even if the above is solved),
30412                   conversions in a cache need to be abstract.  Ie, `To
30413                   convert from an Int to a Short use an OpcodeCast', not
30414                   `To convert from an Int to a Short use the OpcodeCast on
30415                   the variable 5' (which is what this patch was doing).
30416
30417 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30418
30419         * expression.cs (Invocation::ConversionExists): Re-write to use
30420         the conversion cache
30421
30422         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30423         cache all conversions done, not just user-defined ones.
30424
30425         (Invocation::BetterConversion): The real culprit. Use ConversionExists
30426         to determine if a conversion exists instead of acutually trying to 
30427         perform the conversion. It's faster too.
30428
30429         (Expression::ConvertExplicit): Modify to use ConversionExists to check
30430         and only then attempt the implicit conversion.
30431
30432 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30433
30434         * expression.cs (ConvertImplicit): Use a cache for conversions
30435         already found. Check level of recursion and bail out if necessary.
30436
30437 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30438
30439         * typemanager.cs (string_concat_string_string, string_concat_object_object):
30440         Export standard methods that we expect for string operations.
30441
30442         * statement.cs (Block::UsageWarning): Track usage of variables and
30443         report the errors for not used variables.
30444
30445         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30446         operator. 
30447
30448 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30449
30450         * codegen.cs: remove unnneded code 
30451
30452         * expression.cs: Removed BuiltinTypeAccess class
30453
30454         Fix the order in which implicit conversions are
30455         done.  
30456
30457         The previous fixed dropped support for boxed conversions (adding a
30458         test to the test suite now)
30459
30460         (UserImplicitCast::CanConvert): Remove test for source being null,
30461         that code is broken.  We should not feed a null to begin with, if
30462         we do, then we should track the bug where the problem originates
30463         and not try to cover it up here.
30464
30465         Return a resolved expression of type UserImplicitCast on success
30466         rather than true/false.  Ravi: this is what I was talking about,
30467         the pattern is to use a static method as a "constructor" for
30468         objects. 
30469
30470         Also, do not create arguments until the very last minute,
30471         otherwise we always create the arguments even for lookups that
30472         will never be performed. 
30473
30474         (UserImplicitCast::Resolve): Eliminate, objects of type
30475         UserImplicitCast are born in a fully resolved state. 
30476
30477         * typemanager.cs (InitCoreTypes): Init also value_type
30478         (System.ValueType). 
30479
30480         * expression.cs (Cast::Resolve): First resolve the child expression.
30481
30482         (LValue): Add new method AddressOf to be used by
30483         the `&' operator.  
30484
30485         Change the argument of Store to take an EmitContext instead of an
30486         ILGenerator, because things like FieldExpr need to be able to call
30487         their children expression to generate the instance code. 
30488
30489         (Expression::Error, Expression::Warning): Sugar functions for
30490         reporting errors.
30491
30492         (Expression::MemberLookup): Accept a TypeContainer instead of a
30493         Report as the first argument.
30494
30495         (Expression::ResolvePrimary): Killed.  I still want to improve
30496         this as currently the code is just not right.
30497
30498         (Expression::ResolveMemberAccess): Simplify, but it is still
30499         wrong. 
30500
30501         (Unary::Resolve): Catch errors in AddressOf operators.
30502
30503         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30504         index to a byte for the short-version, or the compiler will choose
30505         the wrong Emit call, which generates the wrong data.
30506
30507         (ParameterReference::Emit, ::Store): same.
30508
30509         (FieldExpr::AddressOf): Implement.
30510
30511         * typemanager.cs: TypeManager: made public variable instead of
30512         property.
30513
30514         * driver.cs: document --fatal.
30515
30516         * report.cs (ErrorMessage, WarningMessage): new names for the old
30517         Error and Warning classes.
30518
30519         * cs-parser.jay (member_access): Turn built-in access to types
30520         into a normal simplename
30521
30522 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30523
30524         * expression.cs (Invocation::BetterConversion): Fix to cope
30525         with q being null, since this was introducing a bug.
30526
30527         * expression.cs (ConvertImplicit): Do built-in conversions first.
30528
30529 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30530
30531         * expression.cs (UserImplicitCast::Resolve): Fix bug.
30532
30533 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30534
30535         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30536         I had introduced long ago (what's new ?).
30537
30538         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
30539         the work of all the checking. 
30540         (ConvertImplicit): Call CanConvert and only then create object if necessary.
30541         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30542
30543         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30544         that is the right way. 
30545
30546         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
30547         overloading resolution. Use everywhere instead of cutting and pasting code.
30548
30549         (Binary::ResolveOperator): Use MakeUnionSet.
30550
30551         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
30552         we have to convert to bool types. Not complete yet.
30553
30554 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30555
30556         * typemanager.cs (TypeManager::CSharpName): support ushort.
30557
30558         * expression.cs (Expression::TryImplicitIntConversion): Attempts
30559         to provide an expression that performsn an implicit constant int
30560         conversion (section 6.1.6).
30561         (Expression::ConvertImplicitRequired): Reworked to include
30562         implicit constant expression conversions.
30563
30564         (Expression::ConvertNumericExplicit): Finished.
30565
30566         (Invocation::Emit): If InstanceExpression is null, then it means
30567         that we perform a call on this.
30568
30569 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30570
30571         * expression.cs (Unary::Emit): Remove some dead code.
30572         (Probe): Implement Resolve and Emit for `is'.
30573         (Expression::ConvertImplicitRequired): Attempt to do constant
30574         expression conversions here.  Maybe should be moved to
30575         ConvertImplicit, but I am not sure.
30576         (Expression::ImplicitLongConstantConversionPossible,
30577         Expression::ImplicitIntConstantConversionPossible): New functions
30578         that tell whether is it possible to apply an implicit constant
30579         expression conversion.
30580
30581         (ConvertNumericExplicit): Started work on explicit numeric
30582         conversions.
30583
30584         * cs-parser.jay: Update operator constants.
30585
30586         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30587         (Parameters::GetSignature): Hook up VerifyArgs here.
30588         (Parameters::VerifyArgs): Verifies that no two arguments have the
30589         same name. 
30590
30591         * class.cs (Operator): Update the operator names to reflect the
30592         ones that the spec expects (as we are just stringizing the
30593         operator names).
30594
30595         * expression.cs (Unary::ResolveOperator): Fix bug: Use
30596         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30597         previous usage did only work for our methods.
30598         (Expression::ConvertImplicit): Handle decimal implicit numeric
30599         conversions as well.
30600         (Expression::InternalTypeConstructor): Used to invoke constructors
30601         on internal types for default promotions.
30602
30603         (Unary::Emit): Implement special handling for the pre/post
30604         increment/decrement for overloaded operators, as they need to have
30605         the same semantics as the other operators.
30606
30607         (Binary::ResolveOperator): ditto.
30608         (Invocation::ConversionExists): ditto.
30609         (UserImplicitCast::Resolve): ditto.
30610
30611 2001-09-26  Ravi Pratap  <ravi@ximian.com>
30612
30613         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30614         operator, return after emitting body. Regression tests pass again !
30615
30616         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30617         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30618         (Invocation::OverloadResolve): Ditto.
30619         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30620
30621         * everywhere : update calls to the above methods accordingly.
30622
30623 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30624
30625         * assign.cs (Assign): Make it inherit from ExpressionStatement.
30626
30627         * expression.cs (ExpressionStatement): New base class used for
30628         expressions that can appear in statements, so that we can provide
30629         an alternate path to generate expression that do not leave a value
30630         on the stack.
30631
30632         (Expression::Emit, and all the derivatives): We no longer return
30633         whether a value is left on the stack or not.  Every expression
30634         after being emitted leaves a single value on the stack.
30635
30636         * codegen.cs (EmitContext::EmitStatementExpression): Use the
30637         facilties of ExpressionStatement if possible.
30638
30639         * cs-parser.jay: Update statement_expression.
30640
30641 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
30642
30643         * driver.cs: Change the wording of message
30644
30645 2001-09-25  Ravi Pratap  <ravi@ximian.com>
30646
30647         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
30648         the type of the expression to the return type of the method if
30649         we have an overloaded operator match ! The regression tests pass again !
30650         (Unary::ResolveOperator): Ditto.
30651
30652         * expression.cs (Invocation::ConversionExists): Correct the member lookup
30653         to find "op_Implicit", not "implicit" ;-)
30654         (UserImplicitCast): New class to take care of user-defined implicit conversions.
30655         (ConvertImplicit, ForceConversion): Take TypeContainer argument
30656
30657         * everywhere : Correct calls to the above accordingly.
30658
30659         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30660         (ConvertImplicit): Do user-defined conversion if it exists.
30661
30662 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
30663
30664         * assign.cs: track location.
30665         (Resolve): Use implicit conversions on assignment.
30666
30667         * literal.cs: Oops.  Not good, Emit of short access values should
30668         pass (Bytes) or the wrong argument will be selected.
30669
30670         * expression.cs (Unary::Emit): Emit code for -expr.
30671
30672         (Unary::ResolveOperator): Handle `Substract' for non-constants
30673         (substract from zero from the non-constants).
30674         Deal with Doubles as well. 
30675
30676         (Expression::ConvertImplicitRequired): New routine that reports an
30677         error if no implicit conversion exists. 
30678
30679         (Invocation::OverloadResolve): Store the converted implicit
30680         expressions if we make them
30681
30682 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30683
30684         * class.cs (ConstructorInitializer): Take a Location argument.
30685         (ConstructorBaseInitializer): Same here.
30686         (ConstructorThisInitializer): Same here.
30687
30688         * cs-parser.jay : Update all calls accordingly.
30689
30690         * expression.cs (Unary, Binary, New): Take location argument.
30691         Update accordingly everywhere.
30692
30693         * cs-parser.jay : Update all calls to the above to take a location
30694         argument.
30695
30696         * class.cs : Ditto.
30697
30698 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30699
30700         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30701         (Invocation::BetterConversion): Same here
30702         (Invocation::ConversionExists): Ditto.
30703
30704         (Invocation::ConversionExists): Implement.
30705
30706 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30707
30708         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30709         Also take an additional TypeContainer argument.
30710
30711         * All over : Pass in TypeContainer as argument to OverloadResolve.
30712
30713         * typemanager.cs (CSharpName): Update to check for the string type and return
30714         that too.
30715
30716         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30717         a given method.
30718
30719 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30720
30721         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30722         (Invocation::BetterFunction): Implement.
30723         (Invocation::BetterConversion): Implement.
30724         (Invocation::ConversionExists): Skeleton, no implementation yet.
30725
30726         Okay, things work fine !
30727
30728 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30729
30730         * typemanager.cs: declare and load enum_type, delegate_type and
30731         void_type. 
30732
30733         * expression.cs (Expression::Emit): Now emit returns a value that
30734         tells whether a value is left on the stack or not.  This strategy
30735         might be reveted tomorrow with a mechanism that would address
30736         multiple assignments.
30737         (Expression::report118): Utility routine to report mismatches on
30738         the ExprClass.
30739
30740         (Unary::Report23): Report impossible type/operator combination
30741         utility function.
30742
30743         (Unary::IsIncrementableNumber): Whether the type can be
30744         incremented or decremented with add.
30745         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30746         complemented. 
30747         (Unary::ResolveOperator): Implement ++, !, ~,
30748
30749         (Invocation::Emit): Deal with new Emit convetion.
30750
30751         * All Expression derivatives: Updated their Emit method to return
30752         whether they leave values on the stack or not.
30753
30754         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30755         stack for expressions that are statements. 
30756
30757 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30758
30759         * expression.cs (LValue): New interface.  Must be implemented by
30760         LValue objects.
30761         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30762         LValue interface.
30763
30764         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30765         interface for generating code, simplifies the code.
30766
30767 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30768
30769         * expression.cs (everywhere): Comment out return statements in ::Resolve
30770         methods to avoid the warnings.
30771
30772 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30773
30774         * driver.cs (parse): Report error 2001 if we can not open the
30775         source file.
30776
30777         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30778         not resolve it.
30779
30780         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30781         object. 
30782
30783         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30784         otherwise nested blocks end up with the same index.
30785
30786         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30787
30788         * expression.cs:  Instead of having FIXMEs in the Resolve
30789         functions, throw exceptions so it is obvious that we are facing a
30790         bug. 
30791
30792         * cs-parser.jay (invocation_expression): Pass Location information.
30793
30794         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30795         Use a basename for those routines because .NET does not like paths
30796         on them. 
30797
30798         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30799         already defined.
30800
30801 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30802
30803         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30804         are loading the correct data types (throws an exception if not).
30805         (TypeManager::InitCoreTypes): Use CoreLookupType
30806
30807         * expression.cs (Unary::ResolveOperator): return the child
30808         expression for expressions which are just +expr.
30809         (Unary::ResolveOperator): Return negative literals for -LITERAL
30810         expressions (otherwise they are Unary {Literal}).
30811         (Invocation::Badness): Take into account `Implicit constant
30812         expression conversions'.
30813
30814         * literal.cs (LongLiteral): Implement long literal class.
30815         (IntLiteral): export the `Value' of the intliteral. 
30816
30817 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30818
30819         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30820
30821         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30822         instead of 'Operator'
30823
30824         * expression.cs (Binary::ResolveOperator): Update accordingly.
30825         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30826         and 'Minus'
30827
30828         * cs-parser.jay (unary_expression): Update to use the new names.
30829
30830         * gen-treedump.cs (GetUnary): Same here.
30831
30832         * expression.cs (Unary::Resolve): Implement.
30833         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30834         operators are found instead of making noise ;-)
30835         (Unary::ResolveOperator): New method to do precisely the same thing which
30836         Binary::ResolveOperator does for Binary expressions.
30837         (Unary.method, .Arguments): Add.
30838         (Unary::OperName): Implement.   
30839         (Unary::ForceConversion): Copy and Paste !
30840
30841         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30842         a unary operator.
30843
30844         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30845         for the inbuilt operators. Only overloading works for now ;-)
30846
30847 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30848
30849         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30850         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30851
30852         * expression.cs (This::Emit): Implement. 
30853         (This::Resolve): Implement.
30854         (TypeOf:Resolve): Implement.
30855         (Expression::ResolveSimpleName): Add an implicit this to instance
30856         field references. 
30857         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30858         Bind instance variable to Field expressions.
30859         (FieldExpr::Instance): New field used to track the expression that
30860         represents the object instance.
30861         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30862         binding 
30863         (FieldExpr::Emit): Implement.
30864
30865         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30866         the last instruction contains a return opcode to avoid generating
30867         the last `ret' instruction (this generates correct code, and it is
30868         nice to pass the peverify output).
30869
30870         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30871         initializer for static and instance variables.
30872         (Constructor::Emit): Allow initializer to be null in the case of
30873         static constructors.  Only emit initializer for instance
30874         constructors. 
30875
30876         (TypeContainer::FindMembers): Return a null array if there are no
30877         matches.
30878
30879         Also fix the code for the MemberTypes.Method branch, as it was not
30880         scanning that for operators (or tried to access null variables before).
30881
30882         * assign.cs (Assign::Emit): Handle instance and static fields. 
30883
30884         * TODO: Updated.
30885
30886         * driver.cs: Stop compilation if there are parse errors.
30887
30888         * cs-parser.jay (constructor_declaration): Provide default base
30889         initializer for non-static constructors.
30890         (constructor_declarator): Do not provide a default base
30891         initializers if none was specified.
30892         Catch the fact that constructors should not have parameters.
30893
30894         * class.cs: Do not emit parent class initializers for static
30895         constructors, that should be flagged as an error.
30896
30897 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30898
30899         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30900         Move back code into TypeContainer::Populate.
30901
30902 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30903
30904         * class.cs (TypeContainer::AddConstructor): Fix the check to
30905         compare against Name, not Basename. 
30906         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30907
30908         * cs-parser.jay : Update accordingly.
30909
30910         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30911         for methods, don't forget to look into the operators too.
30912         (RegisterMethodBuilder): Helper method to take care of this for
30913         methods, constructors and operators.
30914         (Operator::Define): Completely revamp.
30915         (Operator.OperatorMethod, MethodName): New fields.
30916         (TypeContainer::Populate): Move the registering of builders into
30917         RegisterMethodBuilder.
30918         (Operator::Emit): Re-write.
30919
30920         * expression.cs (Binary::Emit): Comment out code path to emit method
30921         invocation stuff for the case when we have a user defined operator. I am
30922         just not able to get it right !
30923
30924 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30925
30926         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30927         argument. 
30928
30929         (Expression::MemberLookup): Provide a version that allows to
30930         specify the MemberTypes and BindingFlags. 
30931
30932         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30933         so it was not fetching variable information from outer blocks.
30934
30935         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30936         Beforefieldinit as it was buggy.
30937
30938         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30939         that Ravi put here.  
30940
30941         * class.cs (Constructor::Emit): Only emit if block is not null.
30942         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30943         deal with this by semantically definining it as if the user had
30944         done it.
30945
30946         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30947         constructors as we now "emit" them at a higher level.
30948
30949         (TypeContainer::DefineDefaultConstructor): Used to define the
30950         default constructors if none was provided.
30951
30952         (ConstructorInitializer): Add methods Resolve and Emit. 
30953
30954         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30955
30956 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30957
30958         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30959         the default constructor builder with our hashtable for methodbuilders
30960         to methodcores.
30961
30962         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30963         and argument_count is 0 in which case we have a match.
30964         (Binary::ResolveOperator): More null checking and miscellaneous coding
30965         style cleanup.
30966
30967 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30968
30969         * rootcontext.cs (IsNameSpace): Compare against null.
30970
30971         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30972
30973         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30974         and Unary::Operator.
30975
30976         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30977         accordingly.
30978
30979         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30980         we have overloaded operators.
30981         (Binary::ResolveOperator): Implement the part which does the operator overload
30982         resolution.
30983
30984         * class.cs (Operator::Emit): Implement.
30985         (TypeContainer::Emit): Emit the operators we have too.
30986
30987         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30988         the case when we have a user-defined operator.
30989
30990 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30991
30992         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30993
30994 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30995
30996         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30997         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30998         (Constructor::Emit): Implement.
30999         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
31000         if we have no work to do. 
31001         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
31002         Emit method.
31003
31004         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
31005         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
31006
31007         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
31008         of parent.parent.
31009
31010 2001-09-15  Ravi Pratap  <ravi@ximian.com>
31011
31012         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
31013         in the source.
31014         (Tree::RecordNamespace): Method to do what the name says ;-)
31015         (Tree::Namespaces): Property to get at the namespaces hashtable.
31016
31017         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
31018         keep track.
31019
31020         * rootcontext.cs (IsNamespace): Fixed it :-)
31021
31022 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
31023
31024         * class.cs (TypeContainer::FindMembers): Add support for
31025         constructors. 
31026         (MethodCore): New class that encapsulates both the shared aspects
31027         of a Constructor and a Method.  
31028         (Method, Constructor): Factored pieces into MethodCore.
31029
31030         * driver.cs: Added --fatal which makes errors throw exceptions.
31031         Load System assembly as well as part of the standard library.
31032
31033         * report.cs: Allow throwing exceptions on errors for debugging.
31034
31035         * modifiers.cs: Do not use `parent', instead use the real type
31036         container to evaluate permission settings.
31037
31038         * class.cs: Put Ravi's patch back in.  He is right, and we will
31039         have to cope with the
31040
31041 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31042
31043         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
31044         FamORAssem, not FamANDAssem.
31045
31046 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
31047
31048         * driver.cs: Added --parse option that only parses its input files
31049         and terminates.
31050
31051         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
31052         incorrect.  IsTopLevel is not used to tell whether an object is
31053         root_types or not (that can be achieved by testing this ==
31054         root_types).  But to see if this is a top-level *class* (not
31055         necessarly our "toplevel" container). 
31056
31057 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31058
31059         * enum.cs (Enum::Define): Modify to call the Lookup method on the
31060         parent instead of a direct call to GetType.
31061
31062 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31063
31064         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
31065         Modifiers.TypeAttr. This should just be a call to that method.
31066
31067         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
31068         object so that we can determine if we are top-level or not.
31069
31070         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
31071         TypeContainer too.
31072
31073         * enum.cs (Enum::Define): Ditto.
31074
31075         * modifiers.cs (FieldAttr): Re-write.
31076
31077         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
31078         (TypeContainer::HaveStaticConstructor): New property to provide access
31079         to precisely that info.
31080
31081         * modifiers.cs (MethodAttr): Re-write.
31082         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
31083
31084         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
31085         of top-level types as claimed.
31086
31087 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31088
31089         * expression.cs (MemberLookup): Fruitless attempt to lookup
31090         constructors.  Maybe I need to emit default constructors?  That
31091         might be it (currently .NET emits this for me automatically).
31092         (Invocation::OverloadResolve): Cope with Arguments == null.
31093         (Invocation::EmitArguments): new function, shared by the new
31094         constructor and us.
31095         (Invocation::Emit): Handle static and instance methods.  Emit
31096         proper call instruction for virtual or non-virtual invocations.
31097         (New::Emit): Implement.
31098         (New::Resolve): Implement.
31099         (MemberAccess:Resolve): Implement.
31100         (MethodGroupExpr::InstanceExpression): used conforming to the spec
31101         to track instances.
31102         (FieldExpr::Resolve): Set type.
31103
31104         * support.cs: Handle empty arguments.
31105                 
31106         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31107         SimpleLookup): Auxiliary routines to help parse a qualifier
31108         identifier.  
31109
31110         Update qualifier_identifier rule.
31111
31112         * codegen.cs: Removed debugging messages.
31113
31114         * class.cs: Make this a global thing, this acts just as a "key" to
31115         objects that we might have around.
31116
31117         (Populate): Only initialize method_builders_to_methods once.
31118
31119         * expression.cs (PropertyExpr): Initialize type from the
31120         PropertyType. 
31121
31122         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31123         Resolve pattern.  Attempt to implicitly convert value to boolean.
31124         Emit code.
31125
31126         * expression.cs: Set the type for the int32/int32 argument case.
31127         (Binary::ResolveOperator): Set the return type to boolean for
31128         comparission operators
31129
31130         * typemanager.cs: Remove debugging print code.
31131
31132         (Invocation::Resolve): resolve type.
31133
31134         * class.cs: Allocate a MemberInfo of the correct size, as the code
31135         elsewhere depends on the test to reflect the correct contents.
31136
31137         (Method::) Keep track of parameters, due to System.Reflection holes
31138
31139         (TypeContainer::Populate): Keep track of MethodBuilders to Method
31140         mapping here.
31141
31142         (TypeContainer::FindMembers): Use ArrayList and then copy an array
31143         of the exact size and return that.
31144
31145         (Class::LookupMethodByBuilder): New function that maps
31146         MethodBuilders to its methods.  Required to locate the information
31147         on methods because System.Reflection bit us again.
31148
31149         * support.cs: New file, contains an interface ParameterData and
31150         two implementations: ReflectionParameters and InternalParameters
31151         used to access Parameter information.  We will need to grow this
31152         as required.
31153
31154         * expression.cs (Invocation::GetParameterData): implement a cache
31155         and a wrapper around the ParameterData creation for methods. 
31156         (Invocation::OverloadResolve): Use new code.
31157
31158 2001-09-13  Ravi Pratap  <ravi@ximian.com>
31159
31160         * class.cs (TypeContainer::EmitField): Remove and move into 
31161         (Field::Define): here and modify accordingly.
31162         (Field.FieldBuilder): New member.
31163         (TypeContainer::Populate): Update accordingly.
31164         (TypeContainer::FindMembers): Implement.
31165
31166 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31167
31168         * statement.cs: (VariableInfo::VariableType): New field to be
31169         initialized with the full type once it is resolved. 
31170
31171 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
31172
31173         * parameter.cs (GetParameterInfo): Use a type cache to compute
31174         things only once, and to reuse this information
31175
31176         * expression.cs (LocalVariableReference::Emit): Implement.
31177         (OpcodeCast::Emit): fix.
31178
31179         (ParameterReference::Resolve): Implement.
31180         (ParameterReference::Emit): Implement.
31181
31182         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31183         that are expressions need to stay as Expressions.
31184
31185         * typemanager.cs (CSharpName): Returns the C# name of a type if
31186         possible. 
31187
31188         * expression.cs (Expression::ConvertImplicit): New function that
31189         implements implicit type conversions.
31190
31191         (Expression::ImplicitReferenceConversion): Implements implicit
31192         reference conversions.
31193
31194         (EmptyCast): New type for transparent casts.
31195
31196         (OpcodeCast): New type for casts of types that are performed with
31197         a sequence of bytecodes.
31198
31199         (BoxedCast): New type used for casting value types into reference
31200         types.  Emits a box opcode.
31201
31202         (Binary::DoNumericPromotions): Implements numeric promotions of
31203         and computation of the Binary::Type.
31204
31205         (Binary::EmitBranchable): Optimization.
31206
31207         (Binary::Emit): Implement code emission for expressions.
31208
31209         * typemanager.cs (TypeManager): Added two new core types: sbyte
31210         and byte.
31211
31212 2001-09-12  Ravi Pratap  <ravi@ximian.com>
31213
31214         * class.cs (TypeContainer::FindMembers): Method which does exactly
31215         what Type.FindMembers does, only we don't have to use reflection. No
31216         implementation yet.
31217
31218         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31219         typecontainer objects as we need to get at them.
31220         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31221
31222         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31223         typecontainer object.
31224
31225         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31226         of just a Report object.
31227
31228 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31229
31230         * class.cs (Event::Define): Go back to using the prefixes "add_" and
31231         "remove_"
31232         (TypeContainer::Populate): Now define the delegates of the type too.
31233         (TypeContainer.Delegates): Property to access the list of delegates defined
31234         in the type.
31235
31236         * delegates.cs (Delegate::Define): Implement partially.
31237
31238         * modifiers.cs (TypeAttr): Handle more flags.
31239
31240 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31241
31242         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31243         and not <=
31244         (Operator::Define): Re-write logic to get types by using the LookupType method
31245         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31246         (Indexer::Define): Ditto.
31247         (Event::Define): Ditto.
31248         (Property::Define): Ditto.
31249
31250 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31251
31252         * class.cs (TypeContainer::Populate): Now define operators too. 
31253         (TypeContainer.Operators): New property to access the list of operators
31254         in a type.
31255         (Operator.OperatorMethodBuilder): New member to hold the method builder
31256         for the operator we are defining.
31257         (Operator::Define): Implement.
31258
31259 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31260
31261         * class.cs (Event::Define): Make the prefixes of the accessor methods
31262         addOn_ and removeOn_ 
31263
31264         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31265         of the location being passed in too. Ideally, this should go later since all
31266         error reporting should be done through the Report object.
31267
31268         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31269         (Populate): Iterate thru the indexers we have and define them too.
31270         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31271         for the get and set accessors.
31272         (Indexer::Define): Implement.
31273
31274 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
31275
31276         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
31277         my previous implementation, did not work.
31278
31279         * typemanager.cs: Add a couple of missing types (the longs).
31280
31281         * literal.cs: Use TypeManager.bool_type instead of getting it.
31282
31283         * expression.cs (EventExpr): New kind of expressions.
31284         (Expressio::ExprClassFromMemberInfo): finish
31285
31286 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
31287
31288         * assign.cs: Emit stores to static fields differently.
31289
31290 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31291
31292         * Merge in changes and adjust code to tackle conflicts. Backed out my
31293         code in Assign::Resolve ;-) 
31294
31295 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31296
31297         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31298         instead Report.Error and also pass in the location.
31299         (CSharpParser::Lexer): New readonly property to return the reference
31300         to the Tokenizer object.
31301         (declare_local_variables): Use Report.Error with location instead of plain 
31302         old error.
31303         (CheckDef): Ditto.
31304
31305         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31306         (Operator.CheckBinaryOperator): Ditto.
31307
31308         * cs-parser.jay (operator_declarator): Update accordingly.
31309
31310         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31311         (CheckBinaryOperator): Same here.
31312
31313         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31314         on the name without any prefixes of namespace names etc. This is because we
31315         already might have something already fully qualified like 
31316         'System.Console.WriteLine'
31317
31318         * assign.cs (Resolve): Begin implementation. Stuck ;-)
31319
31320 2001-09-07  Ravi Pratap  <ravi@ximian.com>
31321
31322         * cs-tokenizer.cs (location): Return a string which also contains
31323         the file name.
31324
31325         * expression.cs (ElementAccess): New class for expressions of the
31326         type 'element access.'
31327         (BaseAccess): New class for expressions of the type 'base access.'
31328         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31329         respectively.
31330
31331         * cs-parser.jay (element_access): Implement action.
31332         (base_access): Implement actions.
31333         (checked_expression, unchecked_expression): Implement.
31334
31335         * cs-parser.jay (local_variable_type): Correct and implement.
31336         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31337
31338         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31339
31340         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31341         name and the specifiers.
31342
31343         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31344
31345         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
31346         making them all public ;-)
31347
31348         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31349         class anyways.
31350
31351 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
31352
31353         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31354         PropertyExprs.
31355         (FieldExpr, PropertyExprs): New resolved expressions.
31356         (SimpleName::MemberStaticCheck): Perform static checks for access
31357         to non-static fields on static methods. Maybe this should be
31358         generalized for MemberAccesses. 
31359         (SimpleName::ResolveSimpleName): More work on simple name
31360         resolution. 
31361
31362         * cs-parser.jay (primary_expression/qualified_identifier): track
31363         the parameter index.
31364
31365         * codegen.cs (CodeGen::Save): Catch save exception, report error.
31366         (EmitContext::EmitBoolExpression): Chain to expression generation
31367         instead of temporary hack.
31368         (::EmitStatementExpression): Put generic expression code generation.
31369
31370         * assign.cs (Assign::Emit): Implement variable assignments to
31371         local variables, parameters and fields.
31372
31373 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
31374
31375         * statement.cs (Block::GetVariableInfo): New method, returns the
31376         VariableInfo for a variable name in a block.
31377         (Block::GetVariableType): Implement in terms of GetVariableInfo
31378
31379         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31380         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31381
31382 2001-09-06  Ravi Pratap  <ravi@ximian.com>
31383
31384         * cs-parser.jay (operator_declaration): Continue on my quest : update
31385         to take attributes argument.
31386         (event_declaration): Ditto.
31387         (enum_declaration): Ditto.
31388         (indexer_declaration): Ditto.
31389
31390         * class.cs (Operator::Operator): Update constructor accordingly.
31391         (Event::Event): Ditto.
31392
31393         * delegate.cs (Delegate::Delegate): Same here.
31394
31395         * enum.cs (Enum::Enum): Same here.
31396
31397 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31398
31399         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31400
31401         * ../tests/cs0658.cs : New file to demonstrate error 0658.
31402
31403         * attribute.cs (Attributes): New class to encapsulate all attributes which were
31404         being passed around as an arraylist.
31405         (Attributes::AddAttribute): Method to add attribute sections.
31406
31407         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31408         (struct_declaration): Update accordingly.
31409         (constant_declaration): Update.
31410         (field_declaration): Update.
31411         (method_header): Update.
31412         (fixed_parameter): Update.
31413         (parameter_array): Ditto.
31414         (property_declaration): Ditto.
31415         (destructor_declaration): Ditto.
31416
31417         * class.cs (Struct::Struct): Update constructors accordingly.
31418         (Class::Class): Ditto.
31419         (Field::Field): Ditto.
31420         (Method::Method): Ditto.
31421         (Property::Property): Ditto.
31422         (TypeContainer::OptAttribute): update property's return type.
31423
31424         * interface.cs (Interface.opt_attributes): New member.
31425         (Interface::Interface): Update to take the extra Attributes argument.
31426
31427         * parameter.cs (Parameter::Parameter): Ditto.
31428
31429         * constant.cs (Constant::Constant): Ditto.
31430
31431         * interface.cs (InterfaceMemberBase): New OptAttributes field.
31432         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
31433         the attributes as a parameter.
31434         (InterfaceProperty): Update constructor call.
31435         (InterfaceEvent): Ditto.
31436         (InterfaceMethod): Ditto.
31437         (InterfaceIndexer): Ditto.
31438
31439         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
31440         pass the attributes too.
31441         (interface_event_declaration): Ditto.
31442         (interface_property_declaration): Ditto.
31443         (interface_method_declaration): Ditto.
31444         (interface_declaration): Ditto.
31445
31446 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
31447
31448         * class.cs (Method::Define): Track the "static Main" definition to
31449         create an entry point. 
31450
31451         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31452         EntryPoint if we find it. 
31453
31454         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31455         (EmitContext::ig): Make this variable public.
31456
31457         * driver.cs: Make the default output file be the first file name
31458         with the .exe extension.  
31459
31460         Detect empty compilations
31461
31462         Handle various kinds of output targets.  Handle --target and
31463         rename -t to --dumper.
31464
31465         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31466         methods inherited from Expression return now an Expression.  This
31467         will is used during the tree rewriting as we resolve them during
31468         semantic analysis.
31469
31470         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31471         the spec.  Missing entirely is the information about
31472         accessability of elements of it.
31473
31474         (Expression::ExprClassFromMemberInfo): New constructor for
31475         Expressions that creates a fully initialized Expression based on
31476         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31477         a Type.
31478
31479         (Invocation::Resolve): Begin implementing resolution of invocations.
31480
31481         * literal.cs (StringLiteral):  Implement Emit.
31482
31483 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31484
31485         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31486         member.
31487
31488 2001-09-04  Ravi Pratap  <ravi@ximian.com>
31489
31490         * cs-parser.jay (attribute_arguments): Implement actions.
31491         (attribute): Fix bug in production. Implement action.
31492         (attribute_list): Implement.
31493         (attribute_target): Implement.
31494         (attribute_target_specifier, opt_target_specifier): Implement
31495         (CheckAttributeTarget): New method to check if the attribute target
31496         is valid.
31497         (attribute_section): Implement.
31498         (opt_attributes): Implement.
31499
31500         * attribute.cs : New file to handle attributes.
31501         (Attribute): Class to hold attribute info.
31502
31503         * cs-parser.jay (opt_attribute_target_specifier): Remove production
31504         (attribute_section): Modify production to use 2 different rules to 
31505         achieve the same thing. 1 s/r conflict down !
31506         Clean out commented, useless, non-reducing dimension_separator rules.
31507
31508         * class.cs (TypeContainer.attributes): New member to hold list
31509         of attributes for a type.
31510         (Struct::Struct): Modify to take one more argument, the attribute list.
31511         (Class::Class): Ditto.
31512         (Field::Field): Ditto.
31513         (Method::Method): Ditto.
31514         (Property::Property): Ditto.
31515
31516         * cs-parser.jay (struct_declaration): Update constructor call to
31517         pass in the attributes too.
31518         (class_declaration): Ditto.
31519         (constant_declaration): Ditto.
31520         (field_declaration): Ditto.
31521         (method_header): Ditto.
31522         (fixed_parameter): Ditto.
31523         (parameter_array): Ditto.
31524         (property_declaration): Ditto.
31525
31526         * constant.cs (Constant::Constant): Update constructor similarly.
31527         Use System.Collections.
31528
31529         * parameter.cs (Parameter::Parameter): Update as above.
31530
31531 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31532
31533         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31534         (TypeContainer.delegates): New member to hold list of delegates.
31535
31536         * cs-parser.jay (delegate_declaration): Implement the action correctly 
31537         this time as I seem to be on crack ;-)
31538
31539 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
31540
31541         * rootcontext.cs (RootContext::IsNamespace): new function, used to
31542         tell whether an identifier represents a namespace.
31543
31544         * expression.cs (NamespaceExpr): A namespace expression, used only
31545         temporarly during expression resolution.
31546         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31547         utility functions to resolve names on expressions.
31548
31549 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
31550
31551         * codegen.cs: Add hook for StatementExpressions. 
31552
31553         * class.cs: Fix inverted test for static flag in methods.
31554
31555 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31556
31557         * class.cs (Operator::CheckUnaryOperator): Correct error number used
31558         to make it coincide with MS' number.
31559         (Operator::CheckBinaryOperator): Ditto.
31560
31561         * ../errors/errors.txt : Remove error numbers added earlier.
31562
31563         * ../errors/cs1019.cs : Test case for error # 1019
31564
31565         * ../errros/cs1020.cs : Test case for error # 1020
31566
31567         * cs-parser.jay : Clean out commented cruft.
31568         (dimension_separators, dimension_separator): Comment out. Ostensibly not
31569         used anywhere - non-reducing rule.
31570         (namespace_declarations): Non-reducing rule - comment out.
31571
31572         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31573         with TypeContainer::AddEnum.
31574
31575         * delegate.cs : New file for delegate handling classes.
31576         (Delegate): Class for declaring delegates.
31577
31578         * makefile : Update.
31579
31580         * cs-parser.jay (delegate_declaration): Implement.
31581
31582 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
31583
31584         * class.cs (Event::Define): Implement.
31585         (Event.EventBuilder): New member.
31586
31587         * class.cs (TypeContainer::Populate): Update to define all enums and events
31588         we have.
31589         (Events): New property for the events arraylist we hold. Shouldn't we move to using
31590         readonly fields for all these cases ?
31591
31592 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31593
31594         * class.cs (Property): Revamp to use the convention of making fields readonly.
31595         Accordingly modify code elsewhere.
31596
31597         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31598         the Define method of the Property class.
31599
31600         * class.cs : Clean up applied patch and update references to variables etc. Fix 
31601         trivial bug.
31602         (TypeContainer::Populate): Update to define all the properties we have. Also
31603         define all enumerations.
31604
31605         * enum.cs (Define): Implement.
31606
31607 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31608
31609         * cs-parser.jay (overloadable_operator): The semantic value is an
31610         enum of the Operator class.
31611         (operator_declarator): Implement actions.
31612         (operator_declaration): Implement.
31613
31614         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31615         validity of definitions.
31616         (Operator::CheckBinaryOperator): Static method to check for binary operators
31617         (TypeContainer::AddOperator): New method to add an operator to a type.
31618
31619         * cs-parser.jay (indexer_declaration): Added line to actually call the
31620         AddIndexer method so it gets added ;-)
31621
31622         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
31623         already taken care of by the MS compiler ?  
31624
31625 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31626
31627         * class.cs (Operator): New class for operator declarations.
31628         (Operator::OpType): Enum for the various operators.
31629
31630 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31631
31632         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31633         ostensibly handle this in semantic analysis.
31634
31635         * cs-parser.jay (general_catch_clause): Comment out
31636         (specific_catch_clauses, specific_catch_clause): Ditto.
31637         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31638         (catch_args, opt_catch_args): New productions.
31639         (catch_clause): Rewrite to use the new productions above
31640         (catch_clauses): Modify accordingly.
31641         (opt_catch_clauses): New production to use in try_statement
31642         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31643         and re-write the code in the actions to extract the specific and
31644         general catch clauses by being a little smart ;-)
31645
31646         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31647         Hooray, try and catch statements parse fine !
31648
31649 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31650
31651         * statement.cs (Block::GetVariableType): Fix logic to extract the type
31652         string from the hashtable of variables.
31653
31654         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31655         I end up making that mistake ;-)
31656         (catch_clauses): Fixed gross error which made Key and Value of the 
31657         DictionaryEntry the same : $1 !!
31658
31659 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31660
31661         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31662
31663         * cs-parser.jay (event_declaration): Correct to remove the semicolon
31664         when the add and remove accessors are specified. 
31665
31666 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31667
31668         * cs-parser.jay (IndexerDeclaration): New helper class to hold
31669         information about indexer_declarator.
31670         (indexer_declarator): Implement actions.
31671         (parsing_indexer): New local boolean used to keep track of whether
31672         we are parsing indexers or properties. This is necessary because 
31673         implicit_parameters come into picture even for the get accessor in the 
31674         case of an indexer.
31675         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31676
31677         * class.cs (Indexer): New class for indexer declarations.
31678         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31679         (TypeContainer::indexers): New member to hold list of indexers for the
31680         type.
31681
31682 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31683
31684         * cs-parser.jay (add_accessor_declaration): Implement action.
31685         (remove_accessor_declaration): Implement action.
31686         (event_accessors_declaration): Implement
31687         (variable_declarators): swap statements for first rule - trivial.
31688
31689         * class.cs (Event): New class to hold information about event
31690         declarations.
31691         (TypeContainer::AddEvent): New method to add an event to a type
31692         (TypeContainer::events): New member to hold list of events.
31693
31694         * cs-parser.jay (event_declaration): Implement actions.
31695
31696 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31697
31698         * cs-parser.jay (dim_separators): Implement. Make it a string
31699         concatenating all the commas together, just as they appear.
31700         (opt_dim_separators): Modify accordingly
31701         (rank_specifiers): Update accordingly. Basically do the same
31702         thing - instead, collect the brackets here.
31703         (opt_rank_sepcifiers): Modify accordingly.
31704         (array_type): Modify to actually return the complete type string
31705         instead of ignoring the rank_specifiers.
31706         (expression_list): Implement to collect the expressions
31707         (variable_initializer): Implement. We make it a list of expressions
31708         essentially so that we can handle the array_initializer case neatly too.
31709         (variable_initializer_list): Implement.
31710         (array_initializer): Make it a list of variable_initializers
31711         (opt_array_initializer): Modify accordingly.
31712
31713         * expression.cs (New::NType): Add enumeration to help us
31714         keep track of whether we have an object/delegate creation
31715         or an array creation.
31716         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31717         members to hold data about array creation.
31718         (New:New): Modify to update NewType
31719         (New:New): New Overloaded contructor for the array creation
31720         case.
31721
31722         * cs-parser.jay (array_creation_expression): Implement to call
31723         the overloaded New constructor.
31724
31725 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31726
31727         * class.cs (TypeContainer::Constructors): Return member
31728         constructors instead of returning null.
31729
31730 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31731
31732         * typemanager.cs (InitCoreTypes): Initialize the various core
31733         types after we have populated the type manager with the user
31734         defined types (this distinction will be important later while
31735         compiling corlib.dll)
31736
31737         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31738         on Expression Classification.  Now all expressions have a method
31739         `Resolve' and a method `Emit'.
31740
31741         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31742         generation from working.     Also add some temporary debugging
31743         code. 
31744
31745 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31746
31747         * codegen.cs: Lots of code generation pieces.  This is only the
31748         beginning, will continue tomorrow with more touches of polish.  We
31749         handle the fundamentals of if, while, do, for, return.  Others are
31750         trickier and I need to start working on invocations soon.
31751
31752         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31753         s.InitStatement. 
31754
31755         * codegen.cs (EmitContext): New struct, used during code
31756         emission to keep a context.   Most of the code generation will be
31757         here. 
31758
31759         * cs-parser.jay: Add embedded blocks to the list of statements of
31760         this block.  So code generation proceeds in a top down fashion.
31761
31762 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31763
31764         * statement.cs: Add support for multiple child blocks.
31765
31766 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31767
31768         * codegen.cs (EmitCode): New function, will emit the code for a
31769         Block of code given a TypeContainer and its ILGenerator. 
31770
31771         * statement.cs (Block): Standard public readonly optimization.
31772         (Block::Block constructors): Link children. 
31773         (Block::Child): Child Linker.
31774         (Block::EmitVariables): Emits IL variable declarations.
31775
31776         * class.cs: Drop support for MethodGroups here, delay until
31777         Semantic Analysis.
31778         (Method::): Applied the same simplification that I did before, and
31779         move from Properties to public readonly fields.
31780         (Method::ParameterTypes): Returns the parameter types for the
31781         function, and implements a cache that will be useful later when I
31782         do error checking and the semantic analysis on the methods is
31783         performed.
31784         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31785         and made a method, optional argument tells whether this is a class
31786         or a structure to apply the `has-this' bit.
31787         (Method::GetCallingConvention): Implement, returns the calling
31788         convention. 
31789         (Method::Define): Defines the type, a second pass is performed
31790         later to populate the methods.
31791
31792         (Constructor::ParameterTypes): implement a cache similar to the
31793         one on Method::ParameterTypes, useful later when we do semantic
31794         analysis. 
31795
31796         (TypeContainer::EmitMethod):  New method.  Emits methods.
31797
31798         * expression.cs: Removed MethodGroup class from here.
31799
31800         * parameter.cs (Parameters::GetCallingConvention): new method.
31801
31802 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31803
31804         * class.cs (TypeContainer::Populate): Drop RootContext from the
31805         argument. 
31806
31807         (Constructor::CallingConvention): Returns the calling convention.
31808         (Constructor::ParameterTypes): Returns the constructor parameter
31809         types. 
31810
31811         (TypeContainer::AddConstructor): Keep track of default constructor
31812         and the default static constructor.
31813
31814         (Constructor::) Another class that starts using `public readonly'
31815         instead of properties. 
31816
31817         (Constructor::IsDefault): Whether this is a default constructor. 
31818
31819         (Field::) use readonly public fields instead of properties also.
31820
31821         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31822         track of static constructors;  If none is used, turn on
31823         BeforeFieldInit in the TypeAttributes. 
31824
31825         * cs-parser.jay (opt_argument_list): now the return can be null
31826         for the cases where there are no arguments. 
31827
31828         (constructor_declarator): If there is no implicit `base' or
31829         `this', then invoke the default parent constructor. 
31830
31831         * modifiers.cs (MethodAttr): New static function maps a set of
31832         modifiers flags into a MethodAttributes enum
31833         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31834         MethodAttr, TypeAttr to represent the various mappings where the
31835         modifiers are used.
31836         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31837
31838 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31839
31840         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31841         method arguments.
31842
31843         * interface.cs (PopulateIndexer): Implemented the code generator
31844         for interface indexers.
31845
31846 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31847
31848         * interface.cs (InterfaceMemberBase): Now we track the new status
31849         here.  
31850
31851         (PopulateProperty): Implement property population.  Woohoo!  Got
31852         Methods and Properties going today. 
31853
31854         Removed all the properties for interfaces, and replaced them with
31855         `public readonly' fields. 
31856
31857 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31858
31859         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31860         initialize their hashtables/arraylists only when they are needed
31861         instead of doing this always.
31862
31863         * parameter.cs: Handle refs and out parameters.
31864
31865         * cs-parser.jay: Use an ArrayList to construct the arguments
31866         instead of the ParameterCollection, and then cast that to a
31867         Parameter[] array.
31868
31869         * parameter.cs: Drop the use of ParameterCollection and use
31870         instead arrays of Parameters.
31871
31872         (GetParameterInfo): Use the Type, not the Name when resolving
31873         types. 
31874
31875 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31876
31877         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31878         and instead use public readonly fields.
31879
31880         * class.cs: Put back walking code for type containers.
31881
31882 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31883
31884         * class.cs (MakeConstant): Code to define constants.
31885
31886         * rootcontext.cs (LookupType): New function.  Used to locate types 
31887
31888
31889 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31890
31891         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31892         this System.Reflection code is.  Kudos to Microsoft
31893
31894         * typemanager.cs: Implement a type cache and avoid loading all
31895         types at boot time.  Wrap in LookupType the internals.  This made
31896         the compiler so much faster.  Wow.  I rule!
31897
31898         * driver.cs: Make sure we always load mscorlib first (for
31899         debugging purposes, nothing really important).
31900
31901         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31902         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31903
31904         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31905         on namespaces that have been imported using the `using' keyword.
31906
31907         * class.cs (TypeContainer::TypeAttr): Virtualize.
31908         (Class::TypeAttr): Return attributes suitable for this bad boy.
31909         (Struct::TypeAttr): ditto.
31910         Handle nested classes.
31911         (TypeContainer::) Remove all the type visiting code, it is now
31912         replaced with the rootcontext.cs code
31913
31914         * rootcontext.cs (GetClassBases): Added support for structs. 
31915
31916 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31917
31918         * interface.cs, statement.cs, class.cs, parameter.cs,
31919         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31920         Drop use of TypeRefs, and use strings instead.
31921
31922 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31923
31924         * rootcontext.cs: 
31925
31926         * class.cs (Struct::Struct): set the SEALED flags after
31927         checking the modifiers.
31928         (TypeContainer::TypeAttr): new property, returns the
31929         TypeAttributes for a class.  
31930
31931         * cs-parser.jay (type_list): Oops, list production was creating a
31932         new list of base types.
31933
31934         * rootcontext.cs (StdLib): New property.
31935         (GetInterfaceTypeByName): returns an interface by type name, and
31936         encapsulates error handling here.
31937         (GetInterfaces): simplified.
31938         (ResolveTree): Encapsulated all the tree resolution here.
31939         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31940         types. 
31941
31942         * driver.cs: Add support for --nostdlib, to avoid loading the
31943         default assemblies.
31944         (Main): Do not put tree resolution here. 
31945
31946         * rootcontext.cs: Beginning of the class resolution.
31947
31948 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31949
31950         * rootcontext.cs: Provide better error reporting. 
31951
31952         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31953
31954         * rootcontext.cs (CreateInterface): Handle the case where there
31955         are no parent interfaces.
31956
31957         (CloseTypes): Routine to flush types at the end.
31958         (CreateInterface): Track types.
31959         (GetInterfaces): Returns an array of Types from the list of
31960         defined interfaces.
31961
31962         * typemanager.c (AddUserType): Mechanism to track user types (puts
31963         the type on the global type hash, and allows us to close it at the
31964         end). 
31965
31966 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31967
31968         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31969         RecordInterface instead.
31970
31971         * cs-parser.jay: Updated to reflect changes above.
31972
31973         * decl.cs (Definition): Keep track of the TypeBuilder type that
31974         represents this type here.  Not sure we will use it in the long
31975         run, but wont hurt for now.
31976
31977         * driver.cs: Smaller changes to accomodate the new code.
31978
31979         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31980         when done. 
31981
31982         * rootcontext.cs (CreateInterface):  New method, used to create
31983         the System.TypeBuilder type for interfaces.
31984         (ResolveInterfaces): new entry point to resolve the interface
31985         hierarchy. 
31986         (CodeGen): Property, used to keep track of the code generator.
31987
31988 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31989
31990         * cs-parser.jay: Add a second production for delegate_declaration
31991         with `VOID'.
31992
31993         (enum_body): Put an opt_comma here instead of putting it on
31994         enum_body or enum_member_declarations so we can handle trailing
31995         commas on enumeration members.  Gets rid of a shift/reduce.
31996
31997         (type_list): Need a COMMA in the middle.
31998
31999         (indexer_declaration): Tell tokenizer to recognize get/set
32000
32001         * Remove old targets.
32002
32003         * Re-add the parser target.
32004
32005 2001-07-13  Simon Cozens <simon@simon-cozens.org>
32006
32007         * cs-parser.jay: Add precendence rules for a number of operators
32008         ot reduce the number of shift/reduce conflicts in the grammar.
32009
32010 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
32011
32012         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
32013         and put it here.
32014
32015         Get rid of old crufty code.
32016
32017         * rootcontext.cs: Use this to keep track of the parsed
32018         representation and the defined types available to the program. 
32019
32020         * gen-treedump.cs: adjust for new convention.
32021
32022         * type.cs: Split out the type manager, and the assembly builder
32023         from here. 
32024
32025         * typemanager.cs: the type manager will live here now.
32026
32027         * cil-codegen.cs: And the code generator here. 
32028
32029 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
32030
32031         * makefile: Fixed up for easy making.
32032
32033 2001-07-13  Simon Cozens <simon@simon-cozens.org>
32034
32035         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
32036         the 
32037
32038         (unary_expression): Expand pre_increment_expression and
32039         post_decrement_expression to reduce a shift/reduce.
32040
32041 2001-07-11  Simon Cozens
32042
32043         * cs-tokenizer.cs: Hex numbers should begin with a 0.
32044
32045         Improve allow_keyword_as_indent name.
32046
32047 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
32048
32049         * Adjustments for Beta2. 
32050
32051 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
32052
32053         * decl.cs: Added `Define' abstract method.
32054         (InTransit): new property, used to catch recursive definitions. 
32055
32056         * interface.cs: Implement `Define'. 
32057
32058         * modifiers.cs: Map Modifiers.constants to
32059         System.Reflection.TypeAttribute flags.
32060
32061         * class.cs: Keep track of types and user-defined types.
32062         (BuilderInit): New method for creating an assembly
32063         (ResolveType): New function to launch the resolution process, only
32064         used by interfaces for now.
32065
32066         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
32067         that are inserted into the name space. 
32068
32069 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
32070
32071         * ARGH.  I have screwed up my tree so many times due to the use of
32072         rsync rather than using CVS.  Going to fix this at once. 
32073
32074         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
32075         load types.
32076
32077 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
32078
32079         * Experiment successful: Use System.Type rather that our own
32080         version of Type.  
32081
32082 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
32083
32084         * cs-parser.jay: Removed nsAliases from here.
32085
32086         Use new namespaces, handle `using XXX;' 
32087
32088         * namespace.cs: Reimplemented namespace handling, use a recursive
32089         definition of the class.  Now we can keep track of using clauses
32090         and catch invalid using clauses.
32091
32092 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
32093
32094         * gen-treedump.cs: Adapted for all the renaming.
32095
32096         * expression.cs (Expression): this class now has a Type property
32097         which returns an expression Type.
32098
32099         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32100         `Type', as this has a different meaning now in the base
32101
32102 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
32103
32104         * interface.cs, class.cs: Removed from all the sources the
32105         references to signature computation, as we can not do method
32106         signature computation during the parsing time, as we are not
32107         trying to solve at that point distinguishing:
32108
32109         class X {
32110                 void a (Blah x) {}
32111                 void a (NS.Blah x) {}
32112         }
32113
32114         Which depending on the context might be valid or not, as we do not
32115         know if Blah is the same thing as NS.Blah at that point.
32116
32117         * Redid everything so the code uses TypeRefs now instead of
32118         Types.  TypeRefs are just temporary type placeholders, that need
32119         to be resolved.  They initially have a pointer to a string and the
32120         current scope in which they are used.  This is used later by the
32121         compiler to resolve the reference to an actual Type. 
32122
32123         * DeclSpace is no longer a CIR.Type, and neither are
32124         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
32125         are all DeclSpaces, but no Types. 
32126
32127         * type.cs (TypeRefManager): This implements the TypeRef manager,
32128         which keeps track of all the types that need to be resolved after
32129         the parsing has finished. 
32130
32131 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
32132
32133         * ARGH.  We are going to have to store `foreach' as a class rather
32134         than resolving it, as we need to verify error 1579 after name
32135         resolution.   *OR* we could keep a flag that says `This request to
32136         IEnumerator comes from a foreach statement' which we can then use
32137         to generate the error.
32138
32139 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
32140
32141         * class.cs (TypeContainer.AddMethod): we now add methods to the
32142         MethodGroup instead of the method hashtable.  
32143
32144         * expression.cs: Add MethodGroup abstraction, which gets us one
32145         step closer to the specification in the way we handle method
32146         declarations.  
32147
32148         * cs-parser.jay (primary_expression): qualified_identifier now
32149         tried to match up an identifier to a local variable reference or
32150         to a parameter reference.
32151
32152         current_local_parameters is now a parser global variable that
32153         points to the current parameters for the block, used during name
32154         lookup.
32155
32156         (property_declaration): Now creates an implicit `value' argument to
32157         the set accessor.
32158
32159 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
32160
32161         * parameter.cs: Do not use `param' arguments as part of the
32162         signature, per the spec.
32163
32164 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
32165
32166         * decl.cs: Base class for classes, structs and interfaces.  This
32167         is the "Declaration Space" 
32168
32169         * cs-parser.jay: Use CheckDef for checking declaration errors
32170         instead of having one on each function.
32171
32172         * class.cs: Factor out some code for handling error handling in
32173         accordance to the "Declarations" section in the "Basic Concepts"
32174         chapter in the ECMA C# spec.
32175
32176         * interface.cs: Make all interface member classes derive from
32177         InterfaceMemberBase.
32178
32179 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
32180
32181         * Many things: all interfaces are parsed and generated in
32182         gen-treedump.  Support for member variables, constructors,
32183         destructors, properties, constants is there.
32184
32185         Beginning of the IL backend, but very little done, just there for
32186         testing purposes. 
32187
32188 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
32189
32190         * cs-parser.jay: Fix labeled statement.
32191
32192         * cs-tokenizer.cs (escape): Escape " and ' always.
32193         ref_line, ref_name: keep track of the line/filename as instructed
32194         by #line by the compiler.
32195         Parse #line.
32196
32197 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
32198
32199         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32200         to match the values in System.CodeDOM.
32201
32202         Divid renamed to Divide.
32203
32204         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32205         statements. 
32206         (Statements.set): remove.
32207
32208         * System.CodeDOM/CodeCatchClause.cs: always have a valid
32209         statements. 
32210
32211         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32212         falseStatements always have valid values. 
32213
32214         * cs-parser.jay: Use System.CodeDOM now.
32215