2009-07-20 Jb Evain <jbevain@novell.com>
[mcs.git] / mcs / ChangeLog
blob67efeff60511c2e82818e5613c1d128077eddde9
1 2009-07-16  Marek Safar  <marek.safar@gmail.com>
3         * anonymous.cs: Split assignable and readonly generated variable
4         references.
6 2009-07-16  Marek Safar  <marek.safar@gmail.com>
8         A fix for bug #521671
9         * statement.cs: Fixed crash when checking missing type.
11 2009-07-16  Marek Safar  <marek.safar@gmail.com>
13         * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
14         assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
15         class.cs, driver.cs: Work on dynamic binding.
17         * dynamic.cs: New file.
19         * *.sources, *.proj: Updated.
21 2009-07-15  Marek Safar  <marek.safar@gmail.com>
23         * expression.cs (Conditional): Avoid double Resolve.
25 2009-07-13  Marcus Griep  <marcus@griep.us>
27         * ecore.cs: Fix obscure bug with resolving members of interfaces
28         that hide parent interface members. Fixes bug #444388 and corrects
29         bug #323096
31 2009-07-13  Marek Safar  <marek.safar@gmail.com>
33         * expression.cs (LocalVariableReference): Bounce resolve.
35 2009-07-10  Marek Safar  <marek.safar@gmail.com>
37         * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
38         expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
39         types to new class.
40         
41         * support.cs: New dynamic type wrapper.
43 2009-07-08  Marek Safar  <marek.safar@gmail.com>
45         * ecore.cs, cs-parser.jay: Better error reporting for implicitly
46         typed local variable.
48 2009-07-06  Marek Safar  <marek.safar@gmail.com>
50         A fix for bug #519005
51         * anonymous.cs: Use null_type as no return type placeholder.
53 2009-07-02  Marek Safar  <marek.safar@gmail.com>
55         * generic.cs: Handle type inference of identical type parameters
56         with different bounds.
58 2009-07-01  Marek Safar  <marek.safar@gmail.com>
60         * expression.cs, class.cs: Events variance.
61         
62         * cs-parser.jay: Interface events error messages.
64 2009-07-01  Marek Safar  <marek.safar@gmail.com>
66         * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
68 2009-06-29  Marek Safar  <marek.safar@gmail.com>
70         * parameter.cs, convert.cs, expression.cs, class.cs: Default
71         parameter expression can be value-type New.
73         * cs-parser.jay: Clean up too many parameter modifier boolean flags.
75 2009-06-26  Marek Safar  <marek.safar@gmail.com>
77         * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
78         Implemented C# 4.0 named arguments.
80 2009-06-24  Marek Safar  <marek.safar@gmail.com>
82         * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
83         expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
84         parameter modifier. Also fixes bug #515497.
86 2009-06-24  Marek Safar  <marek.safar@gmail.com>
88         * *.cs: Replaced ArrayList with Arguments in need of a nonsequential 
89         arguments expression to be implemented.
90         
91         *.sources: Add argument.cs
93 2009-06-23  Marek Safar  <marek.safar@gmail.com>
95         * parameter.cs: Moved GetParameterIndexByName to base class.
96         
97         * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
98         unused AType. Use argument's version of GetExpressionTree.
100 2009-06-22  Marek Safar  <marek.safar@gmail.com>
102         * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
103         arguments grammar.
105 2009-06-17  Marek Safar  <marek.safar@gmail.com>
107         A fix for bug #514096
108         * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
110 2009-06-17  Marek Safar  <marek.safar@gmail.com>
112         * expression.cs: The first multi-dimensional array nested array
113         initializers was not checked.
114         
115         * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
117 2009-06-17  Marek Safar  <marek.safar@gmail.com>
119         A fix for bug #513400
120         * nullable.cs (EmitEquality): Operands emit could be simplified for
121         built-in types when we now emit user operators differently.
123 2009-06-16  Marek Safar  <marek.safar@gmail.com>
125         * ecore.cs: Report inaccessible delegate methods correctly.
127 2009-06-16  Marek Safar  <marek.safar@gmail.com>
129         * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
130         cs-parser.jay: Implemented C# 4.0 optional parameters.
132 2009-06-16  Marek Safar  <marek.safar@gmail.com>
134         * driver.cs: Removed broken DefineManifestResource.
136 2009-06-16  Raja R Harinath  <harinath@hurrynot.org>
138         * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
139         Use $(BOOTSTRAP_PROFILE) instead.
141 2009-06-12  Jb Evain  <jbevain@novell.com>
143         * rootcontext.cs: add a Platform field.
144         * driver.cs: handle /platform.
145         * codegen.cs: pass the proper flags according to
146         the platform when saving the assembly.
148 2009-06-11  Marek Safar  <marek.safar@gmail.com>
150         * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
151         Add optional parameters grammar.
153 2009-06-10  Marek Safar  <marek.safar@gmail.com>
155         * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
156         driver.cs: Split lang version and metadata version.
158 2009-06-10  Marek Safar  <marek.safar@gmail.com>
160         * decl.cs: Better overload ctor collision error message.
162 2009-06-05  Jb Evain  <jbevain@novell.com>
164         * driver.cs (EmbededResource): avoid using an internal method
165         in gmcs to embed manifest resources.
167 2009-06-04  Sebastien Pouliot  <sebastien@ximian.com>
169         * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
170         the compiler from older mono versions (like moon's bots)
172 2009-06-04  Marek Safar  <marek.safar@gmail.com>
174         * namespace.cs (LookupTypeReflection): Ignore collisions between
175         forwarded types.
177 2009-06-04  Marek Safar  <marek.safar@gmail.com>
179         * codegen.cs: Enabled generic type forwarders.
181 2009-06-04  Marek Safar  <marek.safar@gmail.com>
183         * dmcs.*: Add another version of SRE compiler.
185 2009-06-03  Marek Safar  <marek.safar@gmail.com>
187         * generic.cs, typemanager.cs, parameter.cs, convert.cs,
188         generic-mcs.cs: Fixed variant type conversions.
190 2009-06-02  Marek Safar  <marek.safar@gmail.com>
192         A fix for bug #507863
193         * codegen.cs: Fixes a crash on invalid string value attribute.
195 2009-06-01  Marek Safar  <marek.safar@gmail.com>
197         A fix for bug #508334
198         * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
199         cs-parser.jay: Fully import __arglist modifier.
201 2009-05-29  Marek Safar  <marek.safar@gmail.com>
203         * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
204         delegate.cs, generic-mcs.cs: Rewrote type variance checks to
205         actually work with closed generic types.
207 2009-05-27  Alan McGovern  <amcgovern@novell.com>
209         * class.cs, decl.cs, delegate.cs, parameter.cs: 
210         Fix the build by replacing the use of 'var' with the actual type.
212 2009-05-27  Marek Safar  <marek.safar@gmail.com>
214         * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
215     cs-parser.jay, generic-mcs.cs: Report wrong variant types
216         declarations.
217           
218         * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
219         filter.
221 2009-05-26  Rodrigo Kumpera  <rkumpera@novell.com>
222                         Marek Safar  <marek.safar@gmail.com>
224         A fix for bug #377509
225         * parameter.cs: Use predefined and not empty name for implicit
226         setters.
228 2009-05-21  Marek Safar  <marek.safar@gmail.com>
230         * class.cs: Don't report wrong warnings for event fields.
232 2009-05-21  Marek Safar  <marek.safar@gmail.com>
234         A fix for bug #504667
235         * class.cs: Check for static class using parent container instead of
236         parent type.
238 2009-05-08  Marek Safar  <marek.safar@gmail.com>
240         A fix for bug #496922
241         * expression.cs: Always use temporary variable when using object
242         initializer.
244 2009-04-28  Marek Safar  <marek.safar@gmail.com>
246         A fix for bug #495112
247         * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
248         local cache.
250 2009-04-27  Miguel de Icaza  <miguel@novell.com>
252         * driver.cs: Add a flag to work as a replacement for CSC in VS.
254 2009-04-24  Miguel de Icaza  <miguel@novell.com>
256         * complete.cs: No idea how gonzalo got a null in the list, but
257         avoid crashing.
259 2009-04-24  Miguel de Icaza  <miguel@novell.com>
261         * complete.cs (CompletionElementInitializer): New completion class
262         to support completing inside a C# 3 element initializer, so this
263         allows completion for Silverlight situations where it is very
264         common to do:
266         new TextBlock () { Fo<TAB>
268         (CompletionSimpleName): Expose the prefix that was
269         passed to the simple name.
271         * cs-parser.jay (object_or_collection_initializer): Add support
272         for element_initializers.
274         * expression.cs (CollectionOrObjectInitializers.DoResolve):
275         special case completion expressions as this method aggressively
276         collects data before it operates, and errors were being thrown
277         earlier than we were able to complete.
279 2009-04-23  Miguel de Icaza  <miguel@novell.com>
281         * eval.cs: Make getcompletions silent and enable debugging output
282         if the -v option is passed.
284         * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
285         Consider looking up the namespace that matches the prefix being
286         used. 
288         This is part of the support for allowing completions like:
289         `System.Co<TAB>' to complete to System.Console.
291         * complete.cs (CompletionSimpleName.AppendResults): Make this
292         routine reusable.
294 2009-04-21  Raja R Harinath  <harinath@hurrynot.org>
296         * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
297         COMPLETE_COMPLETION as internal.
299 2009-04-17  Miguel de Icaza  <miguel@novell.com>
301         * complete.cs: Include namespace resolution in simple names as
302         well as global types and types in the using scope in the
303         resolution. 
305         * namespace.cs: Supporting infrastrcture to provide completions
306         based on the current using scope. 
308         * eval.cs: Introduce an entry point that allows for initialization
309         to return a list of the files passed on the command line.
311 2009-04-14  Marek Safar  <marek.safar@gmail.com>
313         A fix for bug #494243
314         * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
316 2009-04-13  Marek Safar  <marek.safar@gmail.com>
318         A fix for bug #493887
319         * statement.cs: Don't skip string multi-section with default or
320         null label when populating string hashtable.
322 2009-04-06  Marek Safar  <marek.safar@gmail.com>
324         A fix for bug #492329
325         * expression.cs (New): Load variable when assigning type parameter
326         to ref variable.
328 2009-04-06  Marek Safar  <marek.safar@gmail.com>
330         A fix for bug #488960
331         * decl.cs: Compare MVAR types using non-null values.
333 2009-03-27  Marek Safar  <marek.safar@gmail.com>
335         * typemanager.cs, expression.cs: Removed unused nullable checks.
337 2009-03-27  Marek Safar  <marek.safar@gmail.com>
339         * *.cs: Removed some gmcs conditionals.
341 2009-03-26  Marek Safar  <marek.safar@gmail.com>
343         * generic.cs, support.cs: Moved generics stuff out of support.cs
345 2009-03-24  Marek Safar  <marek.safar@gmail.com>
347         * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
348         DeclaringType.
350 2009-03-23  Marek Safar  <marek.safar@gmail.com>
352         * attribute.cs: Consider all members for error reporting when
353         checking named arguments.
355 2009-03-23  Marek Safar  <marek.safar@gmail.com>
357         A fix for bug #487625
358         * namespace.cs: Use a warning for all predefined type conflicts.
360 2009-03-23  Marek Safar  <marek.safar@gmail.com>
362         A fix for bug #485706
363         * statement.cs: Explicitly type catch type argument to pass verifier
364         check.
366 2009-03-22  Miguel de Icaza  <miguel@novell.com>
368         Initial support to provide code completion facilities to consumers
369         of the evaluator API.
370         
371         * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
372         support the completion engine.   When we reach the end of the
373         input stream instead of returning EOF, when this flag is true the
374         tokenizer instead produces:
376                 One GENERATE_COMPLETION token: this token then must be
377                 handled in the grammar at every point where the user
378                 would likely request a completion.
380                 As many COMPLETE_COMPLETION tokens as necessary.   These
381                 tokens are generated to assist the parser in unwinding and
382                 producing a valid parse tree.    
384         The parser rules do not have to be perfect, the parser needs to be
385         augmented with judicious use of GENERATE_COMPLETION tokens to
386         improve the areas where we can provide completion and the parser
387         needs to add support for COMPLETE_COMPLETION tokens in productions
388         to make them work.
390         It is common to not have enough support for COMPLETE_COMPLETION
391         under certain rules and that even if we generated the
392         GENERATE_COMPLETION token that the resulting tree will be invalid
393         due to the missing rules that support COMPLETE_COMPLETION.
395         The final EOF token is produced by having the parser notify the
396         tokenizer when it reaches the root production that the next token
397         should be EOF.
399         * support.cs (CompletionResult): New Exception.   This exception
400         is thrown to return the completion results when one of the special
401         completion expressions is reached.
403         This exception is thrown by the completing ExpressionStatements
404         classes that live in complete.cs
406         * complete.cs (CompletingExpression): a new base class for
407         completing expressions.   This derives from the
408         ExpressionStatement class and not from Expression as it allows
409         completion to happen not only where expressions are expected in
410         the grammar, but also where statements are expected.
412         (CompletionSimpleName): A new class used to provide completions
413         for SimpleNames.     This currently only resolves to local
414         variables from the evaluator context (GetVars call).
416         (CompletionMemberAccess): Implements support for completing member
417         access patterns. 
419         * cs-parser.jay: Add support for completion in a few places. 
421         * eval.cs (GetCompletions): New public API for the evaluator that
422         returns a list of possible completions given the input.   The
423         return value is an array of completions 
425         * anonymous.cs (Compatible): If the exception thrown from the
426         resolved expression is a CompletionResult exception let that one
427         through instead of printing a diagnostic error in the try/catch. 
428 <       
429 2009-03-22  Miguel de Icaza  <miguel@novell.com>
431         * 
433         * driver.cs (Main): Use Environment.Exit to quit quickly and
434         prevent the compiler from doing the usual wait for helper thread
435         to terminate.  
437         This is to prevent a slowdown that was reported by Gonzalo on
438         ASP.NET 
440 2009-03-19  Marek Safar  <marek.safar@gmail.com>
442         * ecore.cs: Load build-in types directly instead of accessing
443         an internal field.
445 2009-03-18  Marek Safar  <marek.safar@gmail.com>
447         * ecore.cs: Always use unbox.any when available.
449 2009-03-18  Marek Safar  <marek.safar@gmail.com>
451         * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
453 2009-03-17  Marek Safar  <marek.safar@gmail.com>
455         * generic.cs: Removed obsolete version of type inference.
457 2009-03-16  Marek Safar  <marek.safar@gmail.com>
459         * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
460         expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
461         delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
462         attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
464 2009-03-11  Marek Safar  <marek.safar@gmail.com>
466         A fix for bug #482996
467         * anonymous.cs: Make sure we are not infering return type when
468         checking type compatibility.
470 2009-03-11  Marek Safar  <marek.safar@gmail.com>
472         * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
473         rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
474         generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
475         attributes in their own structure. Needed when accessing their
476         properties before they are resolved.
478 2009-03-09  Marek Safar  <marek.safar@gmail.com>
480         * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
481         hashtable (~10x faster).
482         
483         * driver.cs: Removed wrong Reset.
485 2009-03-08  Marek Safar  <marek.safar@gmail.com>
487         * class.cs: Use correct common base type for unmanaged delayed
488         check.
490         * rootcontext.cs: Wrap unhandled exception.
492 2009-03-06  Raja R Harinath  <harinath@hurrynot.org>
494         Make SeekableStreamReader self-tuning and arbitrarily seekable
495         * support.cs (SeekableStreamReader.ResetStream): New.  Allocates
496         the buffer.
497         (SeekableStreamReader.Position.set): Use it.  Simplify logic
498         which, as a side-effect, makes it arbitrarily-seekable.  Tune the
499         buffer size when the stream needs to be re-read from the beginning.
501 2009-03-05  Marek Safar  <marek.safar@gmail.com>
503         A fix for bug #480100
504         * parameter.cs: A parameter is not hoisted when used directly as ET.
506 2009-03-04  Marek Safar  <marek.safar@gmail.com>
508         * statement.cs: Fixed an issue when using variable is of interface
509         type.
511 2009-03-03  Marek Safar  <marek.safar@gmail.com>
513         A fix for bug #480319
514         * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
516 2009-03-03  Marek Safar  <marek.safar@gmail.com>
518         A fix for bug #480867
519         * typemanager.cs, expression.cs, ecore.cs: Changed method group
520         expression to have no valid type.
522 2009-03-03  Marek Safar  <marek.safar@gmail.com>
524         A fix for bug #481258
525         * class.cs: Set extension method flag in partial container.
527 2009-03-03  Marek Safar  <marek.safar@gmail.com>
529         * statement.cs, typemanager.cs: Use expression for StringEmitter.
530         
531         * attribute.cs: Add sanity check.
533 2009-02-27  Marek Safar  <marek.safar@gmail.com>
535         * class.cs: Add external constructor error.
537 2009-02-26  Marek Safar  <marek.safar@gmail.com>
539         A fix for bug #475354
540         * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
541         correctly user defined nullable equality operators.
543 2009-02-25  Marek Safar  <marek.safar@gmail.com>
545         A fix for bug #479532
546         * expression.cs: Implement NewInitialize::AddressOf.
548 2009-02-25  Marek Safar  <marek.safar@gmail.com>
550         A fix for bug #413633
551         * expression.cs: Iterate all base class-constraint types.
553 2009-02-24  Marek Safar  <marek.safar@gmail.com>
555         A fix for bug #479209
556         * literal.cs: Mutate null underlying type.
558 2009-02-24  Marek Safar  <marek.safar@gmail.com>
560         A fix for bug #476295
561         * convert.cs: Avoid wrapping implicitly convertible reference type.
563 2009-02-23  Marek Safar  <marek.safar@gmail.com>
565         * iterators.cs: Create MemberName correctly.
567 2009-02-23  Marek Safar  <marek.safar@gmail.com>
569         A fix for bug #478655
570         * literal.cs: Check also underlying null type conversion.
572 2009-02-21  Marek Safar  <marek.safar@gmail.com>
574         * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
576 2009-02-20  Marek Safar  <marek.safar@gmail.com>
578         A fix for bug #477447
579         * statement.cs: Add reference to correct parent storey when this
580         is accessible from deep children storey (more than 1 level).
582 2009-02-19  Marek Safar  <marek.safar@gmail.com>
584         A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
585         * class.cs: Define base type members before setting up member cache.
587 2009-02-18  Marek Safar  <marek.safar@gmail.com>
589         A fix for bug #477378
590         * nullable.cs, expression.cs, statement.cs: More precise null type
591         sanity checks.
593 2009-02-18  Marek Safar  <marek.safar@gmail.com>
595         A fix for bug #472805
596         * typemanager.cs, namespace.cs: Import only visible extension method
597         types.
599 2009-02-18  Marek Safar  <marek.safar@gmail.com>
601         A fix for bug #476895
602         * attribute.cs: Use correct resolve context for attribute type.
604 2009-02-18  Marek Safar  <marek.safar@gmail.com>
606         A fix for bug #476266
607         * anonymous.cs: Mutate multi-dimensional arrays.
609 2009-02-18  Marek Safar  <marek.safar@gmail.com>
611         A fix for bug #476400
612         * statement.cs, expression.cs: Removed wrong Dispose optimization.
614 2009-02-18  Marek Safar  <marek.safar@gmail.com>
616         A fix for bug #476811
617         * generics.cs: Fixed null-literal check.
619 2009-02-17  Marek Safar  <marek.safar@gmail.com>
621         * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
622         expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
623         messing with static variables.
625 2009-02-16  Marek Safar  <marek.safar@gmail.com>
627         A fix for bug #475965
628         * generics.cs: Check generic parameter type after extracting from
629         Expression<T>.
631 2009-02-16  Marek Safar  <marek.safar@gmail.com>
633         A fix for bug #475823
634         * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
635         typed-null support.
637 2009-02-14  Marek Safar  <marek.safar@gmail.com>
639         * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
640         Simplified event field definition using backing field and not
641         field builder directly.
643         * expression.cs (EmitLdArg): Optimize fast paths.
645 2009-02-13  Marek Safar  <marek.safar@gmail.com>
647         A fix for bug #475327
648         * expression.cs (ArrayCreation): Don't mutate values optimized away.
650 2009-02-13  Marek Safar  <marek.safar@gmail.com>
652         A fix for bug #475342
653         * cs-parser.jay: Using 'super' instead of 'base' to call base
654         constructor crashes compiler.
656 2009-02-13  Marek Safar  <marek.safar@gmail.com>
658         A fix for bug #475354
659         * expression.cs (Constantify): Add nullable types.
660         
661         * const.cs (EmitDecimalConstant): Avoid explicit cast.
663 2009-02-12  Marek Safar  <marek.safar@gmail.com>
665         A fix for bug #475246
666         * expression.cs: More broken flowanalysis hacking needed.
668 2009-02-12  Marek Safar  <marek.safar@gmail.com>
670         * attribute.cs: Compare only ref/out array modifiers. 
672 2009-02-11  Marek Safar  <marek.safar@gmail.com>
674         * statement.cs: Use member cache when looking for foreach members.
676 2009-02-11  Marek Safar  <marek.safar@gmail.com>
678         * expression.cs: Don't expose internal initializer types.
679         
680         * statement.cs: Check also explicit conversions for goto case.
682 2009-02-11  Marek Safar  <marek.safar@gmail.com>
684         * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
686 2009-02-10  Marek Safar  <marek.safar@gmail.com>
688         * *.cs: Replace null-type with NullLiteral where appropriate.
690 2009-02-09  Marek Safar  <marek.safar@gmail.com>
692         * expression.cs: Initializer of reference argument use temporary
693         variable to be verifiable.
694         
695         * parameter.cs: Share EmitLdArg.
697 2009-02-09  Marek Safar  <marek.safar@gmail.com>
699         A fix for bug #473559
700         * class.cs: Fixed: Not reporting error about nested class with the
701         same name.
703 2009-02-06  Scott Peterson  <lunchtimemama@gmail.com>
705         Contributed under the MIT/X11 license.
707         * generic.cs: Added VerifyVariantTypeParameters which performs new
708         variance verification logic. The old logic, based on the spec, was
709         wrong because the spec is full of LIES!
711         * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
713         *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
715         * class.cs:
716         * ecore.cs: Added calls to the new variance verification logic.
718         * parameter.cs:
719         * delegate.cs: Removed calls to the old variance verification logic.
721 2009-02-06  Marek Safar  <marek.safar@gmail.com>
723         * delegate.cs: Use cached Invoke method directly.
725 2009-02-06  Marek Safar  <marek.safar@gmail.com>
727         * expression.cs: Emit expression tree for hoisted variable access.
729 2009-02-04  Marek Safar  <marek.safar@gmail.com>
731         * namespace.cs: Add better extension class check.
733 2009-02-05  Scott Peterson  <lunchtimemama@gmail.com>
735         * generic.cs: Fixed typeo (TypeParameter.Variacne).
737 2009-02-04  Scott Peterson  <lunchtimemama@gmail.com>
739         This patch adds initial generic variance support to the compiler.
740         It is contributed under the MIT/X11 license.
742         * typemanager.cs: Modified ImplementsInterface to check variance.
743         Added VerifyVariantTypeParameters which checks the specified type to see
744         if it uses a variant type parameter as a type argument (which is not
745         allowed). Added IsVariantOf which determins if the first type is a
746         variant of the second. NOTE: This only supports reference types at
747         the moment to conform with the current level of VM support. When the
748         VM supports value types, this will follow step.
750         * generic.cs: Added the Variance enum. Added a Variance property to
751         TypeParameter and added variance support to definition phase. Added a
752         Variance property to TypeParameterName. Also check to make sure that
753         no variant types appear in generic method parameters.
755         * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
756         keywords if the langversion supports it.
758         * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
759         that variant types are only used in legal positions. Also added
760         ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
761         parameters.
763         * decl.cs: Construct TypeParameter with the variance information.
765         * convert.cs: Checks variance in ImplicitReferenceConversionExists
766         and ImplicitConversionStandard.
768         * rootcontext.cs: Added new "Future" language version.
770         * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
771         type parameters are not used as type arguments in interface inheritance.
772         In MemberBase.DoMemberDependentChecks, ensure that contravariant type
773         parameters are not used as method return types. In MemberBase.
774         ResolveMemberType, ensure that variant type parameters are not used
775         as type arguments. Also call VerifyNoVariantTypeParameters on every
776         set of parameters which are resolved.
778         * delegate.cs: Modified Delegate.Define to ensure that variant
779         parameters are not used as type arguments and that a contravariant
780         parameter is not used as the return type. Also call
781         VerifyNoVariantTypeParameters on the delegate parameters.
783         * cs-parser.jay: Modified grammar to support "in" and "out" keywords
784         to specify generic variance.
786         * driver.cs: Added support for LanguageVersion.Future in the form of
787         "-langversion:future".
789         * generic-mcs.cs: Stubbed out new members in generic.cs.
791 2009-02-03  Marek Safar  <marek.safar@gmail.com>
793         * class.cs, generic.cs: Emit type parameter constraints for nested
794         types.
796 2009-02-02  Marek Safar  <marek.safar@gmail.com>
798         A fix for bug #471213
799         * class.cs: Avoid emitting backing field for abstract event fields.
801 2009-02-01  Marek Safar  <marek.safar@gmail.com>
803         A fix for bug #359731
804         * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
805         expressions.
807 2009-01-30  Marek Safar  <marek.safar@gmail.com>
809         A fix for bug #470767
810         * statement.cs: Introduced BlockScopeExpression, needed when 
811         expression tree conversion has to emit scope variables.
813 2009-01-29  Marek Safar  <marek.safar@gmail.com>
815         * class.cs: Remove duplicate CallingConvention.
817 2009-01-29  Marek Safar  <marek.safar@gmail.com>
819         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
820         when I finally found the right naming convention.
822 2009-01-29  Marek Safar  <marek.safar@gmail.com>
824         * cs-tokenizer.cs: Put back different open parens optimization.
826 2009-01-28  Marek Safar  <marek.safar@gmail.com>
828         A fix for bug #470227
829         * cs-tokenizer.cs: Remove too agressive parser optimization.
831 2009-01-28  Marek Safar  <marek.safar@gmail.com>
833         A fix for bug #324319
834         * class.cs: Remove too early base type resolve.
836 2009-01-27  Marek Safar  <marek.safar@gmail.com>
838         A fix for bug #324319
839         * ecore.cs: Explicitly type null when assigning to type argument to
840         make pass verifier check.
842 2009-01-27  Marek Safar  <marek.safar@gmail.com>
844         * anonymous.cs: Fixed recent regression when initializing captured 
845         this.
847 2009-01-26  Marek Safar  <marek.safar@gmail.com>
849         A fix for bug #469019
850         * anonymous.cs: Use all parent type parameters when instantiating
851         nested generic storey.
853 2009-01-26  Marek Safar  <marek.safar@gmail.com>
855         * expression.cs: Check for null instance methodgroup expression.
857 2009-01-26  Marek Safar  <marek.safar@gmail.com>
859         A fix for bug #469244
860         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
861         instance inside a conditional expression.
863 2009-01-23  Marek Safar  <marek.safar@gmail.com>
865         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
866         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
867         GetElementType and HasElementType. IsValueType clean up.
869 2009-01-23  Marek Safar  <marek.safar@gmail.com>
871         * nullable.cs: Use common EmitCall.
872         
873         * expression.cs: Emit constraint. for virtual calls only.
875 2009-01-23  Marek Safar  <marek.safar@gmail.com>
877         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
878         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
879         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
880         checks.
882 2009-01-22  Jb Evain  <jbevain@novell.com>
884         * anonymous.cs: make anonymous types' ToString implementation
885         match what csc outputs.
887 2009-01-21  Marek Safar  <marek.safar@gmail.com>
889         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
890         up.
892 2009-01-17  Marek Safar  <marek.safar@gmail.com>
894         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
895         verifier checks.
897 2009-01-16  Marek Safar  <marek.safar@gmail.com>
899         * nullable.cs (LiftedBinaryOperator): Check for all possible null
900         expressions.
902 2009-01-15  Marek Safar  <marek.safar@gmail.com>
904         A fix for bug #466634
905         * statement.cs: Add reference for nested storey when only this
906         is captured.
908 2009-01-15  Marek Safar  <marek.safar@gmail.com>
910         A fix for bug #466474
911         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
912         was specified.
914 2009-01-15  Marek Safar  <marek.safar@gmail.com>
916         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
917         Fixed nested stories parent referencing process. Also fixes #463985.
919 2009-01-06  Marek Safar  <marek.safar@gmail.com>
921         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
922         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
923         implementation. Also fixes #463108.
925 2009-01-05  Marek Safar  <marek.safar@gmail.com>
927         A fix for bug #416109
928         * decl.cs: Issue correct CLSAttribute warning location.
930 2009-01-05  Marek Safar  <marek.safar@gmail.com>
932         A fix for bug #456775
933         * attribute.cs: Use attribute owner scope when resolving attribute
934         arguments.
936 2009-01-05  Marek Safar  <marek.safar@gmail.com>
938         A fix for bug #457257
939         * decl.cs: Fixed incorrect member declaring type comparison.
941 2009-01-05  Marek Safar  <marek.safar@gmail.com>
943         A fix for bug #460896
944         * driver.cs: Handle /RES resources as embeddable.
946 2009-01-05  Marek Safar  <marek.safar@gmail.com>
948         A fix for bug #462515
949         * ecore.cs: Report inacessible members upwards.
951 2009-01-05  Marek Safar  <marek.safar@gmail.com>
953         A fix for bug #463190, #463192
954         * decl.cs, namespace.cs: Also import internal extension classes.
956 2009-01-04  Marek Safar  <marek.safar@gmail.com>
958         A fix for bug #463415
959         * generic.cs: Use right index for RemoveDependentTypes.
961 2009-01-02  Marek Safar  <marek.safar@gmail.com>
963         A fix for bug #463196
964         * expression.cs: Fixed enum to null comparison.
966 2009-01-02  Marek Safar  <marek.safar@gmail.com>
968         A fix for bug #463121
969         * nullable.cs: Fixed nullable user equality operator comparison.
971 2009-01-02  Marek Safar  <marek.safar@gmail.com>
973         A fix for bug #462950
974         * class.cs, decl.cs: Use full explicit name when defining automatic
975         property backing field.
977 2009-01-02  Marek Safar  <marek.safar@gmail.com>
979         A fix for bug #462592
980         * pending.cs: Emit type arguments for generic proxy method.
982 2008-12-30  Marek Safar  <marek.safar@gmail.com>
984         * expression.cs (As): Mutate all type arguments.
986 2008-12-29  Marek Safar  <marek.safar@gmail.com>
988         A fix for bug #462622
989         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
990         context.
992 2008-12-29  Marek Safar  <marek.safar@gmail.com>
994         A fix for bug #450782
995         * ecore.cs: Consider more variables of form V.I to be fixed.
997 2008-12-29  Marek Safar  <marek.safar@gmail.com>
999         A fix for bug #460712
1000         * typemanager.cs: Core types could be imported.
1002 2008-12-28  Marek Safar  <marek.safar@gmail.com>
1004         A fix for bugs #460847, #460772, #458049, #457339, #447807
1005         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
1006         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
1007         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
1008         user lambdas used inside query clauses.
1010 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1012         A fix for bug #460229
1013         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
1015 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1017         A fix for bug #459952
1018         * decl.cs, namespace.cs: Use common CheckAccessLevel.
1020 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1022         A fix for bug #459630
1023         * convert.cs: Enum to valuetype conversion is not allowed.
1025 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1027         A fix for bug #457087
1028         * generic.cs: Don't crash when constraint comes from type
1029         declaration.
1031 2008-12-16  Marek Safar  <marek.safar@gmail.com>
1033         A fix for bug #459221
1034         * anonymous.cs, statement.cs: Delay only captured this
1035         initialization.
1037 2008-12-12  Marek Safar  <marek.safar@gmail.com>
1039         A fix for bug #457489
1040         * anonymous.cs, statement.cs: Split anonymous storey instantiation
1041         and initialization to capture scope initializers correctly.
1043 2008-12-11  Marek Safar  <marek.safar@gmail.com>
1045         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
1046         ParameterReference refactoring.
1048 2008-12-03  Marek Safar  <marek.safar@gmail.com>
1050         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
1051         to be imported from any assembly.
1053 2008-12-03  Marek Safar  <marek.safar@gmail.com>
1055         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
1056         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
1057         from anonymous method and lambda expression.
1059 2008-12-01  Marek Safar  <marek.safar@gmail.com>
1061         A fix for bug #448560
1062         * expression.cs (As): Box any generic type arguments to be
1063         verifiable.
1065 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
1067         Add tripwire for implicit conversion bugs
1068         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
1069         for CS1501 error.
1070         (MethodGroupExpr.OverloadResolve): Add sanity check between
1071         IsApplicable and VerifyArgumentsCompat.
1072         (VerifyArgumentsCompat): Report CS1501 where appropriate.
1074 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
1076         Fix build break in System.Data_test
1077         * convert.cs (ImplicitConversionExists): Move NullLiteral
1078         conversions ...
1079         (ImplicitStandardConversionExists): ... here.
1081 2008-11-28  Marek Safar  <marek.safar@gmail.com>
1083         * literal.cs: Emit correctly explicit null to nullable cast.
1085 2008-11-28  Marek Safar  <marek.safar@gmail.com>
1087         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
1088         resolve.
1090 2008-11-28  Marek Safar  <marek.safar@gmail.com>
1092         A fix for bug #449005
1093         * convert.cs, nullable.cs: Use only one implicit nullable
1094         conversion.
1096 2008-11-27  Marek Safar  <marek.safar@gmail.com>
1098         * convert.cs, literal.cs: More Convert cleanup is needed.
1100 2008-11-27  Marek Safar  <marek.safar@gmail.com>
1102         * decl.cs, class.cs: Fixed misleading error message.
1104 2008-11-26  Marek Safar  <marek.safar@gmail.com>
1106         A fix for bug #449005
1107         * nullable.cs (EmitEquality): Disable optimization for user operator
1108         operands.
1110 2008-11-25  Marek Safar  <marek.safar@gmail.com>
1112         A fix for bug #447027
1113         * anonymous.cs (HoistedVariable): Cache also outer access to deal
1114         with context variables stored as expression instances.
1116 2008-11-25  Marek Safar  <marek.safar@gmail.com>
1118         A fix for bug #447027
1119         * delegate.cs: Fixed delegate VerifyMethod logic.
1121 2008-11-24  Marek Safar  <marek.safar@gmail.com>
1123         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
1124         but not verifiable.
1126 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1128         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
1129         member type resolve to follow normal flow, instead of random
1130         property access.
1132 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1134         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
1135         type.
1137 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1139         * const.cs: Emit decimal array constant as literal.
1141 2008-11-20  Marek Safar  <marek.safar@gmail.com>
1143         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
1145 2008-11-19  Marek Safar  <marek.safar@gmail.com>
1147         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
1148         into real property (saves 8 MB for corlib compilation).
1150 2008-11-19  Marek Safar  <marek.safar@gmail.com>
1152         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
1153         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
1154         generic-mcs.cs: Small cleanup of TypeArguments.
1156 2008-11-18  Marek Safar  <marek.safar@gmail.com>
1158         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
1159         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
1160         of ConstructedType expression, renamed to GenericTypeExpr.
1162 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1164         A fix for bug #445303
1165         * location.cs (IsConditionalDefined): Handle undefined global
1166         defines.
1168 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1170         A fix for bug #444678
1171         * expression.cs (TryReduceConstant): Always create new constant
1172         instance.
1174 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1176         A fix for bug #444673
1177         * ecore.cs: Ignore open generic types when used as generic type
1178         instance fields.
1180 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1182         A fix for bug #445458
1183         * expression.cs, cs-parser.jay: Don't crash when an expression
1184         statement is null.
1186 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1188         A fix for bug #445464
1189         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
1190         inside unbound type.
1192 2008-11-14  Jb Evain  <jbevain@novell.com>
1194         * driver.cs: ignore empty -nowarn argument such as
1195         the one in -nowarn:12,13,,.
1197 2008-11-13  Marek Safar  <marek.safar@gmail.com>
1199         A fix for bug #444271
1200         * anonymous.cs: Rescan parent storeys when best candidate was
1201         undone.
1203 2008-11-13  Marek Safar  <marek.safar@gmail.com>
1205         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
1206         useless UnboundTypeExpression.
1207         
1208         * attribute.cs: Do check obsolete attribute on generic types.
1210 2008-11-12  Marek Safar  <marek.safar@gmail.com>
1212         A fix for bugs #425680, #400139
1213         * ecore.cs, expression.cs: Trying to do some almost_matched_members
1214         refactoring.
1216 2008-11-11  Marek Safar  <marek.safar@gmail.com>
1218         A fix for bug #435747
1219         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
1220         compound value types assignment. Few micro optimizations added.
1222 2008-11-10  Marek Safar  <marek.safar@gmail.com>
1224         A fix for bug #442610
1225         * anonymous.cs (MutateConstructor): More SRE hacking.
1227 2008-11-10  Marek Safar  <marek.safar@gmail.com>
1229         A fix for bug #442579
1230         * ecore.cs: Also initialize expanded form of a method with 1 params
1231         parameter.
1233 2008-11-06  Marek Safar  <marek.safar@gmail.com>
1235         * expression.cs (UnaryMutator): Do early l-side check.
1237 2008-11-05  Miguel de Icaza  <miguel@novell.com>
1239         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1240         Init, otherwise we would crash later on when checking for friend
1241         assemblies. 
1243         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1244         Otherwise we never get any meaningful information as to what
1245         failed. 
1247 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1249         A fix for bug #436318
1250         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1252 2008-11-05  Miguel de Icaza  <miguel@novell.com>
1254         * namespace.cs: Turns out that it was a really bad idea to hide
1255         the errors for namespaces not found here in eval mode.    
1257         * eval.cs: When we process using clauses, only enter those into
1258         the list of valid using clauses after they have been validated.   
1260         The above change gives the proper semantics: it does not
1261         senselessly report the same errors with broken using statements by
1262         never storing them in the first place when they are invalid.
1264 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1266         A fix for bug #421839
1267         * cs-parser.jay: Remove expression from coalesce rule to force lower
1268         priority than the assignment operator.
1270 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1272         A fix for bug #437875
1273         * nullable.cs: Compile correctly method group operand used with null
1274         coalescing operator.
1276 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1278         A fix for bug #434589
1279         * expression.cs (Binary): Ignore lifted conversions when at least
1280         one operand is of reference type.
1282 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1284         * cs-parser.jay: Better syntax error report.
1286 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1288         A fix for bug #436792
1289         * cs-parser.jay: Use GetLocation to access location.
1291 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1293         A fix for bug #440774
1294         * cs-parser.jay: Also set current_array_type when parsing local
1295         variables types.
1297 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1299         A fix for bug #440785
1300         * expression.cs (As): Don't resolve self modifing expression
1301         multiple times.
1303 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1305         A fix for bug #439447
1306         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1308 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1310         A fix for bug #437571
1311         * cs-parser.jay: Fixes internal error for invalid expression
1312         statements.
1314 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1316         * ecore.cs: Resolve correctly ambiguous params delegate methods.
1318 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1320         * generic.cs, anonymous.cs: Simplified GetDeclarations.
1322 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1324         * cs-tokenizer.cs: More precise cast parsing.
1326 2008-10-16  Martin Baulig  <martin@ximian.com>
1328         * anonymous.cs (AnonymousMethodStorey): Put back the
1329         `hoisted_locals' hashtable and use it in EmitType().
1331 2008-10-15  Marek Safar  <marek.safar@gmail.com>
1333         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1334         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1335         ~5MB for corlib.
1337 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1339         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1341 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1343         * statement.cs: Mutate scope initializers.
1345 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1347         * expression.cs: Use typeless value for This constant.
1348         
1349         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1351 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1353         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1354         tokenizer.
1356 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1358         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1359         type to type cast.
1361 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1363         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1364         parser and tokenizer. Fixes many ambiguities including #433258.
1366 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1368         * cs-parser.jay: Fixed missing accessor recovery.
1370 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1372         A fix for bug #433701
1373         * expression.cs: Better error message.
1375 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1377         * cs-parser.jay, expression.cs: Start reporting real parser errors.
1378         
1379         * Makefile: Disabled unused debug symbols.
1381         Also fixes: #320556, #321097, #321656, #321876, #351316
1383 2008-10-09  Miguel de Icaza  <miguel@novell.com>
1385         * eval.cs: rename "<interactive>" to "{interactive}", to work
1386         around a requirement in the compiler that this be a valid
1387         filename, and in Windows it is not (433886).
1389 2008-10-09  Marek Safar  <marek.safar@gmail.com>
1391         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1393 2008-10-08  Marek Safar  <marek.safar@gmail.com>
1395         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1396         cs-parser.jay: Generic type declaration and type arguments cleanup.
1398 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1400         * cs-parser.jay: Allow parsing weird array creation construct.
1402 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1404         * cs-parser.jay: Conflicts reduction.
1406 2008-10-04  Marek Safar  <marek.safar@gmail.com>
1408         * cs-parser.jay: Conflicts reduction.
1410 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
1412         Fix #398325
1413         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1414         property.  Add a 'count' hint about the use of the shared vector.
1415         Ensure that we don't leak out dirty bits.
1416         (UsageVector.MergeChild): Throw away information about variables
1417         in child vectors.
1418         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1420 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1422         A fix for bug #431746
1423         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1424         parameters when iterator is created.
1426 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1428         A fix for bug #431827
1429         * expression.cs: Fixed right based pointer arithmetic operations
1430         emit.
1432 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1434         A fix for bug #353779
1435         * assign.cs, expression.cs: Fixed compound assignment conversions.
1437 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1439         A fix for bug #375262
1440         * statement.cs: Refactor ArrayForeach to be usable with string
1441         indexer. Optimized single dimentional arrays foreach.
1443 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1445         A fix for bug #431255
1446         * anonymous.cs, expression.cs: Removed broken optimization.
1448 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1450         * anonymous.cs: Use full type parameters of parent generic
1451         containers. Removed unnecessary AddParentStoreyReference call.
1453 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1455         A fix for bug #324702
1456         * class.cs: Use better shorter names for explicit interface member
1457         implementations.
1459         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1461 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1462         
1463         * expression.cs: Use new interface to check fixed expression.
1465 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1467         A fix for bug #421101
1468         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1469         interface to check for fixed fixed-buffers.
1471 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1473         A fix for bug #429264
1474         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1475         
1476         * delegate.cs: Removed unnecessary casts.
1478 2008-09-30  Marek Safar  <marek.safar@gmail.com>
1480         A fix for bug #352151
1481         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1482         class.cs: Fixed already defined explicit interface members check.
1484 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
1486         cs-tokenizer.cs: Fix typo.
1488 2008-09-28  Miguel de Icaza  <miguel@novell.com>
1490         * eval.cs (InteractiveBase): The quit command now just sets a
1491         flag, instead of calling Environment.Exit(), it is milder on
1492         embedded hosts. 
1494         CompiledMethod is now in Mono.CSharp, not nested inside
1495         the Evaluator, it was inconvenient to use.
1497 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1499         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1500         code to be invoked without having to reparse.
1502 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1504         * ecore.cs: The recent changes to FieldExpr broke this as well.
1505         Fixes LINQ queries in the interactive shell.
1507         * Multiple files: indentation fixing for the Mono coding
1508         guidelines for the switch statement.
1510         * eval.cs: Make the Evaluator API thread safe.
1512 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1514         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1515         constructor parsing.
1517 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1519         A fix for bug #325326
1520         * statement.cs: Check possible mistaken empty statement using
1521         explicit blocks only.
1523 2008-09-25  Miguel de Icaza  <miguel@novell.com>
1525         * eval.cs (LoadAssembly, ReferenceAssembly): Call
1526         RootNamespace.ComputeNamespaces to update the internal list of
1527         namespaces, this is no longer done for us.
1529         (InteractiveBase): Use the Evaluator APIs instead of calling into
1530         Driver directly
1532 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1534         A fix for bug #429264
1535         * expression.cs: Missing mutator for access to multidimensional
1536         arrays.
1538 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1540         * class.cs, statement: Emit DebuggerHidden attribute for iterator
1541         entry wrapper.
1542         
1543         * driver.cs: Missing input argument check.
1545 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1547         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1548         expression.cs, statement.cs, rootcontext.cs, class.cs, 
1549         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1550         DefineMembers.
1552 2008-09-24  Miguel de Icaza  <miguel@novell.com>
1554         * ecore.cs (FieldExpr): Only initialize eclass when we return a
1555         fully constructed FieldExpr, fixes the regression introduced in
1556         the last commit.
1557         
1558         * ecore.cs, expression.cs: Plug back the eclass initialization as
1559         otherwise it regresses `csharp'. 
1561 2008-09-24  Marek Safar  <marek.safar@gmail.com>
1563         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1564         ecore.cs, attribute.cs: Moved obsolete method checks from emit
1565         phase to resolve phase. It resolves problems with expression trees
1566         and fixes bugs #323796, #325156.
1568 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1570         * codegen.cs: Report better error when symbol writer is missing.
1572 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1574         * codegen.cs: Set .NET symbol writer.
1575         
1576         * decl.cs: Guard against null generic arguments.
1577         
1578         * report.cs: Don't report exactly same additional details.
1580 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1582         A fix for bug #324917
1583         * cs-parser.jay: Add missing multidimensional non-expression type
1584         ranks.
1585         
1586 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1588         A fix for bug #428191
1589         * anonymous.cs: Create an outer generic fields also for non-storey
1590         anonymous methods.
1592 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1594         A fix for bug #378294
1595         * class.cs: Make fixed size buffers gmcs feature only.
1597 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1599         A fix for bug #355622, #324993
1600         * assign.cs, const.cs, class.cs: Create new EmitContext for each
1601         field initializer.
1603 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1605         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1606         error reporting.
1608 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1610         A fix for bug #416110
1611         * generic.cs: Struct constraint results in default ctor and
1612         ValueType base type constraint to be set.
1614 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1616         A fix for bug #423791
1617         * generic.cs: Fixed params output type type-inference.
1619 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1621         * cs-parser.jay, expression.cs: Fixed few expression crashes.
1622         
1623 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1625         * cs-tokenizer.cs: Don't break on extra partial modifier.
1627 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1629         A fix for bug #427592
1630         * generic.cs: Use common parameter resolve method.
1632 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1634         A fix for bug #414758
1635         * expression.cs, ecore.cs: Fixed crash when accessing non-static
1636         property.
1638 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1640         * driver.cs, namespace.cs: Read types and namespaces after all
1641         requested assemblies are loaded, fixes issues with System.Core
1642         auto-reference, and #419888.
1644 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1646         A fix for bug #417705
1647         * cs-parser.jay: Fixed as/is operator expression split.
1649 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1651         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1652         Fixed expression tree representation of empty new expression and
1653         new initializer expression.
1655 2008-09-18  Miguel de Icaza  <miguel@novell.com>
1657         * eval.cs: Remove warning, keep reference to driver around.
1659         * Hide fields that do not need to be public.
1661 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1663         A fix for bug #426385
1664         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1665         conversion for array elements.
1667 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1669         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1670         void parsing conflicts.
1672 2008-09-15  Marek Safar  <marek.safar@gmail.com>
1674         A fix for bug #425601
1675         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1676         System.Core only when there is no custom ExtensionAttribute
1677         implementation.
1679 2008-09-15  Miguel de Icaza  <miguel@novell.com>
1681         * namespace.cs: Do not report CS0246 (name
1683 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1685         A fix for bug #425669
1686         * generic.cs: Don't cache generic static anonymous method 
1687         containers.
1689 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1691         * generic.cs, class.cs, delegate.cs: Check recursive inherited
1692         conflicting constraints.
1694 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
1696         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1697         mcs too.
1699 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1701         * literal.cs, convert.cs, expression.cs, statement.cs: More null
1702         to null pointer conversion fixes.
1704 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1706         * cs-parser.jay, expression.cs: An implicitly typed local variable
1707         declarator cannot use an array initializer.
1709 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1711         * cs-parser.jay: Reduced number of printed tokens, add sorting.
1713 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1715         * generic.cs (InflatedConstraints): Don't crash when constraints
1716         are different.
1717         
1718         * cs-parser.jay: const_declarator is a block.
1720         * constant.cs: Check for not allowed NaN conversions.
1722 2008-09-10  Miguel de Icaza  <miguel@novell.com>
1724         * driver.cs: Drop --shell argument, the compiler is no longer a
1725         REPL. 
1727         * eval.cs: Move most of the code that deals with evaluation into
1728         this file and document the public API from repl.cs
1730         * repl.cs: Remove from here.
1731         
1732 2008-09-10  Marek Safar  <marek.safar@gmail.com>
1734         A fix for bug #424684
1735         * generic.cs: Generic class constraints must come first.
1737 2008-09-09  Miguel de Icaza  <miguel@novell.com>
1739         * cs-parser.jay: Improve error reporting for syntax errors in
1740         statements and expressions, we now report the expected tokens
1741         instead of reporting the useless "; expected".
1743         Drop the strings from the token declaration, it turns out that
1744         they did not do what I thought they did.  Instead they were adding
1745         two sets of tokens to the tables.
1747 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1749         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1750         delegate.cs: Share special type check.
1752 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1754         A fix for bug #423981
1755         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1757 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1759         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1760         ConvertImplicitly.
1762 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1764         A fix for bugs: #324750, #335946
1765         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
1766         lookup rule to determine ?-based tokens.
1768 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1770         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1771         expressions (like event adding or removing) end up here, so we
1772         need to treat those as statements.
1774         Add LoadAssembly method.
1776 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1778         * repl.cs: Add Time method.
1780 2008-09-05  Marek Safar  <marek.safar@gmail.com>
1782         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1784 2008-09-05  Miguel de Icaza  <miguel@novell.com>
1786         * repl.cs: Add workaround for old compilers.
1788 2008-09-04  Jb Evain  <jbevain@novell.com>
1790         * repl.cs (PrettyPrint): pretty print everything that
1791         implements IDictionary, as well as IEnumerables. Also,
1792         add a quit helper property.
1794 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1796         * constant.cs: Better error reporting for decimal literals.
1797         
1798         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1799         field attributes.
1800         
1801 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1802                         Miguel de Icaza  <miguel@novell.com>
1804         A fix for bug #422951
1805         * assign.cs (Assign.DoResolve): Perform the type conversions
1806         checks before we attempt to initialize `New' initializers. 
1808 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1810         A fix for bug #422853
1811         * delegate.cs (DelegateCreation): Add special handling for
1812         EmptyExpression.Null instance expression which is just another
1813         hack for undecided member instance exression.
1815 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1817         * expression.cs, ecore.cs: Emit full expression tree for reduced
1818         binary expressions.
1820 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1822         * expression.cs (This): Guard against multi-resolving.
1823         
1824         * ecore.cs, statement.cs (Throw): Simplified.
1825         
1826         * flowanalysis.cs: Also verify event fields.
1828 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1830         * assign.cs (Assign.DoResolve): Perform the type conversions
1831         checks before we attempt to initialize `New' initializers. 
1833         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1835         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1836         public. 
1838         * repl.cs: Update help.
1840 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1842         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1843         handling of the default config handling, including the special
1844         treatment of System.Core assembly. 
1846         Fixes the REPL processing for LINQ.
1848 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1850         A fix for bug #422507
1851         * expression.cs (UnboxCast): Add missing child expression mutator.
1853 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1855         * driver.cs: Don't self reference System.Core assembly.
1857 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1859         A fix for bug #422507
1860         * expression.cs (StringConcat): Add missing type mutator.
1862 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1864         * generic.cs (TypeInferenceContext): Follow equality rule for
1865         constructed type lower bound type inference.
1867 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1869         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1870         <dblank@cs.brynmawr.edu> which updates the cursor position on
1871         refresh.
1872         
1873 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1875         A fix for bug #367145
1876         * driver.cs: Fixed import of extension methods when using -noconfig
1877         option.
1879 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1881         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1882         version from non-generic implementation instead.
1884 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1886         A fix for bug #418908
1887         * class.cs: Use AddScopeStatement for field initializers.
1889 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1891         A fix for bug #415385
1892         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1894 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1896         A fix for bug #421736
1897         * iterators.cs: Don't crash on unreachable iterators.
1899 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1901         A fix for bug #421628
1902         * parameter.cs, attribute.cs: Clone also parameter attributes.
1904 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1906         * namespace.cs (LookupType): In EvalMode, try to replace
1907         the TypeBuilder from our cache with a Type as Reflection.Emit does
1908         not  like to mix code from older assemblies emitted and new
1909         assemblies emitted. 
1911         This sounds like a serious Mono bug that prevents multiple
1912         assemblies to be generated and consumed at the same time.
1914         * cs-parser.jay (push_current_class): Do not make interactive
1915         classes internal or private, make them public as we currently
1916         generate each new class in a new assembly.   
1918 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1920         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1921         remove types that are entered into the global namespace during
1922         parsing so that we can remove them on failure.
1924         * cs-parser.jay: Parsing: we now keep track of types that are
1925         entered into global variables and queue those in case the parsing
1926         or resolution fail.
1928         This happens in a few situations: during partial-input, we invoke
1929         the parser repeatedly for example with the string "class X", this
1930         would cause X to be registed, and we need to remove this
1931         registration so that another parse attempt later with say "class X {"
1932         would actually work.
1934         Additionally, if there is an error in the resolution phase, for
1935         example: "class X : NonExistant {}" th
1936         
1937         * cs-parser.jay: Be more precise with the errors being raised,
1938         instead of flagging all exceptions during parsing to be attributed
1939         to the parsing process, distinguish those from errors happening in
1940         the actions and hint that using -v would produce the actual
1941         exception. 
1943         * repl.cs: Do not load all compiler references on each reset,
1944         doing the partial reset takes care of this.
1945         
1946 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1948         * repl.cs: Add support for loading all the files from
1949         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1950         as shell libraries.
1952         Introduce a micro-parser that is able to deambiguate on its input
1953         whether we are dealing with a compilation unit (namespace, class,
1954         interface, struct, delegate) declaration or a statement.   This
1955         allows both declarations and statements to be entered. 
1957         Set history size by default to 300 lines.
1959         Instead of distinguishing based on the parser.InteractiveResult,
1960         have only two cases: statements were parsed, or a compilation unit
1961         was.   Always pull the Using statement additions from the
1962         compilation unit parse.
1963         
1964         * cs-tokenizer.cs: Rename tokens to better describe their intent
1965         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1966         
1967         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1968         EvalMode is used to trigger the lookup of global variables while
1969         StatementMode is used turn variable declarations into static
1970         fields.
1972         * getline.cs: Allow history size to be set.
1973         
1974 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1976         A fix for bug #360755
1977         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1979 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1981         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1982         
1983         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1984         member name, it is too confusing
1985         
1986         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1987         
1988         * rootcontext.cs: Finally default to warning level 4.
1990 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1992         * class.cs (CheckBase): Ignore overloaded operators.
1994 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1996         A fix for bug #420830
1997         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1999 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2001         A fix for bug #420832
2002         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
2004 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2006         A fix for bug #420386
2007         * nullables.cs: Fixed logic of nullable user comparison operators involving
2008         null values.
2010 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2011         
2012         * attribute (IsClsCompliant): Use FALSE value for pointer types.
2014 2008-08-27  Miguel de Icaza  <miguel@novell.com>
2016         * repl.cs: Add support for aborting the running code with C-c. 
2018 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
2020         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
2022 2008-08-27  Miguel de Icaza  <miguel@novell.com>
2024         * cs-parser.jay (interactive_statement_list): A new set of rules
2025         for hosting statements that uses the "interactive_" prefix.   
2027         * repl.cs: Add support for parsing `using' as a statement or as a
2028         directive.  Deambiguating before passing this to the parser.
2030         We need to distinguish statement_expressions that occur at the
2031         toplevel vs those that occur embedded into expressions.
2033         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
2034         that fixes the cursor key handling, and a history bug.
2035         
2036 2008-08-26  Miguel de Icaza  <miguel@novell.com>
2038         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
2039         limitations in Console, instead the 2.0 bootstrap libraries now
2040         include the Console bits.
2042         Also, remove the use of Nullables from getline.cs
2044         ------------
2045         
2046         Interactive support for the C# compiler.   Use gmcs --shell to
2047         enter a read-eval-print loop shell.
2049         Docs: http://www.mono-project.com/CsharpRepl
2050         
2051         * sources: include repl.cs here and getline.cs for gmcs.exe,
2052         everything else is getline.cs impaired.
2054         * Makefile: when bootstrapping pass a special flag
2055         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
2056         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
2057         This distinguishes those two cases.
2059         * repl.cs: Support for a read-eval-print loop.   Will be soon
2060         refactored into eval support and then REPL on top of it.
2062         * ecore.cs: If a simplename lookup fails, before erroring out,
2063         if we are in EvalMode to resolve the name to a declaration in the
2064         Eval-land.    
2066         This means that variable declarations that happened in previous
2067         classes (as repl puts every statement in a separate class) are
2068         made visible in this way.
2070         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
2071         triggered an error due to the end of file being reached.   This is
2072         used to do multi-line input, and notify the caller that the user
2073         needs to provide more text before a successful parse.
2075         Add new grammar rules after the INTERACTIVE_PARSER token is seen
2076         to drive the evaluation with a custom wrapper. 
2078         * driver.cs: Add support for --shell, and refactor some code to be
2079         reused from repl.cs
2080         
2081         * namespace.cs: Add support for serializing the contents of the
2082         namespaces and reloading them.  
2084         * getline.cs: A managed implementation of ReadLine under
2085         X11/Apache2 license terms.  Easy to embed in other applications as
2086         well.
2088         * namespace.cs: Add some functions to save and restore the
2089         namespace state.
2091         * rootcontext.cs: New public field.
2093         * cs-tokenizer.cs: Add support for one of the possible characters
2094         we introduce into the token stream.  
2096         This patch does not affect the regular tokenization process, the
2097         only performance hit would happen if there is an invalid character
2098         on the input string.
2100         * support.cs: Move isatty helper routine here.
2102         * codegen.cs: Small cleanup, and add a mechanism to initialize the
2103         code generator for in-memory assemblies.
2105 2008-08-26  Marek Safar  <marek.safar@gmail.com>
2107         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
2108         parameter cannot be always used as a type.
2110 2008-08-21  Marek Safar  <marek.safar@gmail.com>
2112         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
2114 2008-08-21  Marek Safar  <marek.safar@gmail.com>
2116         * convert.cs: Implement explicit array to IList<T> conversion.
2118 2008-08-20  Marek Safar  <marek.safar@gmail.com>
2120         A fix for bug #362740
2121         * cs-tokenizer.cs: Handle UTF-16 surrogates.
2123 2008-08-20  Marek Safar  <marek.safar@gmail.com>
2124         
2125         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
2126         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
2127         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
2128         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
2129         handling to use just one type of infrastructure and deal with generics
2130         more effectivelly.
2132 2008-07-23  Martin Baulig  <martin@ximian.com>
2134         *** Merged this from trunk revision 108527 ***
2136         * statement.cs
2137         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
2138         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
2139         scope variable.
2141 2008-08-15  Marek Safar  <marek.safar@gmail.com>
2142         
2143         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
2144         error checks.
2146 2008-08-15  Marek Safar  <marek.safar@gmail.com>
2147         
2148         * delegate.cs: Fixed compiler crash when creating delegate using partial
2149         method.
2150         
2151         * typemanager.cs: MulticastDelegate is not a delegate.
2153 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2154         
2155         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
2156         checks.
2158 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
2160         * cs-parser.jay (type): Allow 'var' in mcs too.
2161         (local_variable_type): Likewise.
2163 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2164         
2165         * driver.cs: Removed broken -noconfig variants.
2167 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2168         
2169         A fix for bug #417078
2170         * expression.cs: Emit correctly left side pointer operators.
2172 2008-08-13  Marek Safar  <marek.safar@gmail.com>
2174         * generic.cs, lambda.cs: Inflate method generic arguments only.
2176 2008-08-12  Marek Safar  <marek.safar@gmail.com>
2178         * class.cs: Fixed struct layout check regression.
2180 2008-08-12  Marek Safar  <marek.safar@gmail.com>
2182         * cs-parser.jay, enum.cs: Simplified enum parsing.
2183         
2184         * decl.cs: Check all type parameters conflicts.
2185         
2186         * expression.cs, statement.cs, attribute.cs: More expression checks.
2188 2008-08-11  Marek Safar  <marek.safar@gmail.com>
2190         * generic.cs: Add type inference types restriction.
2191         
2192         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
2193         anonymous.cs, expression.cs: Allocate less accessor parameters.
2195 2008-08-08  Marek Safar  <marek.safar@gmail.com>
2197         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
2198         classes.
2200 2008-08-08  Marek Safar  <marek.safar@gmail.com>
2202         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
2204 2008-08-07  Marek Safar  <marek.safar@gmail.com>
2206         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
2207         Also fixes #362146 and #381592.
2209 2008-08-07  Marek Safar  <marek.safar@gmail.com>
2211         * ecore.cs: Reduced constant cannot be used as an attribute value.
2212         
2213         * cs-parser.jay: Base expression has to be a type.
2214         
2215         * expression.cs (Conditional): Uses ReducedExpression.
2217 2008-08-06  Marek Safar  <marek.safar@gmail.com>
2219         A fix for bug #376826
2220         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
2221         address of hoisted local variable or parameter cannot be taken.
2223 2008-08-05  Marek Safar  <marek.safar@gmail.com>
2225         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
2226         anonymous method inside checked/unchecked expression.
2228 2008-08-05  Marek Safar  <marek.safar@gmail.com>
2230         * typemanager.cs (IsEqual): Guard against null.
2231         
2232         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2233         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2234         routine. Fixed few misleading conversion errors.
2236 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2238         * class.cs: Consider generics when checking cycles in struct layout.
2240 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
2242         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
2244 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2246         A fix for bug #414165
2247         * anonymous.cs: Use same anonymous implementation method for all anonymous
2248         method emits.
2250 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2252         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2253         constraints.
2255 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2257         * cs-parser.jay: Typeof argument has to be a type expression.
2258         
2259         * namespace.cs: Check alias and namespace definitions collisions.
2260         
2261         * class.cs, pending.cs: Moved explicit interface accessor implementation
2262         check.
2263         
2264         * delegate.cs, expression.cs: Verify special name invocations.
2265         
2266 2008-08-01  Marek Safar  <marek.safar@gmail.com>
2268         * cs-parser.jay: Don't choke on empty generic type arguments.
2269         
2270         * cs-tokenizer.cs: Handle escaped preprocessor directives.
2271         
2272         * expression.cs, ecore.cs: Minor expressions bugs.
2274 2008-08-01  Marek Safar  <marek.safar@gmail.com>
2276         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2277         and added more error handling.
2278         
2279         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2280         
2281         *  modifiers.cs, enum.cs: Fixed.
2283 2008-07-31  Jb Evain  <jbevain@novell.com>
2285         * driver.cs: remove -pkg ability of smcs.
2287 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2289         * statement.cs (Switch): Correctly set empty default target for single
2290         blocks.
2292 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2294         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2295         string switch statement implementation to use string dictionary which
2296         significantly (2-8x) improves performance of generated code.
2298 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2300         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2301         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2302         
2303 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2305         A fix for bug #412595
2306         * typemanager.cs, convert.cs, expression.cs: Some types are never
2307         convertible to each other.
2309 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2311         * nullable.cs (CreateNullConstant): An error messages update.
2313 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2315         A fix for bug #412595
2316         * cfold.cs: Don't cast undefined bool constant.
2318 2008-07-29  Martin Baulig  <martin@ximian.com>
2320         * symbolwriter.cs
2321         (SymbolWriter.Reset): New public static method.
2323         * driver.cs
2324         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2326 2008-07-28  Marek Safar  <marek.safar@gmail.com>
2328         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2329         
2330         * expression.cs (ElementAccess): Exact size allocation.
2332 2008-07-26  Marek Safar  <marek.safar@gmail.com>
2334         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2336 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2338         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2339         
2340         * class.cs: Removed $PRIVATE$ field hack which caused problems during
2341         flow analysis.
2343 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2345         A fix for bug #412217
2346         * assign.cs: Mutate also assignment type.
2348 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2350         A fix for bug #323644
2351         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2352         indexers.
2354 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2356         A fix for bug #412134
2357         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2358         non-enumerable operands when overloading equality or bitwise operators.
2360 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2362         * anonymous.cs: Cache closed generic anonymous method delegates.
2364 2008-07-24  Marek Safar  <marek.safar@gmail.com>
2366         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
2367         anonymous.cs, statement.cs: Always emit anonymous method as static method
2368         when is instance free. Use nesting for nested anynomous methods blocks.
2369         
2370 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2372         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2373         types.
2375 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2377         * expression.cs: Removed MakeSimpleCall.
2379 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2381         A fix for bug #323012
2382         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2383         Base method implementing interface has to be public.
2385 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2387         * cs-parser.jay: Don't break on missing argument.
2389 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2391         A fix for bug #320993
2392         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2393           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2395 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2397         A fix for bug #320748
2398         * convert.cs: Implicit user operators cannot convert to interfaces
2400 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2402         A fix for bug #312686
2403         * driver.cs: Ignore empty assembly references.
2405 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2407         A fix for bug #387040
2408         * ecore.cs: Skip constrains check for an explicit implementation.
2410 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2412         A fix for bug #409045
2413         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2414           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2415           identifiers are file specific unless passed as input arguments.
2417 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2419          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2420          to emit UnmanagedMarshal data under 2.0 profile.
2422 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2424         A fix for bug #410369
2425         * parameter.cs: Clone correctly ParamsParameter.
2427 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2429         * expression.cs (Argument): Always report type for type based expressions
2430         errors.
2432 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2434         A fix for bug #410666
2435         * anonymous.cs: Correctly initialize generic storey reference.
2437 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2439         * convert.cs: Don't box same type arguments.
2441 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2443         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2444         Finished missing generic type mutators.
2446 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2448         * iterators.cs, statement.cs: Finished statements CloneTo.
2450 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2452         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2453         
2454         * expression.cs: Emit optimized default value expressions in expression tree
2455         array initializer.
2457 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2459         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2461 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2463         A fix for bug #367536
2464         * cs-parser.jay: Check static constructor of generic types for an access
2465         modifier.
2467 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2469         A fix for bug #353800
2470         * lambda.cs: Emit ret for contextual statements.
2471         
2472         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2473         up emitting redundant ret for all anonymous methods with return.
2475 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2477         A fix for bug #365188
2478         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2479         create anonymous method storey in unreachable block.
2481 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2483         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2484         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2485         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2486         statement.cs: Fixed relevant defects found by Gendarme.
2488 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2490         A fix for bug #325291
2491         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
2492         statement.cs: Replaced IAnonymousHost with top level block flag.
2494 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2496         * cs-parser.jay: Clean up unused open_parens.
2498 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2500         * ecore.cs: Custom error message for a range variable assignment.
2502 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2504         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2505         load.
2507 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2509         * literal.cs: Null literal is of object type.
2511 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2513         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2514         expression of nullable equality comparison.
2516 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2518         * expression.cs(PointerArithmetic): Removed redundant assignment.
2520 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2522         * decl.cs (GetSignatureForError): Report full namespace name for containers.
2524 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2526         A fix for bug #408361
2527         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2528         they are replaced by GetMethod.
2530 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2532         A fix for bug #408721 by jeremie.laval@gmail.com
2533         * expression.cs (Indirection): Implemented CloneTo.
2535 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2537         * statement.cs (AssignableSlots): Temporary disabled variable initialization
2538         assert check.
2540 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2542         * report.cs (EnableReporting): Don't reinitialize 0-based values.
2544 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2546         * linq.cs: Reset tranparent parameter counter in probing mode.
2548 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2550         * anonymous.cs: Mutate anonymous method type.
2552 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2554         * ecore.cs, anonymous.cs: Mutate field expressions.
2556 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2558         A fix for bug #369670
2559         * linq.cs, statement.cs: Use explicit block for query expressions variables.
2561 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2563         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2565 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
2567         Fix bug #314902
2568         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2569         only one '>', and finds a '>>', abort the generic lookahead.
2571 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2573         A fix for bug #319902
2574         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
2576 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2578         A fix for bug #406371
2579         * statement.cs: Moved EmitSymbolInfo to Block.
2581 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2583         * ecore.cs: Report better error for extension method overload failures.
2585 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2587         * expression.cs (Is): No need to box reference values.
2589 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2591         * class.cs: Use event resolve context when initializing CreateEmitContext.
2593 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2595         A fix for bug #394436
2596         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2597         method used inside expression trees. Added more LINQ to expression tree
2598         conversions.
2600 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2602         A fix for bug #378189, #370577
2603         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2604         from expression.
2606 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2608         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2609         hierarchically.
2611 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2613         A fix for bug #406702
2614         * anonymous.cs: Always park anonymous method in the nearest parent storey.
2616 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2618         A fix for bug #406648
2619         * cs-parser.jay: Report nullable use in mcs for some cases.
2621 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2623         * ecore.cs: Improved argument mismatch error messages.
2625 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2627         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2629 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2631         * expression.cs (TypeOf): Mutate type argument.
2633 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2635         * class.cs: Report missing partial modifier for correct type.
2637 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2639         * ecore.cs, expression.cs (VariableReference): Variable property is 
2640         protected.
2642 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2644         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2645         
2646 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2648         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2649         method delegates.
2651 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2653         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2654         anonymous method storey to an instance method when only "this" is hoisted.
2656 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2658         A fix for bug #321615
2659         * expression.cs: Pointer comparisons use unsigned operator.
2661 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2663         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2665 2008-07-02  Marek Safar  <marek.safar@gmail.com>
2667         A fix for bug #404905
2668         * class.cs: Always initialize local unsafe variables.
2670 2008-06-30  Marek Safar  <marek.safar@gmail.com>
2672         A fix for bug #396987
2673         * expression.cs (NewInitialize): Clear local temporary variable for next run
2675 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2677         A fix for bug #401020
2678         * ecore.cs: Both types and modifiers have to match for ref and out arguments
2680 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2682         A fix for bug #398319
2683         * cs-parser.jay: Implemented undocumented base access expression inside
2684         anonymous types.
2686 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2688         A fix for bug #404227
2689         * cs-parser.jay: Parse namespace declaration using qualified identifier.
2691 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2693         A fix for bug #404227
2694         * convert.cs: Fixed explicit array to interface cast.
2696 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2698         A fix for bug #403894
2699         * delegate.cs: Mutate DelegateInvocation type.
2701 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2703         A fix for bug #379348
2704         * delegate.cs: Box a load of generic parameters.
2706 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2708         * expression.cs: Add an array creation arguments mutate.
2710 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2712         A fix for bug #386068
2713         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2714         parameter.
2716 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2718         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2719         CloneTo.
2721 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2723         A fix for bug #403518
2724         * delegate.cs: Type correctly anonymous method new invocation.
2726 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2728         A fix for bug #394826
2729         * anonymous.cs: Fully qualify members when resolving anonymous type internal
2730         calls.
2732 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2734         A fix for bug #394826
2735         * anonymous.cs, iterators.cs: Construct generic storey only when is really
2736         needed.
2738 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2740         * class.cs: Clone indexer parameters for localized capturing.
2742 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2744         A fix for bug #402379
2745         * expression.cs: Don't crash when an object initializer resolve fails.
2747 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2749         A fix for bug #402888
2750         * expression.cs: Mutate conditional expression.
2752 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2754         A fix for bug #401012
2755         * class.cs: Keep StructLayout in shared container.
2757 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2759         A fix for bug #400438
2760         * decl.cs, class.cs: Only properties can be automatically implemented.
2762 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2764         * statement.cs (ChangeToIterator): Copy also labels.
2766 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2768         * ecore.cs: Pass type argument details to parent extension method.
2770 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2772         A fix for bug #375966
2773         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2775 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
2777         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2779 2008-06-22  Marek Safar  <marek.safar@gmail.com>
2781         A fix for bug #394347
2782         * anonymous.cs: Cache compatible delegates as compatibility check produces
2783         a new method every time.
2785 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2787         * anonymous.cs: Propagate storey reference for single references.
2789 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2791         A fix for bug #387615
2792         * assign.cs, expression.cs: Correctly clone compound assignment.
2794 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2796         A fix for bug #359611, #359604
2797         * anonymous.cs: Mutate all types of hoisted parameters.
2799 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2801         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2802         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2803         expression.cs, codegen.cs, statement.cs
2804         
2805         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2806         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2807         
2808         ** Anonymous methods, lambda expressions rewrite **
2809         
2810         Anonymous expressions are now resolved when an explicit block is resolved 
2811         and they don't require any registration procedure anymore. Further,
2812         anonymous methods are defined when explicit block is emitted which allows
2813         better control of whole process and opens possibilities for more
2814         optimizations as well as alternative to reverse whole process.
2815         
2816         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2817         process consistent and to correctly emit hoisted generic methods when they
2818         have at least 1 hoisted variable.
2819         
2820 2008-06-17  Martin Baulig  <martin@ximian.com>
2822         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2823         iterator method.
2824         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2825         virtual property; check it in Emit().
2826         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2827         an iterator.
2828         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2829         an iterator.
2830         (Indexer.Define): Likewise.
2832 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2834         * convert.cs: Don't use IsInterface on type arguments.
2835         
2836         * delegate.cs: DelegateInvocation uses MethodInfo.
2837         
2838         * parameter.cs: Removed IsTypeParameter.
2839         
2840         * generic-mcs.cs: More missing stuff.
2842 2008-06-16  Martin Baulig  <martin@ximian.com>
2844         * modifiers.cs
2845         (Modifiers.DEBUGGER_HIDDEN): New public const.
2847         * typemanager.cs
2848         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2850         * class.cs
2851         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2852         (AbstractPropertyEventMethod): Likewise.
2853         (Constructor.Emit): Likewise.
2854         (SourceMethod.SetCompilerGenerated): Removed.
2856         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2857         on MoveNext().
2859         * anonymous.cs
2860         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2861         if we're an `IteratorHost'.
2862         (AnonymousMethodMethod..ctor): Don't set
2863         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2864         not on the method.
2866 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2868         * statement.cs: Clean-up foreach statements.
2870 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2872         * class.cs: Stop using public method which should not exist
2873         (MethodBuilder.SetGenericMethodSignature).
2875 2008-06-11  Martin Baulig  <martin@ximian.com>
2877         * location.cs
2878         (Location.LookupFile): Add `CompilationUnit' argument; when given
2879         a relative file name, make it relative to the directory the .cs
2880         file is located in instead of using the current directory.
2882 2008-06-11  Martin Baulig  <martin@ximian.com>
2884         * class.cs
2885         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2886         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2887         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2888         (SourceMethod.SetCompilerGenerated): Likewise.
2890 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2892         * codegen.cs, driver: Only write symbol file when it's asked for.
2894 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2896         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2898 2008-06-10  Martin Baulig  <martin@ximian.com>
2900         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2902 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2904         A fix for bug #316290
2905         * expression.cs: Include decimal operators in predefined table.
2906         
2907         * parameters.cs: More readonlyness.
2909 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2911         A fix for bug #397213
2912         * cs-parser.jay: One more missing current_local_parameters reset.
2914 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2916         A fix for bug #396633
2917         * class.cs: Host backing field in partial container.
2919 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2921         A fix for bug #397068
2922         * expression.cs: Check both operand types when predefined operator is used.
2924 2008-06-05  Martin Baulig  <martin@ximian.com>
2926         Merged the `debugger-kahalo' branch.
2928         * class.cs
2929         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2930         we're an iterator method.
2931         (SourceMethod): Reflect latest symbol writer changes;
2932         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2933         now `start_row' and `end_row'.
2934         (Constructor.Emit): Fix the logic whether to emit symbol information.
2936         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2937         generated methods.
2939         * location.cs
2940         (CompilationUnit): New public class; derives from `SourceFile'.
2941         (SourceFileEntry.DefineSymbolInfo): New public method.
2942         (SourceFileEntry.SetChecksum): New public method.
2943         (Location): Encode hidden line numbers by using `column == 255';
2944         the .ctor now accepts `column == -1' to mark a hidden line number.
2945         (Location.Hidden): New public property.
2946         (Location.CheckPoint): Add `CompilationUnit'.
2947         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2948         (Location.Push): Add `CompilationUnit compile_unit' argument.
2949         (Location.CompilationUnit): New public property.
2951         * statement.cs
2952         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2954         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2956         * driver.cs: `SourceFile' -> `CompilationUnit'.
2958         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2960         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2962         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2963         `#line hidden'.
2965         * symbolwriter.cs
2966         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2967         new symbol writer API to also pass the file.
2969 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2971         * statement.cs: Emit catch variable assignment using variable expression.
2972         
2973 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2975         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2976         with other variable types.
2978 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2980         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2981         GetLength method emit, it breaks resolve rules.
2982         
2983 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2984             Marek Safar  <marek.safar@gmail.com>
2985                         
2986         A fix for bug #395542
2987         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2988         declaration.
2989         
2990 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2992         A fix for bug #395287
2993         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2995 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2997         A fix for bug #395845
2998         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2999         non-nullable parameter type.
3000         
3001 2008-05-31  Marek Safar  <marek.safar@gmail.com>
3003         * class.cs: Handle contructor initializer as a statement in top-level block.
3005 2008-05-30  Marek Safar  <marek.safar@gmail.com>
3007         * attribute.cs: Don't mix old and new corlib types when emitting corlib
3008         security attributes.
3010 2008-05-24  Marek Safar  <marek.safar@gmail.com>
3012         * ecore.cs, expression.cs: Small IVariable refactoring.
3014 2008-05-22  Marek Safar  <marek.safar@gmail.com>
3016         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
3018 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3020         * cs-parser.jay: Removed redundant catch type check.
3022 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3024         A fix for bug #390372
3025         * nullable.cs: Set correct return type.
3027 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3029         A fix for bug #391062
3030         * typemanager.cs: Fixed crash when comparing null types.
3032 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3034         A fix for bug #391871
3035         * cs-parser.jay: Better error handling for invalid catch type.
3037 2008-05-20  Marek Safar  <marek.safar@gmail.com>
3039         A fix for bug #392155
3040         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
3042 2008-05-15  Marek Safar  <marek.safar@gmail.com>
3044         A fix for bug #390666
3045         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
3046         expressions.
3048 2008-05-15  Marek Safar  <marek.safar@gmail.com>
3050         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
3051         in getter.
3053 2008-05-13  Marek Safar  <marek.safar@gmail.com>
3055         A fix for bug #389625
3056         * delegate.cs, generic.cs: Some progress on method group return type
3057         inference.
3059 2008-05-13  Marek Safar  <marek.safar@gmail.com>
3061         A fix for bug #378419
3062         * namespace.cs: Inspect also parent namespaces not only namespace entries.
3064 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3066         * class.cs (Constructor): Added IsCompilerGenerated.
3068 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3070         * expression.cs: Enum binary operators can accept non-enum operand only when
3071         is implicitly convertible to underlying type.
3073 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3075         A fix for bug #389272
3076         * support.cs: Workaround System.InvalidOperationException for enums.
3078 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3080         A fix for bug #389073
3081         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
3083 2008-05-10  Marek Safar  <marek.safar@gmail.com>
3085         * driver.cs: Split Parse.
3086         
3087         * location.cs (LookupFile): Uses string.Empty.
3089 2008-05-07  Marek Safar  <marek.safar@gmail.com>
3091         * expression.cs, parameter.cs: Small ParameterReference clean up.
3093 2008-05-07  Marek Safar  <marek.safar@gmail.com>
3095         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
3096         hack. Fixes #387502.
3098 2008-05-06  Martin Baulig  <martin@ximian.com>
3100         * class.cs (Constructor.Emit): Fix the logic whether to emit
3101         symbol information.
3103 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
3105         Fix #385503
3106         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
3107         InvalidOperationException when the iterator is before the start or
3108         after the end.
3110 2008-05-06  Marek Safar  <marek.safar@gmail.com>
3112         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
3113         when left is nullable type.
3115 2008-05-06  Marek Safar  <marek.safar@gmail.com>
3117         A fix for bug #386628
3118         * expression.cs (LocalVariableReference): Continue in resolving when
3119         variable is not assigned.
3121 2008-05-05  Marek Safar  <marek.safar@gmail.com>
3123         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
3124         nullable operations.
3126 2008-05-04  Marek Safar  <marek.safar@gmail.com>
3128         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
3129         it saves many redundant temporary variables for nullable operations.
3131 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3133         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
3134         
3135         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
3136         method.
3137         
3138         * nullable.cs: Constant coalescing operator optimizations.
3140 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3142         * constant.cs: Use unsigned conversion for values which are unsigned only.
3144 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3146         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
3147         coalescing operator as it should be.
3149 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3151         A fix for bug #371016
3152         * expression.cs: All predefined delegate operators require implicit method
3153         group conversion.
3154         
3155 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3157         * constant.cs: Emit long constant as uint when fits the range.
3158         
3159         * convert.cs, expression.cs: Fixed few unsafe conversions.
3161 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3163         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
3165 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
3167         Fix #385758
3168         * convert.cs (ImplicitNumericConversion): Don't modify the type of
3169         'expr'.
3170         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
3172 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3174         * constant.cs, literal.cs: IsLiteral property for error reporting.
3175         
3176         * ecore.cs, expression.cs: Implemented Property expression.
3178 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3180         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
3181         
3182         * nullable.cs: Implemented nullable coalescing null operator.
3184         * ecore.cs, expression.cs: Expression trees work.
3186 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3188         * ecore.cs: CreateExpressionTree is finally abstract.
3190         * expression.cs, linq.cs: Updated.
3192 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3194         * expression.cs, ecore.cs: Block base access expression inside expression
3195         tree.
3197 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3199         A fix for bug #385058
3200         * expression.cs: User-defined operator implementations always take
3201         precedence over predefined operator implementations.
3203 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3205         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
3206         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
3207         expression tree conversions.
3208         
3209 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3211         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
3212         operators method details to Operator class.
3214 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3216         * anonymous.cs: Pass unsafe flags to anonymous container.
3217         
3218         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
3219         inside expression tree.
3221 2008-04-29  Martin Baulig  <martin@ximian.com>
3223         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
3224         (Tokenizer.PopPosition): Also restore the `line'.
3226 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3228         * delegate.cs: Implemented Invoke expression.
3230 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3232         * expression.cs: Fixed equality reference comparison regression.
3234 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3236         * ecore.cs: Clean up EmptyCast hack.
3237         
3238         * expression.cs, nullable.cs: Implemented enum binary and unary operations
3239         using correct conversion rules. Also fixes #383993.
3241 2008-04-28  Martin Baulig  <martin@ximian.com>
3243         * class.cs (Constructor.Emit): Don't emit debugging information
3244         for generated default .ctor's.
3246 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3248         * convert.cs: Empty-cast ushort to int conversion.
3250 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3252         A fix for bug #384191
3253         * ecore.cs, expression.cs: Fixed expression cloning.
3255 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3257         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3259 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
3261         Fix #381559, test-638.cs, test-639.cs
3262         * assign.cs (CompoundAssign.Helper): New wrapper.
3263         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3264         access.
3265         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3266         Pass unconverted expressions to the params array creation expression.
3267         (FieldExpr.EmitAssign): Don't special-case StringConcat.
3268         (PropertyExpr.EmitAssign): Likewise.
3269         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3270         element if it is of kind CompoundAssign.Helper.
3271         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3272         first before anything else.
3273         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3274         (ArrayAccess.LoadArrayAndArguments): Simplify.
3276 2008-04-27  Marek Safar  <marek.safar@gmail.com>
3278         * expression.cs: Fixed cloning of typeof(void).
3280 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
3282         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3283         (Assign.Emit): Likewise.  Move it to ...
3284         (CompoundAssign.DoResolve): ... here and ...
3285         (CompoundAssign.Emit): ... here.
3286         (EventAddOrRemove): New helper to handle += and -= on events, and
3287         avoid the use of BinaryDelegates.
3288         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3289         (EventExpr.EmitAddOrRemove): Improve.
3290         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3292         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3293         create VarExprs for 'foo.bar.var'.
3294         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3295         is a highly inappropriate name for its functionality.
3297 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3299         Simplify handling of multiple assignments
3300         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
3301         inheritable-only.
3302         (SimpleAssign): New.  Class to be used for normal assignments.
3303         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3304         * expression.cs, parameter.cs, statement.cs: Likewise.
3306 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3308         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3309         for incompatible underlying types, more to come, uff.
3311 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3313         Fix gtest-388.cs
3314         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3315         Handle 'leave_copy'.
3317 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3319         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3321 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
3323         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
3324         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3325         * statement.cs (While, Do, For): Allow test to have side effects.
3326         (For.DoEmit): Always emit InitStatement.
3328         Fix test-635.cs
3329         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3330         Always create SideEffectConstant.
3331         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3332         of type EnumConstant.
3334         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3335         Handle 'right' being SideEffectConstant of type 'bool'.
3337         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3338         Use left.EmitBranchable instead of open coding it, so as to
3339         improve optimization opportunities.
3341         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3343         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3344         assumptions.
3345         (Expression.EmitSideEffect): Document.
3347 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3349         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3351 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3353         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3355 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3357         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3358         conversion to expression tree.
3360 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3362         * ecore.cs: Removed unused expression.
3364 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3366         * expression.cs: Implemented NegateChecked and New expressions.
3368 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3370         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3372 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
3374         Fix #351102
3375         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3376         needing final 'ret' instruction.
3378 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3380         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3382 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3384         * expression.cs: Emit ldnull and not null expression as an instance argument
3385          of static method expression calls.
3387 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3389         A fix for bug #378200
3390         * expression.cs: Fixed crash when creating parameterless expression tree
3391         method call.
3393 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3395         A fix for bug #375297
3396         * anonymous.cs: Fixed crash when inferring from null argument anonymous
3397         method.
3399 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3401         A fix for bug #377596
3402         * decl.cs, class.cs: Emit delegate type argument attributes.
3404 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3406         A fix for bug #365314
3407         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3408         
3409 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3411         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3412         only.
3414 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3416         * generic.cs (TypeParameter): Removed redundant location.
3418 2008-04-19  Marek Safar  <marek.safar@gmail.com>
3420         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3421         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3422         FullNamedExpression in all declaration type expression, statements will come
3423         later.
3425 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3427         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3428         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3430 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3432         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3433         code.
3435 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3437         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3438         constraints.
3440 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3442         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3443         name expressions.
3444         Also fixes #340463.
3446 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
3448         Hook up 'EmitSideEffect'
3449         * constant.cs (Constant.EmitSideEffect): New.
3450         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
3451         (SideEffectConstant.EmitSideEffect): New.
3452         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
3453         unconditional branch in EmitBranchable.
3454         (FieldExpr.EmitBranchable): New.
3455         * expression.cs (Unary.EmitSideEffect): New.
3456         (Binary.EmitSideEffect): New.
3457         (VariableReference.EmitSideEffect): New.  Do nothing.
3459 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3461         Introduce 'EmitSideEffect'
3462         * ecore.cs (Expression.EmitSideEffect): New.
3463         (TypeCast): Rename from EmptyCast.
3464         (EmptyCast): New.
3465         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3466         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3467         * convert.cs, nullable.cs: Update to changes.
3469 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3471         * class.cs, cs-parser.jay: Early check for base types expression.
3473 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3475         * decl.cs (MemberName): Declare PrettyName as obsolete.
3477 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3479         * namespace.cs: Use MemberName comparison.
3481 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3483         Fix build break
3484         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
3485         FullName.
3486         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3487         (MemberName.FullyQualifiedName): New.  Provides the functionality
3488         that users assume FullName would have.
3489         * ecore.cs, namespace.cs: Update to changes.
3491         * statement.cs (Using.assign): Make into ExpressionStatement.
3492         (Using.EmitPreTryBody): Simplify.
3494 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3496         * report.cs: ColorFormat is protected.
3497         
3498         * rootcontext.cs: Unused fields clean-up.
3499         
3500         * namespace.cs: Made UsingEntry name private.
3502 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3504         * cs-tokenizer.cs, location.cs: Removed unused field.
3506 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
3507             Raja R Harinath  <harinath@hurrynot.org>
3509         Fix #379822
3510         * constant.cs (SideEffectConstant.value): Rename from 'left'.
3511         (SideEffectConstant.side_effect): Rename from 'right'.
3512         (SideEffectConstant..ctor): Normalize 'side_effect'.
3513         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3514         value of this constant.
3515         * cfold.cs: Update to changes.
3517 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3519         * cs-paser.jay: Removed unused variable.
3520         
3521         * driver.cs: Made Compile instance method.
3523 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
3525         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3527 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3529         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
3531 2008-04-13  Jb Evain  <jbevain@novell.com>
3533         * namespace.cs: update the System.Core fullname for 2.1
3534         * driver.cs: update the list of required assemblies for 2.1.
3535         Merged from the Moonlight 2 branch.
3537 2008-04-11  Marek Safar  <marek.safar@gmail.com>
3539         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3540         types and user defined operators. User operators arguments has to be checked
3541         for null value before invocation, which also means no operator is called
3542         when any argument is not convertible to unwrapped nullable type.
3543         
3544 2008-04-09  Marek Safar  <marek.safar@gmail.com>
3546         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3547         of Unary expressions to follow operator overloading rules precisely.
3548         Also fixes #321794, #323794
3549         
3550 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3552         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3553         expression.
3554         
3555 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3557         * expression.cs, ecore.cs: Implemented MemberInit expression.
3558         
3559 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
3561         Fix mono/tests/exception4.cs
3562         * statement.cs (ExceptionStatement, TryCatch): Revert to using
3563         ec.NeedReturnLabel () rather emitting a 'nop'.
3565         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3566         simple heuristic.
3567         (TryCatch.SomeCodeFollows): Likewise.
3568         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3569         for 'break', 'continue' and 'return' statements inside a try.
3570         We're fairly sure that the generated IL stream will have more
3571         instructions textually following the try.
3572         (FlowBranchingTryCatch): Likewise.
3574         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3575         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3576         overrides.
3578         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3579         wrapper -- forward everything to CollectionForeach.
3580         (CollectionForeach.NonDisposableWrapper): New.
3581         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3582         instead of a pop + branch to end.
3584 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3586         A fix for bug #377485
3587         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
3588         Propagate location for extension method groups. Report conversion failure at
3589         right place.
3591 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3593         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3594         ListInit and Field expressions.
3596 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
3598         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3599         Since $PC is always -1 inside the body of MoveNext, the fault
3600         handler is a no-op.
3601         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3602         * statement.cs (ExceptionStatement.emit_finally): Likewise.
3603         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3605         The denouement!  Fix #324708
3606         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3607         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3608         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3609         'finally' inside the finally clause.
3611         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3612         inside an iterator.  Don't emit the body of the 'finally' inside
3613         the finally clause yet.
3615         Use the ResumableStatement infrastructure for MoveNext ()
3616         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3617         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
3618         'old_resume_points'.  Move dispatcher upfront.
3619         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3620         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3621         in an enumerator.  This encodes the main fix in this patch series
3622         -- we can only jump into the first instruction of a try from the
3623         outside, but we want to emit try/finally regions in iterators and
3624         resume in the middle of them.
3626 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
3628         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3629         of NeedReturnLabel here.
3631         Introduce a common point for emitting try/finally to IL
3632         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
3633         features of the various subclasses, which are now driven by ...
3634         (ExceptionStatement.EmitPreTryBody): ... this and ...
3635         (ExceptionStatement.EmitTryBody): ... this and the original
3636         EmitFinallyBody.
3637         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3638         Remove DoEmit and update to follow above protocol.
3640         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3641         of the dispatcher are the same, skip emitting the 'switch'.
3642         * iterator.cs (Iterator.EmitDispose): Update to changes.
3644         Clean up handling of 'using' statement
3645         * statement.cs (UsingTemporary): New.  Carved out of ...
3646         (Using): ... this.  Simplify drastically.  Handle exactly
3647         one variable.
3648         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
3649         or Using as appropriate.  If there are multiple variable declared,
3650         create nested Using statements.
3651         (resource_acquisition): Kill.
3653         * statement.cs (ExceptionStatement.EmitForDispose): Use
3654         EmitFinallyBody, not EmitFinally.
3656         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3657         * iterator.cs: Update to changes.
3659         Start using the ResumableStatement infrastructure
3660         * statement.cs (ResumeableStatement.PrepareForDispose): New.
3661         (ResumableStatement.EmitForDispose): New.
3662         (ExceptionStatement): Override them.
3663         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3664         EmitForDispose to create the body of the Dispose method.  Don't
3665         use OldResumePoint.
3667         * iterator.cs (Iterator.AddResumePoint): Move here from ...
3668         * statement.cs (Toplevel.AddResumePoint): ... here.
3669         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3670         * flowanalysis.cs (FlowBranchingIterator): New.
3671         * codegen.cs (EmitContext): Update to changes.
3673         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3674         (Iterator.old_resume_points): Rename from 'resume_points'.
3675         (Iterator.MoveNextStatement): Remove unused class.
3677         New infrastructure for try/finally in iterators (still unused)
3678         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3679         (FlowBranchingToplevel.AddResumePoint): Hook into
3680         ToplevelBlock.AddResumePoint.
3681         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3682         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3683         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
3684         resume points and assign program-counter values.
3685         (ExceptionBlock.AddResumePoint): Collect resume points for
3686         de-muxer at the top of try block.
3687         * iterators.cs (Yield.CheckContext): Simplify.
3688         (Yield.Resolve): Use FlowBranching.AddResumePoint.
3690 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
3692         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3693         argument to an ExitStatement.
3694         (FlowBranchingException): Refactor saved origins code.
3695         * statement.cs (ExitStatement): Update to cahges.
3696         * iterator.cs (YieldBreak): Likewise.
3698         * statement.cs (ResumableStatement): New.  Common base class for
3699         YieldReturn and ExceptionStatement.
3700         (ExitStatement): New.  Common base class for Return and YieldBreak.
3701         (Return): Update to changes.
3702         * iterator.cs (YieldBreak): Likewise.
3703         * lambda.cs (ContextualReturn): Likewise.
3705         Fix #377028
3706         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3707         emit a meaningful error message.
3709         Fix #324765, #319508
3710         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3711         (VariableInfo.SetAssigned): Set it.
3712         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3713         determine if CS0219 or CS0168 is appropriate.  Don't use
3714         flow-analysis information.
3715         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3716         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
3717         (EmitContext.EndFlowBranching): ... this.
3719 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3721         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3723 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3725         A fix for bug #376508
3726         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3727         ImplicitConversionExists.
3729 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3731         * expression.cs (Binary): Added remaining binary operators to expression
3732         tree builder.
3734         * nullable.cs: Optimize shift with null argument.
3736 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
3738         Fix minor IL regression
3739         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3740         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3741         * cs-parser.jay (try_statement): Update to changes.
3743         * statement.cs (TryFinally.need_exc_block): Delete.
3744         (TryFinally): Update to changes.
3746         Now all ExceptionStatements are unconditional
3747         * statement.cs (CollectionForeach.DisposableWrapper): New.
3748         Extract out the try/finally code into a new wrapper.
3749         (CollectionForeach.Resolve): Use it to simplify the code.
3751 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
3753         Start at simplifying ExceptionStatement semantics a bit
3754         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3755         * cs-parser.jay (try_statement): Update to changes.
3756         (opt_catch_clauses): Remove.
3757         * flowanalysis.cs: Update to changes.
3758         (FlowBranching.BranchingType.TryCatch): New.
3759         (FlowBranchingTryCatch): New.
3761         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3762         (FlowBranching.CreateBranching): Update to changes.
3763         (FlowBranchingBlock.AddSibling): Add sanity check.
3764         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3765         Update to changes.
3767         * iterators.cs (Iterator.MarkFinally): Remove.
3768         * statement.cs (ExceptionStatement): Update to changes.
3770         Add support for skipping over finally blocks at runtime.  First
3771         in a series to fix #324708
3772         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3773         (Iterator.EmitMoveNext): Initialize it.
3774         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3775         branch over the body of the 'finally' clause.
3777 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
3779         Avoid lopsided use of Foo/DoFoo names
3780         * statement.cs (ExpressionStatement.EmitFinallyBody):
3781         Rename from EmitFinally.
3782         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3783         * iterator.cs: Update to changes.
3785 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3787         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3788         based on UserOperatorCall. More binary nullable operators clean up.
3790 2008-04-02  Martin Baulig  <martin@ximian.com>
3792         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3794 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3796         * nullable.cs: Merge user and empty conversions when lifting expression
3797         trees.
3798         
3799         * expression.cs (StringConcat): Implemented expression tree representation.
3801 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3803         * nullable.cs: When lifting null literal and a user operator exists, no call 
3804         is made.
3805         
3806 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3808         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3809         null.
3811 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3813         * nullable.cs, expression.cs: Use namespace instead heavily nested
3814         monster abstract class.
3816 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3818         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3819         lifting of null literal and user operators. Clean up of some temporary
3820         nullable hacks.
3822 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3824         Fix #368224, test-629.cs
3825         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3826         if it crossed an unwind-protect boundary.
3827         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3828         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3829         inside an unwind-protected region.
3830         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3831         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3832         'leave' instead of a 'br' if unwind-protected.
3833         (Iterator.EmitYieldBreak): Likewise.
3835 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3837         * driver.cs: Only define versioninfo resources if no win32 resource
3838         file was specified.
3840 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3842         A fix for bug #372375
3843         * convert.cs: Fixed boxing of nullable types.
3845 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3847         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3848         type.
3850 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3852         A fix for bug #374619
3853         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3854         
3855 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3857         * lambda.cs: Check return type only for invocation.
3858         
3859 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3861         A fix for bug #374214
3862         * ecore.cs: Correctly report argument type mismatch.
3864 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3866         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3867         and not rely on broken IsEnum.
3869 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3871         * nullable.cs: New file, extracted from generic.cs.
3872         
3873         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3875 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3877         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3878         predefined comparison operators and null literals.
3879         
3880         * report.cs: New warning ID.
3881         
3882 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3884         A fix for bug #370577
3885         * lambda.cs: Check return type too.
3887 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3889         A fix for bug #372846
3890         * class.cs: Automatic properties can be declared as unsafe.
3892 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3894         * location.cs: Use string based concatenation.
3895         
3896         * expression.cs: LiftedBinaryOperator is gmcs only.
3897         
3898 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3900         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3901         conversions rules and expression trees.
3903 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3905         * delegate.cs: Use extension method source as delegate target.
3907 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3909         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3910         binary operations to be purely based on binary operations and optimized
3911         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3912         and other ET refactoring.
3913         
3914         * typemanager.cs: Fixed warning.
3915         
3916 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3918         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3919         
3920         * symbolwriter.cs: Fixed.
3922 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3924         * anonymous.cs, driver.cs: Reset anonymous types counters.
3926 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3928         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3929         
3930         * class.cs: Use fullname for all type member definitions.
3931         
3932 2008-02-19  Martin Baulig  <martin@ximian.com>
3934         * class.cs
3935         (IMethodData.EmitExtraSymbolInfo): New interface method.
3936         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3937         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3938         interface method here as an empty public virtual method.
3940         * anonymous.cs
3941         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3942         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3943         CodeGen.SymbolWriter.SetRealMethodName().       
3945 2008-02-18  Martin Baulig  <martin@ximian.com>
3947         * anonymous.cs
3948         (ScopeInfo.EmitType): Override this and emit debugging
3949         information for captured variables.
3950         (RootScopeInfo.EmitType): Override this and emit symbol
3951         information for a captured `this'.
3953 2008-02-15  Martin Baulig  <martin@ximian.com>
3955         * iterators.cs: Emit debugging info.
3957         * codegen.cs
3958         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3959         (EmitContext.OmitDebuggingInfo): New public property.
3961         * statement.cs
3962         (While): Override Emit() and don't emit symbol info there; do it
3963         inside DoEmit() instead.
3964         (Block.Emit): Omit symbol information while emitting the scope
3965         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3966         block logic.
3967         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3968         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3969         .ctor to make `IsIterator' work.
3971 2008-03-14  Martin Baulig  <martin@ximian.com>
3973         * symbolwriter.cs: Added the new symbol writer function from the
3974         debugger's `terrania' branch; temporarily enclose them inside
3975         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3976         my vacations.
3978 2008-03-14  Martin Baulig  <martin@ximian.com>
3980         * symbolwriter.cs
3981         (SymbolWriter): Make this a public static class.
3983         * codegen.cs
3984         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3985         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3987 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3989         A fix for bug #370577
3990         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3991         return type.
3992         
3993 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3995         * typemanager.cs (CSharpName): Made 250 times faster.
3997 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3999         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
4000         
4001 2008-03-12  Marek Safar  <marek.safar@gmail.com>
4003         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
4004         crash when predefined field does not exist.
4005         
4006 2008-03-12  Marek Safar  <marek.safar@gmail.com>
4008         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
4009         
4010 2008-03-12  Marek Safar  <marek.safar@gmail.com>
4012         * class.cs (FixedField): Don't crash when contructors are missing.
4014 2008-03-11  Marek Safar  <marek.safar@gmail.com>
4016         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
4017         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
4018         check internal types accessibility for internal and external types.
4019         Replaced EnumToUnderlying by GetEnumUnderlyingType.
4021 2008-03-11  Marek Safar  <marek.safar@gmail.com>
4023         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
4024         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
4025         attribute.cs, statement: Use corect instance of predefined types (work
4026         related to #364674).
4028 2008-03-07  Marek Safar  <marek.safar@gmail.com>
4030         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
4031         
4032 2008-03-07  Marek Safar  <marek.safar@gmail.com>
4034         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
4035         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
4036         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
4037         predefined types clean up, delayed predefined types members initialization
4038         (work related to #364674).
4040 2008-03-05  Marek Safar  <marek.safar@gmail.com>
4042         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
4043         
4044 2008-03-05  Marek Safar  <marek.safar@gmail.com>
4046         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
4047         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
4048         predefined types clean up (work related to #364674).
4050 2008-03-04  Marek Safar  <marek.safar@gmail.com>
4052         * ecore.cs: Print an error message instead of throwing exception.
4053         
4054 2008-03-04  Marek Safar  <marek.safar@gmail.com>
4056         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
4057         expression.cs, statement.cs: Unififed null literal representation.
4059 2008-03-03  Marek Safar  <marek.safar@gmail.com>
4061         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
4062         expression.cs: Refactored binary operators resolve phase and improved speed.
4063         The nullable code is still missing and won't work correctly, more fixes
4064         required.
4066         It also fixes #323726, #324312, #324248, and many other unreported issues.
4068 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
4070         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
4071         instead of 'gmcs'.
4073 2008-02-27  Marek Safar  <marek.safar@gmail.com>
4075         * ecore.cs: Clean-up and split BetterConversion.
4076         
4077 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
4079         Fix #363791
4080         * enum.cs (EnumMember.Value): Only access 'value' if
4081         ResolveValue says it's ok.
4082         (EnumMember.DoResolveValue): Don't set prev_member.value.
4083         (Enum.GetDefinition): Reverse arguments of Equals --
4084         EnumMember.Value can return 'null'.
4086         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
4088 2008-02-22  Marek Safar  <marek.safar@gmail.com>
4090         * generic.cs, expression.cs: More ongoing work on expression trees.
4091         
4092 2008-02-21  Marek Safar  <marek.safar@gmail.com>
4094         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
4095         handle missing matches when mutiple operators exist.
4096         
4097 2008-02-20  Marek Safar  <marek.safar@gmail.com>
4099         A fix for bug #363218
4100         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
4101         initializers.
4102         
4103 2008-02-20  Marek Safar  <marek.safar@gmail.com>
4105         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
4106         update. This time to deal correctly with SideEffectConstant expression used
4107         as an argument for another constant folding.
4109 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
4111         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
4112         MethodBuilder.
4114 2008-02-19  Marek Safar  <marek.safar@gmail.com>
4116         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
4118 2008-02-19  Marek Safar  <marek.safar@gmail.com>
4120         A fix for bug #328136
4121         * expression.cs: Do not fold immediately LogicalAnd operators when the left
4122         side is a false constant, because we still need to evaluate the right-hand
4123         side.
4125         * statement.cs (If): Emit two types of boolean constants (simple constant,
4126         side-effect constant).
4128 2008-02-19  Marek Safar  <marek.safar@gmail.com>
4130         * constant.cs (SideEffectConstant): Don't emit boolean constant.
4132         * expression.cs: Fold immediately LogicalAnd operators when both sides are
4133         constants.
4135 2008-02-18  Marek Safar  <marek.safar@gmail.com>
4137         A fix for bug #361457
4138         * ecore.cs (IsApplicable): Params methods have lower priority.
4140         * support.cs: Return correct parameter modifier for params types.
4142 2008-02-18  Marek Safar  <marek.safar@gmail.com>
4144         * generic.cs (TypeParameter): Cache attribute target name.
4146         * support.cs: Removed unused variable.
4148         * typemanager.cs: Removed debugging leftover.
4150         * ecore.cs: Use local type instead of a property;
4152         * class.cs (VerifyMembers): Consider also parent to test whether type member
4153         is local or public.
4155         * expression.cs (FullMethodDesc): Removed.
4157         * attribute.cs (IsValidArgumentType): Made static.
4159 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
4161         Cleanup to be more readable.
4162         * Makefile (GMCS_PROFILE): Remove.
4163         (COMPILER_NAME): New helper.
4165 2008-02-15  Miguel de Icaza  <miguel@novell.com>
4167         * cs-tokenizer.cs: if a conditional expression happens inside a
4168         (...) this also means that we do not need to de-ambiguate between
4169         an parenthesized expression and a cast.
4171         Fixes 346484.
4173         * constant.cs (SideEffectConstant): a constant value that happens
4174         to have a side effect.
4176         Fixes the build regressions introduced by the fix for #359789
4178 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
4180         * expression.cs (Conditional.Emit): when emitting the ternary
4181         operator, use local variables to generate code verifiable code.
4183         The verifier cannot infer that the type on stack before the
4184         stloc.0 is executed is of type ParentB. This happens because the
4185         stack merge algorithm uses only parent types when deciding which
4186         is the common type.  This is described in Part III 1.8.1.3 of ECMA
4187         335.
4189         This code compiled with mcs is not verifiable under MS. The MS
4190         verifier picks the first common interface of Foo and Bar, which is
4191         wrong, but doesn't use a full join type of the 2 interfaces.
4193         CSC uses a clever hack to compile such code in a verifiable
4194         way. It stores the intermediate values in a local variable with
4195         the expected type.
4197         Fixes: #358102
4199 2008-02-14  Miguel de Icaza  <miguel@novell.com>
4201         * expression.cs: Do not fold BitwiseAnd operators when the left
4202         side is a false constant, because we still need to evaluate the
4203         right-hand side.
4205         Fixes #359789
4207         * support.cs: Instead of throwing an InternalErrorException when
4208         the position of the stream is outside the boundary of our buffer,
4209         reset the state of the reader, and restart the reading from the
4210         beginning of the file.
4212 2008-02-14  Marek Safar  <marek.safar@gmail.com>
4214         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
4216 2008-02-14  Marek Safar  <marek.safar@gmail.com>
4218         A fix for bug #361686
4219         * decl.cs: A protected types used inside a private class which parents
4220         derives from the protected class are accessible.
4222 2008-02-13  Marek Safar  <marek.safar@gmail.com>
4224         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
4225         the parameterless constructor.
4227 2008-02-13  Marek Safar  <marek.safar@gmail.com>
4229         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4230         lookup methods to use standard member cache when doing member lookup.
4232 2008-02-12  Marek Safar  <marek.safar@gmail.com>
4234         * driver.cs: Don't report full path for referenced module as assembly error.
4236 2008-02-12  Marek Safar  <marek.safar@gmail.com>
4238         * Makefile: Fixed `qh' target to work on all machines.
4240         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4241         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4242         and HasElementType with TypeManager implementation.
4244 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4246         A fix for bugs #325134, #359749
4247         * expression.cs, ecore.cs: Try to resolve an extension method even if the
4248         first binds point to non-method member expression.
4250 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4252         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4254 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4256         A fix for bugs #321394, #323028
4257         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4258         Reworked naive IsAccessibleAs implementation to handle nested types.
4260 2008-02-05  Jb Evain  <jbevain@novell.com>
4262         * class.cs: use generic type comparison for parameters
4263         as well.
4265 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4267         A fix for bug #325372
4268         * class.cs: Use generic type comparison when testing method signatures.
4270 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4272         A fix for bug #357047
4273         * ecore.cs: Applied C# 3.0 changes to better conversion.
4275 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4277         A fix for bug #358374
4278         * cs-parser.jay: Correctly set modifiers for all constructor types.
4280 2008-02-04  Marek Safar  <marek.safar@gmail.com>
4282         A fix for bug #355251
4283         * generic.cs: Added base class constraint based type inference.
4285 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4287         A fix for bug #357255
4288         * decl.cs: One more missing visibility check.
4290 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4292         * support.cs: Fixed broken return.
4294 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4296         * report.cs: Correctly reset warnings count after probing.
4298 2008-01-25  Martin Baulig  <martin@ximian.com>
4300         * namespace.cs
4301         (NamespaceEntry.SymbolFileID): Make this work again after
4302         MemberName.ToString() is gone.
4304 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4306         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4307         expressions.
4309 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4311         * generic.cs: Use full implicit conversion for type inference fixing.
4313 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4315         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4316         Fixed user operator conversions.
4318 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4320         * generic.cs: Do nullable type to null comparison optimization during
4321         resolve phase.
4323 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4325         A fix for bug #355163
4326         * generic.cs: Enabled l-value resolve on nullable expressions.
4328 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4330         A fix for bug #353986
4331         * class.cs: Ingore static ctors with parameters for any further checks.
4333 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4335         A fix for bug #354310
4336         * namespace.cs: Removed redundant check.
4338 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4340         A fix for bug #354928
4341         * expression.cs: ElementInitializers can be resolved only once.
4343 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4345         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4346         Condition expressions.
4348 2008-01-23  Marek Safar  <marek.safar@gmail.com>
4350         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4352 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4354         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4355         not allowed.
4357         * generic.cs: Implemented coalesce expression.
4359 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4361         A fix for bug #355145
4362         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4363         expression tree type inference.
4365 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
4367         Fix #354663
4368         * expression.cs (Binary.IsUnsignedType): Fix typo.
4370 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4372         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4374 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4376         A fix for bug #355161
4377         * ecore.cs, expression.cs: Wider range of extension method supported
4378         expressions.
4380 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
4382         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4383         AssemblyBuilder to operate in compiler context. Fixes mcs part of
4384         bug #354970.
4386 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4388         A fix for bug #355148
4389         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4391 2008-01-22  Miguel de Icaza  <miguel@novell.com>
4393         * expression.cs (CreateExpressionTree): Add support for or and
4394         logical or, and indent following the coding conventions.
4396         * typemanager.cs (LinqExpression): renamed from
4397         ExpressionTreeManager, for a shorter name.
4399         Use TypeManager.CoreLookupType to lookup types from our core
4400         assemblies and turn those into "Type" variables.
4402         Consumers that previously used "Namespace" and "Type" from this
4403         class should instead use the TypeExpression which is a type that
4404         is fully resolved (without involving the regular C# resolution
4405         rules). 
4407         This typically looks like this:
4409         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4410         new MemberAccess (texpr, name, type_arguments, loc)
4412         This avoids the problem in: #355178
4414 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4416         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4417         feature in parser only as we do in other cases.
4418         
4419 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4421         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4422         typemanager.cs: A refactoring of params arguments to reuse existing
4423         expressions (params -> array initializer) to emit params argument instead
4424         of specialized handling.
4425         It was required by expression tree implementation and it has other benefits
4426         as well, we now apply same optimization for params arguments as we do for
4427         array initializers.
4428         
4429 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4431         A fix for bug #353526
4432         * generic.cs: A type inference of params arguments may not required any
4433         temporary array creation.
4434         
4435 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4437         A fix for bug #353534
4438         * generic.cs, ecore.cs, expression.cs: A method group type inference is
4439         supported for delegates only.
4440         
4441 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4443         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4444         type for more than 1 candidates.
4445         
4446 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4448         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4449         expressions.
4450         
4451 2008-01-16  Marek Safar  <marek.safar@gmail.com>
4453         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4454         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4455         operator) expressions. 
4456                 
4457 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4459         * statement.cs: Avoid declaring an IL variable for this_variable since it is
4460         not accessed from the generated IL.
4462 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4464         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4465         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4466         statement.cs: The first expression tree implementation drop, mostly
4467         infrastructure work.
4469 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4471         * ecore.cs (IsNestedChild): Refactored.
4473 2008-01-11  Marek Safar  <marek.safar@gmail.com>
4475         * lambda.cs: Don't use a cast on unknown expression statement.
4477 2008-01-10  Geoff Norton  <gnorton@novell.com>
4479         * cs-tokenizer.cs: One more token to distinguish between method and lambda
4480         arguments
4482 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4484         * doc.cs: Report better /doc crash details.
4485         
4486 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4488         A fix for bug #352536
4489         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4491 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4493         A fix for bug #352287
4494         * ecore.cs, expression.cs: Do `this' access checking in all member access
4495         expressions.
4496         
4497 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4499         * rootcontext.cs, driver.cs: Switch to linq mode by default.
4500         
4501         * report.cs: Reset message stacks.
4502         
4503 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4505         * generic.cs (InferInPhases): Correctly calculate params position.
4506         
4507 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4509         * cs-tokenizer.cs: No need to parse full string when parsing lambda
4510         arguments.
4512 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4514         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4515         
4516         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4517         
4518         * driver.cs: Updated --help option.
4519         
4520 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4522         * generic.cs (InferParamsTypeArguments): Removed.
4523         (InferInPhases): Add params type inference.
4524         (LowerBoundInference): Fixed scoring mechanism.
4525         
4526         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4527         
4528 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
4530         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4531         byte array for unsigned "baked" assemblies.
4533 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
4535         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4536         array for assemblies that are not strongnamed.
4538 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4540         A fix for bug #351481
4541         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4542         declaring type for nested generic types.
4543         
4544 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4546         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4547         instead of ToString.
4548         
4549 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4551         A fix for bug #351047
4552         * expression.cs (Binary.ResolveOperator): Allow equality operators between
4553         null and structs only when equality and inequality operators are defined
4554         either as an user-operators or predefined operators.
4555         
4556 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4558         A fix for bug #351047
4559         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4560         
4561 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4563         A fix for bug #351257
4564         * cs-tokenizer.cs: Advance line number for '\r' correctly.
4565         
4566 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4568         A fix for bug #351157
4569         * class.cs (Using): Fixed yet another broken cloning.
4570         
4571         (Block): Put back more sensible default value for statements.
4572         
4573 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
4575         * codegen.cs: Allow AssemblyVersion with only major version component.
4576         Fixes bug #351055.
4578 2007-12-29  Marek Safar  <marek.safar@gmail.com>
4580         A fix for bug #324654
4581         * class.cs: Use FullName property as member name.
4583 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4585         A fix for bug #342117
4586         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4587         constructor constraint.
4589 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4591         A fix for bug #338273
4592         * class.cs (ProbertyBase): Access modifier checks are required for overrides
4593         only.
4595 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4597         A fix for bug #350839
4598         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4600 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4602         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4603         GHOP:
4604         
4605         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4607         * statement.cs: Changed some Hashtables to use HybridDictionaries
4608         instead. It was observed that some HashTables only contained a few
4609         items in the vast majority of cases. Since HybridDictionary is
4610         more efficient on small sets (<10 elements), "known_variables"
4611         from class ExplicitBlock as well as "labels" and "constants " from
4612         class Block were changed to HybridDictionaries. 
4614         Atsai results: (56216kb->54987kb)
4616         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4619 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4621         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4622         GHOP:
4623         
4624         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4625         
4626         * expression.cs: foreach loop to for loop, saved on allocation of
4627         enumerator (59333kb->59141kb)
4629         * statement.cs. Changed foreach loops to for loops, saved on
4630         allocation of enumerator (59141kb->59006kb)
4632         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4633         when constructed with no specified capacity. This was causing a
4634         few ArrayLists to allocate more memory than they would potentially
4635         need in the Block class and MemberCache class. Setting the
4636         ArrayLists to construct with a capacity of 1 saves some
4637         memory. (56216kb->55585kb)
4639 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4641         A fix for bug #347189 (2nd issue)
4642         * expression.cs (MemberAccess): Nested type can be found in base non-generic
4643         type.
4645 2007-12-27  Miguel de Icaza  <miguel@novell.com>
4646         
4647         * report.cs: Do not use colors if stdout and stderr are not a
4648         terminal.
4650 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4652         A fix for bug #346998
4653         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4654         overloads.
4656 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4658         A fix for bug #343465
4659         * class.cs: Explicit method name for nested types uses dots only.
4661 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4663         A fix for bug #343707
4664         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4666 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4668         * ecore.cs: Report type inference errors only when arguments count matches
4669         parameter count.
4670         
4671         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4672         
4673         * expression.cs, report.cs: New warning.
4674         
4675         * typemanager.cs: Catch anonymous method type too.
4677 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4679         A fix for bug #346379
4680         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4682 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4684         A fix for bug #347359
4685         * expression.cs (Invocation): Don't resolve already resolved expression.
4687 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4689         A fix for bug #347189
4690         * class.cs (FixedField): Use non-dependent code only in the define phase.
4692 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4694         A fix for bug #348076
4695         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4697 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4699         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4700         discovered extension methods.
4702 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4704         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4705         method.
4707 2007-12-21  Miguel de Icaza  <miguel@novell.com>
4709         * report.cs (ErrorMessage): Add support for using colors on
4710         terminals that support it. 
4712 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4714         * ecore.cs: Use information about expanded params for error reporting.
4716 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4718         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4719         and logic for params overloads.
4720         
4721 2007-12-15  Miguel de Icaza  <miguel@novell.com>
4723         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4724         as this is also created from the parser.  Fixes #349034
4726 2007-12-12  Miguel de Icaza  <miguel@novell.com>
4728         * statement.cs (Throw.CloneTo): it is valid to have empty
4729         expressions for throw. 
4731 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4733         * cs-parser.jay: Set delegate constraint parsing region correctly.
4735 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4737         A fix for bug #345467
4738         * typemanager.cs (IsEqual): Compare generic parameters position only.
4739         
4740 2007-11-28  Marek Safar  <marek.safar@gmail.com>
4742         * expression.cs (BaseAccess): Type arguments can be null.
4744 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4746         * statement.cs (Block.Resolve): Ensure flow-branching tree is
4747         consistent even when an error has occured.
4748         (Switch.Resolve): Likewise.
4750 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4752         A fix for bug #334505
4753         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4754         overrides.
4755         
4756 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4758         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
4759         refactorings required to resolve extension methods correctly when mixing
4760         generics and non-generics members.
4761         
4762 2007-11-20  Marek Safar  <marek.safar@gmail.com>
4764         A fix for bug #342584
4765         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4766         conversion.
4767         
4768 2007-11-19  Marek Safar  <marek.safar@gmail.com>
4770         A fix for bug #342512
4771         * delegate.cs: Use delegate argument expression when is available. Don't
4772         emit virtual call when class is sealed.
4773         
4774 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4776         A fix for bug #325423
4777         * assign.cs (FieldInitializer): Use resolved expression for emit.
4778         
4779         * class.cs: Print less confusing error message.
4780         
4781 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4783         * cs-tokenizer.cs: Removed GMCS ifdefs.
4784         
4785         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4786         mcs.
4787         
4788         * cs-parser.jay: Disabled nullable check.
4789         
4790         * generic-mcs: Copied more generic stuff.
4791                 
4792 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4794         * gcs-parser.jay: Merged to cs-parser.jay.
4795         
4796         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4797         * *.csproj, *.sources: Updated to use only jay parser file.
4799 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4801         * gcs-parser.jay: Added nullable and default expression feature checks.
4802         
4803 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4805         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4806         it fixes many TODOs and hidden bugs.
4807         
4808         * expression: Removed duplicate error check.
4810 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4812         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4813         implicitly type local variable only when it is used in a declaration.
4815 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4817         * attribute.cs: Use CS0612 for empty strings.
4819 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4821         * lambda.cs, statement.cs: Contextual return may act as a statement.
4823 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4825         A fix for a regression cause by #324222
4826         * class.cs: Don't report unused even when it implements an interface.
4827         
4828 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4830         A fix for bug #341205
4831         * ecore.cs, expression.cs: Method group expression cannot do static
4832         method access with an instance reference check before overloading takes
4833         a place.
4834         
4835 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4837         A fix for bug #325359
4838         * class.cs: Use predictable name for automatically generated property.
4839         
4840 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4842         A fix for bug #324996
4843         * expression.cs (Is): Handle case where D is nullable and T is not
4844         correctly.
4845         
4846         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4847         
4848 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4850         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4851         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4852         Flush small error reporting changes.
4853         
4854 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4856         A fix for bug #324996
4857         * expression.cs: Rewrote Is expression implementation to work with
4858         generics, nullable types, anonymous method. A const result expression 
4859         uses existing infrastructure instead of custom not fully-featured one.
4860         
4861 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4863         A fix for bug #340202
4864         * class.cs: Consider generics for volatile field.
4866 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4868         A fix for bug #335594
4869         * expression.cs: Use conversion rules when handling string addition.
4870         
4871 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4873         A fix for bug #336651
4874         * expression.cs: Fixed a crash when probing is on.
4875         
4876 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4878         A fix for bug #324242
4879         * covert.cs: Added a conversion from any nullable-type with an 
4880         underlying enum-type to the type System.Enum.
4881         
4882 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4884         A fix for bug #324222
4885         * class.cs: Report all non-used event fields.
4886         
4887 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4889         A fix for bug #325161
4890         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4891         qualifier for generic types.
4892         
4893 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4895         A fix for bug #322971
4896         * expression.cs, ecore.cs: Added intermediate result value check for
4897         indexers. 
4898         
4899 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4901         A fix for bug #324754
4902         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4903         when it was requested.
4905 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4907         A fix for bug #325101
4908         * expression.cs: Do type not value comparison for `is' expression.
4910 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4912         A fix for bug #320236
4913         * convert.cs: Don't apply user conversion on underlying target type.
4915 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4917         * expression.cs: Don't use unresolved expression for error reporting.
4919 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4921         A fix for bugs #337712, #324490
4922         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4923         overloading resolution too.
4924         
4925         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4926         the process consistent and more robust.
4927         
4928         * expression.cs, linq.cs, report.cs: Update.
4930 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4932         A fix for bug #332909
4933         * attribute.cs: Resolve attributes in correct context using error
4934         handling procedure.
4935         
4936         * rootcontext.cs: Define Obsolete attribute members as core members.
4937         
4938 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4940         * statement.cs: Removed unused methods.
4941         
4942 2007-10-31  Wade Berrier  <wberrier@novell.com>
4944         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4945         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4946         during 'make dist')
4948 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4950         A fix for bug #338102
4951         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4952         methods registered as non-generics.
4953         
4954 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4956         A fix for bugs #337712, #324490
4957         * delegate.cs: Delegate covariance and contravariance is not allowed for
4958         value types.
4959         
4960 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4962         A fix for bug #337719 
4963         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4964         `from' keyword.
4965         
4966 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4968         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4970 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4972         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4973         query expressions.
4975 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4977         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4979 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4981         A fix for bug #334652
4982         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4983         extension methods when we have not found the best candidate in normal
4984         container.
4986 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4988         * AssemblyInfo.cs: Keep up-to-date.
4990 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4992         * Makefile: Fixed generics compiler name.
4993         
4994 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4996         * lambda.test: removed, lambda parsing is done differently.
4997         
4998         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
5000 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
5002         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
5004 2007-10-27  Marek Safar  <marek.safar@gmail.com>
5006         * Makefile, *.sources : All C# compilers are in mcs folder.
5007         
5008         * *.cs: Use existing 2_1 define for smcs.
5010 2007-10-26  Marek Safar  <marek.safar@gmail.com>
5012         A fix for bug #335847
5013         * assign.cs, expression.cs: Couple of changes to avoid creating a
5014         temporary variable for each object initializer assignment statement. It
5015         simplifies struct initialization too, otherwise two temporary variables
5016         would be required.
5017         Implemented optimization of redundant default element initializers.
5018         
5019 2007-10-25  Marek Safar  <marek.safar@gmail.com>
5021         A fix for bug #336766
5022         * expression.cs (Class.CheckBase): Use generic name when method is
5023         generic.
5024         
5025 2007-10-25  Marek Safar  <marek.safar@gmail.com>
5027         A fix for bug #334737
5028         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
5029         variable and not variable argument for prepared copies.
5031 2007-10-24  Marek Safar  <marek.safar@gmail.com>
5033         A fix for bug #325110
5034         * class.cs, expression.cs, attribute.cs: Use open generic method when
5035         checking conditional attribute.
5036         
5037 2007-10-24  Marek Safar  <marek.safar@gmail.com>
5039         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
5040         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
5041         FeatureIsNotAvailable.
5043 2007-10-24  Marek Safar  <marek.safar@gmail.com>
5045         ** C# 3.0 Partial methods
5046         
5047         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
5048         methods support. Because of member cache issue with generics only
5049         non-generics partial methods are fully supported.
5050         
5051 2007-10-23  Marek Safar  <marek.safar@gmail.com>
5052         
5053         * class.cs, decl.cs: Rewrote member overloads check to cope with 
5054         generics and to use member cache for member checking. It also improves
5055         performance and fixes remaining overloads issues.
5056         
5057 2007-10-20  Marek Safar  <marek.safar@gmail.com>
5058         
5059         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
5060         roottypes.cs, typemanager.cs:
5061                 
5062         A member cache creation logic changed to add members immediately and
5063         not rely on fallback. The member cache is now only prefered way
5064         how to access and find type declaration members. It saves 5 MB of memory
5065         during MWF compilation and makes code ready for more optimizations and
5066         clean-ups, it's also a pre-requirement for partial methods.
5067         
5068 2007-10-18  Raja R Harinath  <harinath@gmail.com>
5070         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
5071         handling for generic parameters.
5073 2007-10-15  Marek Safar  <marek.safar@gmail.com>
5074         
5075         * class.cs (FixedField): Removed redundant volatile check.
5076         
5077 2007-10-15  Marek Safar  <marek.safar@gmail.com>
5078         
5079         * class.cs, decl.cs: Fixed overload members verification to do only one
5080         check per possible collision.
5081         
5082 2007-10-13  Marek Safar  <marek.safar@gmail.com>
5083         
5084         A fix for bug #325478
5085         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
5086         and create only one disposable flags container.
5087         
5088 2007-10-12  Marek Safar  <marek.safar@gmail.com>
5089         
5090         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
5091         * statement.cs (Fixed): Fixed variables cloning.
5092         
5093 2007-10-12  Marek Safar  <marek.safar@gmail.com>
5094         
5095         A fix for bug #333342
5096         * class.cs (EventField): Don't mark value type event as synchronized. 
5097         
5098 2007-10-12  Marek Safar  <marek.safar@gmail.com>
5099         
5100         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
5101         inference to identify best candidate method correctly.
5102         (ProperyExpr): A range variable is read only and cannot be modified.
5103         
5104 2007-10-11  Marek Safar  <marek.safar@gmail.com>
5105         
5106         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
5107         logic to identify best candidate method correctly.
5108         
5109 2007-10-11  Marek Safar  <marek.safar@gmail.com>
5110         
5111         * location.cs (Equals, GetHashCode): Removed.
5112         
5113 2007-10-11  Marek Safar  <marek.safar@gmail.com>
5114         
5115         * report.cs: Implemented message recorder. It is used mainly for lambda
5116         expressions to capture otherwise swallowed error messages.
5117         
5118         * anonymous.cs, lambda.cs.cs: Do full parameters check.
5120         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
5121         and not at the top.
5122         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
5123                 
5124         * expression.cs (MemberAccess): Always report lookup failure.
5125         
5126         * location.cs: Implemented Equals, GetHashCode.
5127         
5128         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
5129         
5130 2007-10-10  Jb Evain  <jbevain@novell.com>
5132         * codegen.cs: re-enable assembly version check.
5134 2007-10-09  Marek Safar  <marek.safar@gmail.com>
5135         
5136         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
5137         checks.
5138         
5139         * namespace.cs (UsingAlias): Do correct version check.
5140         
5141 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5142         
5143         * expresison.cs, ecore.cs: Issue extension method error message when
5144         appropriate.
5145         
5146         * rootcontext.cs: Added ISO_2 compiler mode option.
5148 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5149         
5150         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
5151          message.
5152         
5153 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5154         
5155         * attribute.cs (GetString, GetBoolean): Work with both literal and
5156         constant.
5157         
5158         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
5159         Moved method overload specific methods to MethodGroupExpr.
5160         
5161         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
5162         it should be less memory consuming.
5163         
5164 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5166         * codegen.cs: remove the assembly version check until the buildbot is
5167         fixed.
5169 2007-10-07  Jb Evain  <jbevain@novell.com>
5171         * attribute.cs (Attribute.GetString): if the value
5172         expression is a StringConstant, return its string value.
5174 2007-10-07  Jb Evain  <jbevain@novell.com>
5176         * typemanager.cs: add `assembly_version_attribute_type`.
5177         * codegen.cs: on attribute emission, check that the
5178         AssemblyVersionAttribute doesn't overflow.
5180 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5181         
5182         A fix for bug #324677
5183         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
5184         parent container of a scope container with currently resolved one. 
5185         
5186 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5187         
5188         A fix for bug #325534
5189         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
5190         only.
5191         
5192 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5193         
5194         A fix for bug #327504
5195         * class.cs (Operator.Define): Refactored implicit and explicit user
5196         operator conversion rules.
5197         
5198 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5199         
5200         A fix for bug #327520
5201         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
5202         
5203 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5204         
5205         A fix for bug #328022
5206         * class.cs (MethodData.Define): Use correct method to check whether
5207         a method implementents an accessor.
5208         
5209 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5210         
5211         A fix for bug #330069
5212         * statement.cs (Fixed.Resolve): Read the first array element only when
5213         an array is instantiated. 
5214         
5215 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5216         
5217         * expression.cs, assign.cs, generics.cs: Print correct operator when
5218         compound assignment is used.
5219         
5220 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5221         
5222         A fix for bug #325841
5223         * expression.cs (ArrayAccess): Use full argument cloning only for
5224         string compound concatenation.
5225         
5226 2007-10-03  Marek Safar  <marek.safar@gmail.com>
5227         
5228         A fix for bug #328774
5229         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5230         assignment.
5231         (PropertyExpr.EmitAssign): Fixed string concatenation compound
5232         assignment.
5234 2007-10-03  Raja R Harinath  <rharinath@novell.com>
5236         Fix #328490
5237         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5238         Event accessibility checks here.  Remove some bogus code that
5239         accidently made GenericMethods work.
5240         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5242 2007-09-25  Marek Safar  <marek.safar@gmail.com>
5243         
5244         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5245         
5246         * statement.cs (Block): Refactored AddVariable to allow error handling
5247         customization.
5248         
5249         * generic.cs: New stub.
5250         
5251 2007-09-23  Marek Safar  <marek.safar@gmail.com>
5252         
5253         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5254         flag.
5255         
5256 2007-09-17  Marek Safar  <marek.safar@gmail.com>
5258         * class.cs: Use partial container to record whether any partial part
5259         contains static field initializer and therefore default contructor has
5260         to be defined.
5261         
5262 2007-09-14  Marek Safar  <marek.safar@gmail.com>
5264         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5265         mono-list when only one of two partial parts has defined accessibility
5266         modifier.
5267         
5268 2007-09-14  Marek Safar  <marek.safar@gmail.com>
5270         A fix for bug #82845
5271         
5272         * class.cs (TypeContainer): Set correct resolve context for all field
5273         initializers.
5274         
5275 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5277         * assign.cs: Fixed a crash when field is resolved twice with an error.
5278         
5279         * codegen.cs: Changed InFieldInitializer to be flag.
5280         
5281         * anonymous.cs, ecore.cs, expression.cs: Update after
5282         IsInFieldInitializer rename.
5283         
5284         * const.cs: Removed unused parameter.
5285         
5286         * class.cs: Changed the way how we resolve and emit field initializers.
5287         The field initilizers have to have access to contructor block to emit
5288         compiler generated code.
5290 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5292         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5293         generics use TypeContainer instead.
5294         
5295 2007-09-12  Marek Safar  <marek.safar@gmail.com>
5296         
5297         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5299         * lambda.cs (ResolveParameters): Use more powerful
5300         InflateGenericArgument.
5301         
5302         * parameters.cs: Better exception message.
5303                 
5304 2007-09-10  Marek Safar  <marek.safar@gmail.com>
5306         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5307         correct expression block type. 
5308         
5309         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5310         
5311         * expression.cs (Invocation): Extracted method group resolve to
5312         DoResolveOverload.
5313         
5314 2007-09-07  Marek Safar  <marek.safar@gmail.com>
5316         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5317         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5318         
5319         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5320         generic extension methods.
5322 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5324         A fix for bug #82676 (Do I get it right now?)
5325         * convert.cs (Binary.ResolveOperator): An interface is converted to the
5326         object before a standard conversion is applied.
5327         
5328 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5330         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5331         #82676.
5332         
5333 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5335         A fix for bug #82676
5336         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5337         non-generic interface types.
5338         
5339 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5341         A fix for bug #82690
5342         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5343         
5344 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5346         A fix for bug #82571
5347         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
5348         modifier for container based methods.
5349         
5350 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5352         A fix for bug #82676
5353         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5354         any interface-type T means to any of interface type T.
5356 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5358         * namespace.cs: We have 2 versions of System.Core assembly.
5360 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5362         A fix for bug #82652
5363         * class.cs (Class.GetClassBases): Compare types and not expressions.
5365 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5367         A fix for bug #82620
5368         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5369         actually never worked before.
5370         (IndexerAccess): Emit prepared arguments before they are modified.
5371         
5372 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5374         A fix for bug #82563
5375         * assign.cs: Revert wrong fix.
5376         
5377         * expression.cs (VariableReference.EmitAssign): Handle ref reference
5378         correctly.
5379         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5380         Instead of ldelema/stdind we have to use temporary variables to handle
5381         cases like String.Concat (params string[]).
5382         
5383 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5385         * class.cs: EmitAttributes to Emit rename.
5386         
5387         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5388         null.
5389         (MemberCore.HasClsCompliantAttribute): Don't depend on 
5390         GetClsCompliantAttributeValue execution.
5391         
5392 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5394         * anonymous.cs: Use shorter type prefix.
5395         
5396         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5397         when exist.
5398         
5399         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5400         variables when probing is on.
5401         
5402         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
5403         unresolved variables.
5404         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5405         handle transparent identifiers.
5406         
5407 2007-08-26  Marek Safar  <marek.safar@gmail.com>
5409         * attribute.cs (IsClsCompliant): Add nullable types test.
5410         
5411 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5413         * doc.cs : catch other types of exception than XmlException to
5414           report CS1570. Fixed bug #82565.
5416 2007-08-23  Marek Safar  <marek.safar@gmail.com>
5418         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
5419         The number of delegate parameters has to match.
5420         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5421         arrays.
5423 2007-08-21  Marek Safar  <marek.safar@gmail.com>
5425         * anonymous.cs (AnonymousMethod): Generate private anonymous method
5426         to fix problem with private arguments.
5428 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5430         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5431         
5432         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
5433         
5434         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5435         empty. Add cloning suport.
5436         
5437         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5439 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5441         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
5442         to create EmptyCast. It handles EmptyConstantCast specialization for
5443         constants.
5444         
5445 2007-08-18  Marek Safar  <marek.safar@gmail.com>
5447         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5448         (EmitArrayArgument): One routine for array arguments.
5449         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
5450         
5451 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5453         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5455 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5457         * anonymous.cs: MemberLookupFinal update.
5459         * class.cs (ConstructorInitializer): Is expression based.
5460         
5461         * delegate.cs: MethodGroupExpr update.
5462         
5463         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
5464         messages.
5465         (Error_MemberLookupFailed): Customizable error override.
5466         (MethodGroupExpr): Keep queried type for later usage.
5467         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5468         resolve.
5469         
5470         * expression.cs: Error_MemberLookupFailed refactoring.
5471         (New.DoResolve): Resolve as much as possible.
5472         (ElementInitializer.Error_MemberLookupFailed): Object initializer
5473         customization for invalid member types.
5475         * statement.cs: MethodGroupExpr update.
5476         
5477 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5479         * modifier.cs (Check): Check all modifiers and not only accessibility
5480         ones.
5482 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5484         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5485         type and not an expression.
5487 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5489         * statement.cs (Catch.Clone): Type and variable can be null.
5491 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5493         A fix for bug #81979
5494         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5495         I am really not sure whether this is the best fix.
5496         
5497         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5498         only once.
5499         
5500 2007-08-14  Marek Safar  <marek.safar@gmail.com>
5502         ** C# 3.0 Object and collection initializers (major re-write)
5503         
5504         * assign.cs (DoResolve): Initializers are not assign related.
5505         
5506         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5507         used during collection or object initialization.
5508         
5509         * expression.cs (Error_InvalidArguments): Add initializers specific
5510         messages. More will come later because it requires some general
5511         refactoring.
5512         (New.DoResolve): Better error handling for unsafe types.
5513         (EmptyExpressionStatement): New class.
5514         (ElementInitializer): An object initializer expression.
5515         (CollectionElementInitializer): A collection initializer expression.
5516         (CollectionOrObjectInitializers): A block of object or collection
5517         initializers.
5518         (NewInitialize): New expression with element/object initializers.
5519         
5520         * statement.cs: Reverted object/collection initializer hacks.
5521         
5522         * typemanager.cs (CSharpName): Filter __arglist type.
5523         
5524 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5526         ** C# 3.0 Anonymous Types (update to the latest standard)
5527         
5528         * expression.cs (Binary.ResolveOperator): Threat all null based types
5529         same.
5530         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5531         (AnonymousTypeParameter): Updated.
5532         
5533         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5534         (AnonymousTypeClass): New anonymous type container.
5535         
5536         * class.cs (AddField): Return operation result.
5537         
5538         * generic.cs: Another empty TypeArguments overload.
5539         
5540         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5541         are stored at top of normal hierarchy.
5542         
5543         * typemanager.cs (CSharpName): Filter anonymous types.
5544         
5545 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5547         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5548         as single Concat call. How could we miss that :-(
5549         
5550 2007-08-08  Marek Safar  <marek.safar@gmail.com>
5552         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5553         
5554 2007-08-07  Miguel de Icaza  <miguel@novell.com>
5556         * expression.cs: Fix the previous commit, the creation of the
5557         arguments array list needs also to be conditional on the arguments
5558         not being null.
5560         * class.cs: Add a little bit of help to help narrow down problems.
5562         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5563         not try to copy in that case. 
5565         * driver.cs: When building SMCS, include a new different set of
5566         default assemblies here.   Do this here so we can control whether
5567         to include the default assemblies with /noconfig.
5569 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5571         A fix for bug #81979
5572         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5573         only.
5575 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5577         A fix for bug #82300
5579         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5580         we are in probing scope.
5582 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5584         A fix for bug #82301
5586         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5587         (Statement.CloneTo): Clone and not map children blocks.
5589 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5591         A fix for bug #82299
5593         * expression.cs (LocalVariableReference.CloneTo): Remap local info
5594         variable too.
5595         
5596         * statement.cs (Statement.CloneTo): Clone variables before statements
5597         to allow remaping of local variables.
5599 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5601         A fix for bug #82296
5603         * anonymous.cs,
5604         * report.cs: Log crash details for future clone problems.
5605         
5606         * statement.cs (Return.Clone): Don't clone non-existent expression.
5608 2007-08-03  Raja R Harinath  <harinath@gmail.com>
5610         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5611         (Class.AddBasesForPart): Move CS0537 check here from ...
5612         * cs-parser.jay (class_declaration): ... here.  Move calling of
5613         'AddBasesForPart' to ...
5614         (class_bases): ... here.
5615         (struct_declaration, interface_declaration): Update to changes.
5617 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5619         A fix for bug #81923
5621         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5622         conversion is allowed.
5624 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5626         A fix for bug #81564
5628         * ecore.cs (EventExpr): Add IsBase handling.
5630         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5631         too.    
5632         
5633 2007-08-02  Raja R Harinath  <harinath@gmail.com>
5635         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5636         * cs-parser.jay: Some whitespace cleanups.
5637         (current_delegate): New.
5638         (type_name): New.
5639         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5640         a dummy code block, and use 'type_name' instead of 'member_name'.
5641         (interface_declaration, class_declaration): Likewise.
5642         (delegate_declaration): Likewise.  Rearrange slightly and use
5643         'current_delegate'.
5644         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5645         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
5647 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5649         A fix for bug #82039
5651         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5652         available.
5654         * typemanager.cs (CSharpName): Split to string overload.
5656 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5658         * expression.cs,
5659         * report.cs: Updated warning CS0472.
5661 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5663         A fix for bug #82181
5664         * cs-parser.jay,
5665         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5667 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5669         A fix for bug #82277
5670         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5672 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5674         ** C# 3.0 Type Inference (major bits are working)
5675         
5676         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5677         (.ImplicitStandardConversionExists): Uses compatible.
5678         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5679         (.InferReturnType): New method.
5680         (.Compatible): Refactored.
5681         (.ResolveParameters): Uses factory to create resolved parameters.
5682         (.CompatibleMethod): Add probing mode support.
5683         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5684         clearly distinguish between 2 different operations.
5685         (LambdaMethod): Moved to lambda.cs.
5686         (AnonymousMethod): Removed unused fields and methods.
5687         (AnonymousDelegate): Simplified.
5688         
5689         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5690         
5691         * convert. cs (ImplicitConversionStandard): Compatible works differently.
5692         
5693         * delegate.cs (Delegate): New mehods to reduce code duplication.
5694         (.GetConstructor): New method.
5695         (.GetInvokeMethod): New method.
5696         (DelegateCreation): Updated.
5697         
5698         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5699         does not exist.
5700         (OverloadResolve): Made probing little bit faster.
5701         
5702         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5703         when probing is on.
5704         
5705         * generic.cs (TypeInferenceContext): Dummy implementation.
5706         
5707         * iterators.cs: Updated after Resolve/Define rename.
5708         
5709         * lambda.cs (LambdaExpression)
5710         (.ResolveParameters): Handles both type of arguments and type inference too.
5711         
5712         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5713         (InflateTypes): Updated.
5714         
5715         * support.cs (InflateTypes): Changed signature and updated.
5716         
5717         * typemanager.cs (LookupMemberCache): Better dynamic type check.
5718         (MemberLookup_FindMembers): More MS tricks.
5719         (GetParameterData): Ditto.
5720         (GetDelegateParameters): Uses quick path for dynamic types.
5721         
5722 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5724         * class.cs (MethodData.Define): EmitContext is required for generic stuff
5725         only.
5727 2007-07-31  Marek Safar  <marek.safar@gmail.com>
5729         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5730         syntax.
5731         
5732 2007-07-26  Jb Evain  <jbevain@novell.com>
5734         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5735         which takes a boolean 'report_errors', similar to the GetMethod.
5736         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5737         in .net 2.1, do not report errors here.
5739         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5740         System.Runtime.CompilerServices.RequiredAttributeAttribute and
5741         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5742         in .net 2.1.
5744         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5745         of the type InternalsVisibleToAttribute before the first call
5746         to CoreLookupType which is allowed to fail (third boolean parameter
5747         to true). Because, during the resolution for a type that is not
5748         immediately found, we try to check if the type is not defined in
5749         a friend assembly, and to do so, we need the
5750         InternalVisibleToAttribute.
5752 2007-07-23  Miguel de Icaza  <miguel@novell.com>
5754         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5755         feature that allows structs to be compared against null and inline
5756         the result as true or false.
5758         Notice that the same code is not permitted inside a generic block
5759         of code that would do:
5761         class Foo<T> where T : struct {
5762             bool Eval (T x)
5763             {
5764                  return x == null;
5765             }
5766         }
5768         It is only allowed if the type of T is not bound (no where
5769         clause).   In my opinion, this CSC 2 behavior is broken but people
5770         seem to be using it (IronRuby does, a few bug reports on bugzilla
5771         have it and some people have complained about it).
5773         All of the users that depend on this behavior have code that is
5774         very likely broken. 
5775         
5776         * report.cs (Warning, Error): make these take object arguments,
5777         not strings, as that allows us to take advantage of Format.
5779 2007-07-20  William Holmes  <billholmes54@gmail.com>
5781         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
5782           Left member variable for the Count.
5783         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
5784           MemberName.CountTypeArguments to avoid a NRE. 
5786         This code is contributed under the MIT X11 license
5788 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5790         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5792 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5794         * doc.cs : generic method arguments are written as ``x while generic
5795           type arguments are `x. Combined with the previous change, fixed bug
5796           #79706.
5798 2007-07-18  Raja R Harinath  <rharinath@novell.com>
5800         Fix #82120
5801         * expression.cs (Binary.ResolveOperator): When converting
5802         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5804 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5806         * doc.cs : when T: or whatever x: is specified, it does not really
5807           check the doc comment's syntax correctness. Fixed bug #82006.
5809 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5811         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5812         LambdaExpression better.
5813         
5814         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5815         
5816         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5817         
5818         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5819         as it can be generated.
5820         
5821         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5822         modifiers.
5823         
5824         * lambda.cs (LambdaExpression): Refactored to share same code with
5825         AnonymousMethodExpression.
5826         
5827 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5829         * anonymous.cs (MakeName): Include host name for easier debugging.
5830         (LambdaMethod): New class for lambda spcecific stuff.
5831         
5832         * attribute.cs: Set EmitContext return type.
5834         * class.cs: Set EmitContext return type.
5835         
5836         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5837         with null/void meaning.
5838         
5839         * iterators.cs (ContainerType): Implemented.
5840         
5841         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5842         
5843         * statement.cs (Return): Updated to lambda expressions.
5844         (Block.CloneTo): Parent can be null.
5845                 
5846 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5848         A fix for bug #81917
5849         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5850         
5851         * class.cs (FixedField): Check whether field is in unsafe scope.
5853         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5854         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5856         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5857         FieldExpr.
5858         
5859         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5860                 
5861 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5863         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5864         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5865         from Report class.
5867 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5869         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5870         
5871 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5873         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5874         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5875         
5876         * codegen.cs(EmitContext): Add ProbingMode flag.
5877         
5878         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5879         
5880         * driver.cs: For now set both warning values.
5881         
5882         * ecore.cs (SimpleName): Name is readonly.
5883         (MethodGroup.OverloadResolve): One quick path for probing.
5884         
5885         * expression.cs (Unary): Set Oper r/o.
5886         (Binary): Set Oper r/o.
5887         (ParameterReference): Set few instance variables as r/o.
5888         (ParameterReference.DoResolveBase): Don't capture aruments when 
5889         the probing is on.
5890         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5891         (Arglist): arguments are private.
5892         (SizeOf): type is private and r/o.
5893         (MemberAccess): arguments are private.
5895         * report.cs: Enhanced reporting on/off capabilities.
5896         
5897         * lambda.cs: Uses ec.IsInProbingMode.
5898         (ContextualReturn): Derives from return.
5899         
5900         * rootcontext.cs: For now set both warning values.
5901         
5902         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5903         copy if one exists.
5904         (Return.Resolve): Don't die immediately.
5905         (Block.Resolve): Speed-up probing.
5906         (Block.CloneTo): Clone only child blocks.
5908 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5910         * iterators.cs: reverted Miguel's latest change (r81925) as it
5911         breaks the build in System.
5913 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5915         * iterators.cs (Yield.CheckContext): Check for the iterator type
5916         also here as we can call into Yield even in codepaths that are not
5917         directly checked by
5918         (MethodOrOperator is the only path that was checked).
5920         In addition to the standard check, use a more specific check for
5921         constructors to report a more verbose error. 
5923 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5925         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5926         report the warning and continue 
5928         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5929         values on the stack on the call to Emit.   Use EmitStatement if
5930         possible, or using Emit + Pop if not possible.   Fixes #82064
5932 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5934         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5935         avoid try...finally in some cases.
5937 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5939         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5940         
5941         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5942         instead of method. Re-use standard error handling.
5943         (ConstructorInitializer.Emit): Simplified.
5944         
5945         * delegate.cs: Updated after Invocation.EmitCall change.
5946         
5947         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5948         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5949         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5950         method and don't permanently changing input arguments.
5951         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5952         is resolved it has one of the candidates is the best one which is later
5953         used to emit. Removed a few unused method.
5954         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5956         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5957         (Binary.ResolveOperator): Ditto.
5958         (ConditionalLogicalOperator.DoResolve): Ditto.
5959         (Invocation): Uses method group.
5960         (Invocation.DoResolve): Simplified.
5961         (Invocation.EmitCall): Removed useless is_static.
5962         (Invocation.Emit): Delegate to method group.
5963         (Invocation.EmitStatement): Simplified.
5964         (New): Uses method group.
5965         (MemberAccess.DoResolve): Don't destroy original expression.
5966         
5967         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5968         
5969 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5971         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5972         
5973         * anonymous.cs,
5974         * lambda.cs: Add custom error message type.
5976 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5978         * lambda.cs: Simplified little bit.
5979         
5980         * parameter.cs: Introduced ImplicitLambdaParameter.
5981         (Parameters.CreateFullyResolved): New factory instead of ctor.
5982         
5983         * anonymous.cs,
5984         * class.cs,
5985         * delegate.cs: Updated parameter creation.
5986         
5987 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5989         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5990         arguments.
5991         
5992         * generic.cs: Synchronized with gmcs.
5993         
5994 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5996         * class.cs (Indexer): Check return type as soon as possible.
5997         
5998         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5999         members too.
6000         
6001         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
6002         
6003         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
6004         
6005         * parameter.cs (Parameter): Use expression type when it is available.
6006         
6007         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
6008         method modifier for the first parameter only.
6010 2007-06-24  Marek Safar  <marek.safar@gmail.com>
6012         A fix for bug #81938
6013         * typemanager.cs (ChangeType): Fixed couple of char conversions.
6014         
6015         * constant.cs: Tide up an exception message.
6017 2007-06-22  Marek Safar  <marek.safar@gmail.com>
6019         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
6020         an uninitialized variable is used.
6021         
6022         * expression.cs (LocalVariableReference.DoResolve): Ditto.
6024 2007-06-22  Marek Safar  <marek.safar@gmail.com>
6026         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
6027         not found error handling.
6029         * expression.cs (ArrayCreation): Removed redundant fields and little bit
6030         simplified.
6031         (ArrayCreation.ResolveArrayElement): To be ready to customization.
6032         (ArrayCreation.DoResolve): Simplified.
6033         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
6034         its own resolve process.
6035         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
6037 2007-06-20  Marek Safar  <marek.safar@gmail.com>
6039         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
6040         more error details.
6041         
6042 2007-06-20  Marek Safar  <marek.safar@gmail.com>
6044         * cs-tokenizer.cs: Removed var related stuff.
6045         
6046         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
6047         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
6048         a type and a keyword at same time.
6049         
6050         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
6051         matches to "var".
6052         
6053         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
6054         implicitly typed arrays, more changes will follow.
6055         
6056         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
6057         
6058 2007-06-19  Marek Safar  <marek.safar@gmail.com>
6060         * ecore.cs (VarExpr): Removed Handled field.
6061         
6062         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
6063         build-in assign functionality.
6064         (ForEach.Resolve): Removed all implicitly typed local variable code and
6065         simplified.
6066         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
6067         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
6069 2007-06-18  Marek Safar  <marek.safar@gmail.com>
6071         * assign.cs: Removed implicitly typed local variable check.
6072         
6073         * expression.cs (LocalVariableReference.DoResolve): Add check for self
6074         referencing implicitly typed local variable.
6075         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
6076         variable here.
6077         
6078         * statement.cs (Fixed): Removed unsupported implicitly typed local
6079         variable code.
6081 2007-06-15  Marek Safar  <marek.safar@gmail.com>
6083         * decl.cs (MemberName): Moved all Unbound stuff to parser.
6085 2007-06-14  Marek Safar  <marek.safar@gmail.com>
6087         A fix for bugs #81855 and #76274
6088         * attribute.cs (AttachTo): Always set owner for global attributes to
6089         prefined owner.
6090         
6091         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
6092         usefull too.
6093         
6094         * cs-parser.jay: Assembly and module attributes must precede all other
6095         elements except using clauses and extern alias declarations.
6097 2007-06-13  Marek Safar  <marek.safar@gmail.com>
6099         A fix for bug #81748
6100         * cs-tokenizer.cs,
6101         * expression.cs: More checks for non ISO-1 features.
6103 2007-06-12  Marek Safar  <marek.safar@gmail.com>
6105         A fix for bug #81807
6106         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
6107         present inside switch statement and it is required by nullable check.
6109 2007-06-12  Marek Safar  <marek.safar@gmail.com>
6111         A fix for bug #81840
6112         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
6113         when type matching fails.
6114         
6115         * namespace.cs: Tiny error message change.
6117 2007-06-12  Marek Safar  <marek.safar@gmail.com>
6119         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
6120         reporting. Added automatic property check.
6121         
6122         * class.cs: Updated after CheckAbstractAndExtern relocation.
6123         (AEventPropertyAccessor.GetSignatureForError): Customized.
6124         
6125 2007-06-11  Marek Safar  <marek.safar@gmail.com>
6127         * class.cs (DefineBaseTypes): Base type can be undefined.
6128         
6129         * ecore.cs (TypeLookup): Minor refactoring.
6130         (DoResolveAsTypeStep): Removed redundant check.
6132         * namespace.cs (Lookup): Removed redundant check.
6133                 
6134         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
6135         ResolveAsTypeTerminal step.
6136         (BootstrapCorlib_*): Simplified.
6137         (PopulateCoreType): Core types can be now external.
6139 2007-06-07  Marek Safar  <marek.safar@gmail.com>
6141         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
6142          verification only.
6143          (InferTypeArguments): Infers anonymous expression type arguments.
6144          (Compatible): Split to Compatible and InferTypeArguments. 
6145         
6146         * lambda.cs: Updated.
6148 2007-06-08  Marek Safar  <marek.safar@gmail.com>
6150         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
6152 2007-06-07  Raja R Harinath  <harinath@gmail.com>
6154         Fix #80477, cs0135-2.cs, cs0135-3.cs
6155         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
6156         names to the "known" variables list.
6157         (Block.CheckInvariantMeaningInBlock): Handle the fact the
6158         parameter names are also "known".
6159         (Block.CheckError136): Remove.
6160         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
6161         null.
6163 2007-06-07  Marek Safar  <marek.safar@gmail.com>
6165         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
6167 2007-06-06  Marek Safar  <marek.safar@gmail.com>
6169         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
6170         internal error not an user error.
6171          
6172         * expression.cs (IsApplicable): Refactored to make debugging easier.
6174         * support.cs: More tricks for non-mono runtimes.
6175         
6176         * typemanager.cs (CoreLookupType): Made public.
6177         (InitSystemCore): All linq specific stuff moved to linq.cs
6179 2007-06-05  Marek Safar  <marek.safar@gmail.com>
6181         * typemanager.cs (CSharpSignature): One more missing build-in types
6182         replacement.
6183         More tricks for non-mono runtime.
6185 2007-06-05  Raja R Harinath  <harinath@gmail.com>
6187         * statement.cs (Block.CheckError136_InParents): Remove.
6188         (Block.AddVariable): Use GetParameterInfo instead.
6189         (ToplevelBlock.ProcessArguments): Likewise.
6191 2007-06-04  Raja R Harinath  <rharinath@novell.com>
6193         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
6194         information too.
6195         (ToplevelBlock.GetParameterInfo): Split out of ...
6196         (ToplevelBlock.GetParameterRefernce): ... this.
6197         (ToplevelBlock.ParameterMap): Remove.
6198         * expression.cs (ParameterReference): Update to use
6199         ToplevelParameterInfo.
6201         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
6202         regression.
6204         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
6205         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
6207         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
6208         (ToplevelBlock.ProcessParameters) ... here.
6209         (ToplevelBlock..ctor): Invoke it.
6211         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
6212         new parameters.
6214         * statement.cs (IKnownVariable): New interface.
6215         (LocalInfo): Implement it.
6216         (ToplevelParameterInfo): New class.
6217         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
6218         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
6219         GetKnownVariableInfo.
6221 2007-06-03  Raja R Harinath  <harinath@gmail.com>
6223         Partly speed up CS0136 error checks.
6224         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
6225         'recurse' parameter.
6226         (Block.DoCheckError136): Only check errors in parameters.  Move
6227         local variable checks ...
6228         (Block.AddVariable): ... here, and ...
6229         (ToplevelBlock.ResolveMeta): ... here.
6231 2007-06-02  Raja R Harinath  <harinath@gmail.com>
6233         * statement.cs (Block.IsChildOf): Remove.
6235         * statement.cs (Statement.Clone): Move special case code ...
6236         (Block.CloneTo): ... here.
6238 2007-05-29  Raja R Harinath  <rharinath@novell.com>
6240         * statement.cs (ToplevelBlock.container): Remove field.  It's
6241         redundant with 'Parent'.
6242         (ToplevelBlock.ContainerBlock): Remove accessor.
6243         (ToplevelBlock..ctor): Update to changes.  Register anonymous
6244         child with parent here, ...
6245         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
6246         current_block.
6247         (start_anonymous): Don't save current_block.
6248         (top_current_block): Remove.
6250         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6251         (Block.Resolve): Update to changes.
6252         (Block..ctor): Move setting of "correct" 'Toplevel'
6253         and 'Explicit' fields to ...
6254         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6256 2007-05-27  Raja R Harinath  <harinath@gmail.com>
6258         Kill Block.Implicit
6259         * statement.cs (Block.Implicit): Remove.
6260         (Block): Update to changes.
6261         * flowanalysis.cs: Likewise.
6263         Mildly speed up CheckInvariantMeaningInBlock
6264         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6265         Recursively call AddKnownVariable to all enclosing blocks.
6266         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6267         Remove recursive calls.
6268         (Block): Update to changes.
6270         New ExplicitBlock invariants
6271         * statement.cs (Block.Explicit): New field.  It points to the
6272         immediately enclosing non-implicit block.
6273         (Block..ctor): Maintain the invariant.
6274         * cs-parser.jay: Take advantage of invariant.
6276         Introduce ExplicitBlock
6277         * statement.cs (ExplicitBlock): New.
6278         (ToplevelBlock): Derive from it.
6279         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6280         sense of flag.
6281         (Block.Implicit): Update to changes.
6282         * cs-parser.jay: Update to changes.
6284         Remove unused field
6285         * codegen.cs (EmitContext.IsLastStatement): Remove.
6286         * statement.cs (Block.DoEmit): Update to changes.
6288 2007-05-25  Raja R Harinath  <rharinath@novell.com>
6290         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6291         modifying current_block directly.
6293 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
6294         
6295         * class.cs: Implemented automatic properties (C# 3.0)
6296           Thanks to Marek for the help.
6298 2007-05-23  Raja R Harinath  <rharinath@novell.com>
6300         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6301         variable as assigned, note also that all its components are
6302         assigned too.
6303         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
6305 2007-05-19  Marek Safar  <marek.safar@gmail.com>
6307         * anonymous.cs, class.cs: Emit Compiler generated attribute when
6308         member is marked as compiler generated.
6309         
6310         * decl.cs (MemberCore): Refactored ModFlags into property.
6312         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6313         (Check): Check only accessibility modifiers.
6315 2007-05-18  Raja R Harinath  <rharinath@novell.com>
6317         Track all assignable slots in one bit array
6318         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6319         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
6320         logic from VariableMap constructor here.  Use the same 'offset'
6321         variable that's later used for computing offsets of local
6322         variables.
6323         * flowanalysis.cs (UsageVector.parameters): Remove.
6324         (UsageVector): Update to changes.
6325         (VariableMap): Remove.
6327         Avoid creating ParameterMap in every block
6328         * statement.cs (Block.ParameterMap): Move ...
6329         (ToplevelBlock.ParameterMap): ... here.
6330         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6331         only once.
6332         * flowanalysis.cs (FlowBranching.param_map): Remove.
6333         (FlowBranching.UsageVector): Update to changes.
6334         (FlowBranchingToplevel.CheckOutParameters): Likewise.
6336         * statement.cs (Block.CloneTo): Clone Toplevel field too.
6338         * expression.cs (ParameterReference): Distinguish between block
6339         where parameter was referenced and declared.
6341 2007-05-18  Marek Safar  <marek.safar@gmail.com>
6343         * flowanalysis.cs, statement.cs: Put back improved error handling.
6345 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
6346         
6347         * assign.cs:
6348         * expression.cs:
6349           Imporved object and collection initialization (C# 3.0).
6351 2007-05-15  Marek Safar  <marek.safar@gmail.com>
6353         A fix for bug #81380
6354         * expression.cs (Is.DoResolve): Only value types have constant `is'
6355         behaviour.
6357 2007-05-15  Raja R Harinath  <rharinath@novell.com>
6359         * statement.cs (ToplevelBlock.child): Remove.
6361 2007-05-15  Raja R Harinath  <harinath@gmail.com>
6363         Rationalize ResolveMeta: refactoring
6364         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
6365         out constant handling code into ...
6366         (Block.DoResolveConstants): ... this.
6368         Rationalize ResolveMeta: kill local_map
6369         * statement.cs (Block.local_map, Block.LocalMap): Remove.
6370         (Block.AssignableSlots): New.
6371         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
6372         for locals -- move code from VariableMap here.  Avoid unnecessary
6373         allocations.
6374         * flowanalysis.cs (FlowBranching.local_map): Remove.
6375         (FlowBranching..ctor): Use Block.AssignableSlots.
6376         (VariableMap): Remove unused constructors.
6378 2007-05-11  Raja R Harinath  <rharinath@novell.com>
6380         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6382 2007-05-11  Marek Safar  <marek.safar@gmail.com>
6384         * typemanager.cs (IsFriendAssembly): Should not be called for building
6385         assembly.
6387 2007-05-09  Marek Safar  <marek.safar@gmail.com>
6389         * literal.cs (NullConstant): Print null in all cases.
6390         
6391         * expression.cs (Binary.ResolveOperator): Implemented delegate
6392          comparison based on C# 2.0 changes.
6394 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
6396         This code is contributed under the MIT X11 license
6397         
6398         The following enables support for several C# 3.0 language features:
6399         
6400         * cs-tokenizer.cs: Added support for the "var" keyword.
6401         
6402         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6403           Added VarExpr class to facilitate type inferencing.
6404         
6405         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6406           to support anonymous types.
6407         
6408         * assign.cs: Added support for type inferencing and initialization.
6409         
6410         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6411         
6412         * expression.cs: Added implicit array support to ArrayCreation.
6413           Added 5 types and 1 interface:
6414           
6415           IInitializable                Implementing classes can inject initializing
6416                                         statements after object instantiation.
6417           
6418           Initializer                   Stores data for object initialization.
6419           
6420           AnonymousType                 An expression for anonymous types.
6421           
6422           AnonymousTypeParameter        Stores data about an anonymous type's field.
6423           
6424           NewInitialize                 An expression for object initialization.
6425           
6426           CollectionInitialize          An expression for collection initialization.
6427         
6428         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6429           statements.
6431 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6433         A fix for bug #81500
6434         * cs-tokenizer.cs: Add special handling for coalescing operator.
6436 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6438         A fix for bug #81529
6439         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6440         its value from base class until it is redefined.
6442 2007-05-02  Raja R Harinath  <rharinath@novell.com>
6444         Fix regression in cs0631-3.cs
6445         * cs-parser.jay (operator_declarator): Add opt_attributes to error
6446         fallback.  Make error fallback catch more cases.
6448 2007-05-01  Miguel de Icaza  <miguel@novell.com>
6450         * cs-parser.jay: Allow parameters in operator declarations to have
6451         attributes. 
6453 2007-04-27  Miguel de Icaza  <miguel@novell.com>
6455         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6456         exists. 
6458         * lambda.cs (ContextualReturn.Resolve): An expression is valid
6459         inside the ContextualReturn, it does not have to be an
6460         ExpressionStatement. 
6462 2007-04-24  Miguel de Icaza  <miguel@novell.com>
6464         * lambda.cs (ContextualReturn.Resolve): if the return type is not
6465         set, set it.
6467 2007-04-23  Miguel de Icaza  <miguel@novell.com>
6469         * anonymous.cs (AnonymousContainer): split the virtual Resolve
6470         method in two methods: ResolveNoDefine and Resolve.
6472         ResolveNoDefine will stop just after ResolveTopBlock has been
6473         called.   
6475         Resolve will then continue by creating a method and issuing the
6476         call to method.Define ().
6478         (AnonymousMethod): Split and implement the new Resolve and
6479         ResolveNoDefine as well.
6481         * lambda.cs (LambdaExpression): Split the anonymous method
6482         resolution code into a separate routine (CoreCompatibilityTest)
6483         from DoCompatibleTest.
6485         (LambdaExpression.TryBuild): New method, this method tries to
6486         build the LambdaExpression with the given set of types to be used
6487         as the types for the various parameters of the lambda expression. 
6489         If the compilation succeed with the given types, the infered type
6490         of the Anonymous method is returned, otherwise null is returned.
6492 2007-04-23  Marek Safar  <marek.safar@gmail.com>
6494         A fix for bug #81414
6495         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6497 2007-04-22  Miguel de Icaza  <miguel@novell.com>
6499         * cs-tokenizer.cs: Change various identifiers here from the
6500         camelCasing to the recommended Linux-like style for instance
6501         variables from the Coding Guidelines. 
6503 2007-04-19  Martin Baulig  <martin@ximian.com>
6505         * convert.cs
6506         (Convert.ImplicitReferenceConversionCore): Allow conversions from
6507         System.Enum to System.ValueType.
6509 2007-04-13  Martin Baulig  <martin@ximian.com>
6511         Rewrote implicit reference conversions.  We need to distinguish
6512         between implicit reference conversions (13.1.4) and implicit
6513         boxing conversions (13.1.5).
6515         According to the spec, there's an an implicit conversion
6516         "From a one-dimensional array-type S[] to IList<T> and base
6517         interfaces of this interface, provided there is an implicit
6518         reference conversion from S to T."  Note that this does not
6519         include boxing conversions.
6521         * convert.cs
6522         (Convert.ImplicitTypeParameterBoxingConversion): New method.
6523         (Convert.ImplicitReferenceConversion): Split into
6524         ImplicitReferenceConversionCore() and
6525         ImplicitBoxingConversionExist().
6526         (Convert.ImplicitReferenceConversionExists): Use the new
6527         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6529 2007-04-12  Martin Baulig  <martin@ximian.com>
6531         * convert.cs (Convert.ImplicitReferenceConversion): Move the
6532         `TypeManager.null_type' checks up to the top of the method.
6534 2007-04-11  Marek Safar  <marek.safar@gmail.com>
6536         A fix for bug #81350
6537         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6538         extension methods.
6540 2007-04-11  Martin Baulig  <martin@ximian.com>
6542         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6543         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6544         to make this work for generic classes; fixes #79561.
6546 2007-04-11  Martin Baulig  <martin@ximian.com>
6548         * expression.cs (As): Add support for nullable types; fixes #79371.
6550 2007-04-11  Martin Baulig  <martin@ximian.com>
6552         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6553         `type.FullName' is null; fixes #80243.
6555 2007-04-11  Martin Baulig  <martin@ximian.com>
6557         * expression.cs (Invocation.IsApplicable): Don't modify the method
6558         if type inference succeeded, but the method was not applicable.
6559         Fixes #81250.
6561 2007-04-10  Marek Safar  <marek.safar@gmail.com>
6563         A fix for bug #81324
6564         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6565         internal and external namespaces containers.
6567 2007-04-10  Martin Baulig  <martin@ximian.com>
6569         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6570         TypeManager.DropGenericMethodArguments() so we also call
6571         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
6573 2007-04-10  Martin Baulig  <martin@ximian.com>
6575         * iterators.cs (Iterator.CreateIterator): Don't crash if
6576         `method.ReturnType' is null.  This happens if something went wrong
6577         while resolving that typ (we already reported an error in this case).
6579 2007-04-10  Martin Baulig  <martin@ximian.com>
6581         * expression.cs (New.DoResolve): Don't call CheckComImport() on
6582         generic interfaces; report the CS0144 directly.
6584 2007-04-10  Martin Baulig  <martin@ximian.com>
6586         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6587         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6589 2007-04-10  Martin Baulig  <martin@ximian.com>
6591         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6593 2007-04-09  Raja R Harinath  <rharinath@novell.com>
6595         A better fix
6596         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6597         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6599         Fix #81338
6600         * statement.cs (For.Resolve): If resolution fails, use
6601         KillFlowBranching.
6603 2007-04-08  Marek Safar  <marek.safar@gmail.com>
6605         * anonymous.cs (MakeName): Make faster and zero-based.
6606         (VerifyExplicitParameterCompatibility): Back to mode where generic
6607         parameter is ignored.
6608         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6610         * class.cs (EmitType): Method can emit another new method.
6612         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6614         * driver.cs: Updated.
6616         * lambda.cs: Reuse predefined empty parameters.
6618         * parameter.cs: Updated
6620         * support.cs: Implemented InflateTypes.
6622         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6623         (InitSystemCore): Introduced to isolate 3.0 dependencies.
6625 2007-04-03  Martin Baulig  <martin@ximian.com>
6627         Fix #80632.
6629         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6630         version of TypeManager.IsOverride() which also works with generic
6631         types.  
6633 2007-04-03  Martin Baulig  <martin@ximian.com>
6635         Fix #81044.
6637         * convert.cs
6638         (Convert.ExplicitReferenceConversion): We need to cast when
6639         converting from IList<T> to S[].
6641 2007-04-01  Marek Safar  <marek.safar@gmail.com>
6643         * decl.cs (FindExtensionMethods): Consider all candidates with same name
6644         at this level.
6645         
6646         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6648 2007-03-31  Marek Safar  <marek.safar@gmail.com>
6650         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6651         argument and return type inferring.
6653         * codegen.cs (InferReturnType): Flag whether return can be inferred.
6654         (ReturnType): Turned to property.
6656         * statement.cs (Return): Implemented return type inferring.
6658         * support.cs (ReflectionParameters): Use local types if possible.
6660 2007-03-30  Raja R Harinath  <rharinath@novell.com>
6662         * flowanalysis.cs (FlowBranching.Reachability): Remove.
6663         (FlowBranching.UsageVector): Update to changes.
6665         Prepare to kill 'Reachability'
6666         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6667         argument of constructor.
6669 2007-03-29  Raja R Harinath  <rharinath@novell.com>
6671         Prepare to kill 'Reachability'
6672         * flowanalysis.cs (UsageVector.is_unreachable): New.
6673         (UsageVector): Update to maintain 'is_unreachable' in parallel to
6674         'reachability', and verify they're consistent.
6676         Fix #81121
6677         * expression.cs (New.EmitStatement): Handle type parameters here too.
6679 2007-03-29  Martin Baulig  <martin@ximian.com>
6681         Fix #79148.
6683         * anonymous.cs
6684         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6685         CompilerGeneratedClass.
6686         (ScopeInfo.EmitScopeInstance): Make this protected.
6687         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6688         `ec.CurrentAnonymousMethod.Scope == Scope'.
6690         * statement.cs (Block.ScopeInfo): Make this a property.
6692 2007-03-27  Raja R Harinath  <harinath@gmail.com>
6694         Prepare to kill 'Reachability'
6695         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6696         (FlowBranching.UsageVector.Reachability): Remove property.
6697         (FlowBranching.UsageVector.IsUnreachable): New property.
6698         (FlowBranching.UsageVector.ResetBarrier): New.
6699         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6700         * codegen.cs, statement.cs: Update to changes.
6702 2007-03-27  Martin Baulig  <martin@ximian.com>
6704         Fix #81209.
6706         * decl.cs
6707         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6708         generic types.
6710 2007-03-26  Raja R Harinath  <rharinath@novell.com>
6712         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6713         instead of TriState.  Remove all mention of TriState.
6715         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6716         replaced by a boolean.  Add boolean 'is_unreachable' field, check
6717         and maintain invariants.
6719 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6721         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6723 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6725         * expression.cs: Stop using obsolete 2.0 opcodes.
6727 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6729         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6730         one of the latests Martin's fixes.
6732 2007-03-23  Miguel de Icaza  <miguel@novell.com>
6734         * expression.cs: On BigEndian systems, swap the bytes, temporary
6735         solution until we get a new bitconverter class.
6737 2007-03-23  Martin Baulig  <martin@ximian.com>
6739         Fix #81158.
6741         * decl.cs (MemberCache.AddMembers): Add generic methods both as
6742         "Method" and "Method`1".  Normally, a cache lookup is done on the
6743         "Method" form (ie. without the generic arity), but this one makes
6744         lookups on the full form work as well.
6746 2007-03-22  Raja R Harinath  <rharinath@novell.com>
6748         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6749         unused properties.
6751 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
6752         * class.cs: 
6753         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6754         ordered_member_list, to TypeBuilder to store members to be defined
6755         in the order they were parsed in.
6756         - ordered_explicit_member_list contains all properties indexers
6757           and methods that are defined as explicit implementation of an
6758           interface or base class.
6759         - ordered_member_list contains all properties indexers and methods
6760           that are not defined as explicit implementation of an interface
6761           or base class.
6763         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
6764         functionality in these removed classes has been replaced with 
6765         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
6766         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6768         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6769         to CheckForDuplications inside GetMethod and SetMethod Define Method
6770         to handle method property and indexer name conflicts.
6772         Fixes #79434
6774         All code is contributed under the MIT/X11 license.
6776 2007-03-20  Martin Baulig  <martin@ximian.com>
6778         * class.cs (TypeContainer.Interfaces): Removed; they're now
6779         included in `TypeContainer.Types'.
6781 2007-03-20  Martin Baulig  <martin@ximian.com>
6783         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
6785         * class.cs (TypeContainer.CreateType): New public method.  This is
6786         now called before DefineType() to create the TypeBuilders.
6787         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6788         has already been created by CreateType().
6789         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6790         don't resolve our base classes here; this has been moved into
6791         DefineBaseTypes().  We're now called from CreateType().
6792         (TypeContainer.DefineBaseTypes): New private method; resolve our
6793         base classes here.  We're now called from DefineType().
6795         * rootcontext.cs
6796         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6797         our types first to create all the TypeBuilders.  After that, call
6798         TypeContainer.DefineType() on all the types which'll resolve their
6799         base classes and setup the resolve order.
6801 2007-03-20  Martin Baulig  <martin@ximian.com>
6803         * class.cs (TypeContainer.Enums): Removed; they're now included in
6804         `TypeContainer.Types'.  
6806 2007-03-20  Martin Baulig  <martin@ximian.com>
6808         * class.cs
6809         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6810         (TypeContainer.DoResolveMembers): Call DefineType() on our
6811         `compiler_generated' classes; moved here from DefineNestedTypes().
6813         * rootcontext.cs
6814         (RootContext.ResolveTree): Call ResolveMembers() on all
6815         TypeContainer's in the `type_container_resolve_order'.
6817 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6819         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6821 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6823         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6824         implementation flags.
6826 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6828         * class.cs: More optimizations for type parameters.
6830 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6832         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6834         * ecore.cs, parameter.cs: More common code for both corlibs.
6836         * typemanager.cs (IsGenericMethod): Simplified.
6838 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6840         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6841         'returns'.
6842         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6844         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6845         unconditionally.  Simplify explanation.
6846         (Try.Resolve, Using.Resolve): Likewise.
6848 2007-03-15  Martin Baulig  <martin@ximian.com>
6850         Fix #80731.
6852         * decl.cs (DeclSpace): If we're a partial class, use our
6853         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6855 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6857         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6858         'throws'.
6859         (FlowBranching.UsageVector): Update to changes.
6860         (FlowBranching.MergeSiblings): Likewise.
6861         * statement.cs: Likewise.
6863 2007-03-15  Martin Baulig  <martin@ximian.com>
6865         Fix #79302.
6867         * decl.cs
6868         (MemberCache): Added a special .ctor for type parameters.
6870         * typemanager.cs
6871         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6872         `MemberCache'.  
6874 2007-03-09  Martin Baulig  <martin@ximian.com>
6876         * enum.cs (Enum): Make this a TypeContainer.
6877         (EnumMember): Derive from `Const'.
6879         * const.cs
6880         (Const.DoResolveValue): New protected virtual method; move most of
6881         the functionality of ResolveValue() here so we can override it in
6882         `EnumMember'.
6883         (Const.CreateConstantReference): Make this virtual.
6885         * class.cs (Kind): Add `Kind.Enum'.
6886         (TypeContainer.Emit): Don't emit the enums here; they're already
6887         in the `RootContext.typecontainer_resolve_order'.
6889         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6890         here; they're already in the `typecontainer_resolve_order'.
6892         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6893         TypeManager.DropGenericTypeArguments().
6895         * typemanager.cs
6896         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6897         (TypeManager.IsEnumType): Likewise.
6898         (TypeManager.EnumToUnderlying): Likewise.
6899         (TypeManager.IsEqual): Add support for enums.
6901 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6903         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6904         DefaultParameterValueAttribute to be undefined, say if System.dll
6905         is not referenced.
6907 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6909         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6910         any mscorlib.
6912 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6914         * class.cs, parameter.cs: Unified parameters verification.
6916 2007-03-08  Martin Baulig  <martin@ximian.com>
6918         * cs-parser.jay (constructor_header): Pass the location to the
6919         newly created TopLevelBlock.
6921 2007-03-07  Martin Baulig  <martin@ximian.com>
6923         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6925 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6927         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6928         with the changes from David, fixes the build.
6930 2007-03-05  David Mitchell  <dmitchell@logos.com>
6932         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6933         and its base interfaces to a one-dimensional array type S[],
6934         provided there is an implicit or explicit reference conversion
6935         from S to T.
6937 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6939         * cs-tokenizer.cs: Implemented basic linq grammar.
6941         * driver.cs: Set linq lang version on demand.
6943 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6945         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6947 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6949         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6950         (Fixes #80455)
6952         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6953         here.
6954         Check property and event extern attributes.
6956         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6957         charset.
6959 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6961         A fix for bug #80407
6962         * ecore.cs: Don't report ambiguity error when methods have same parent.
6964 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6966         A fix for bug #80878
6967         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6969 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6971         * attribute.cs: Enable ExtensionAttribute presence test.
6973 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6975         * class.cs: Warn about missing GetHashCode only when Equals is override.
6977         * decl.cs: Check accessibility of type arguments.
6979         * typemanager.cs: Correctly report nullable array.
6981 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6983         * class.cs, report.cs: Capture more details when things go wrong.
6985 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6987         A fix for bug #80650
6988         * cs-parser.jay: Anonymous container starts at constructor declaration
6989         and not at block beginning because it has to be usable in constructor
6990         initializer.
6992         * statement.cs: Use context location and not block one for error reporting.
6994 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6996         A fix for bug #78712
6997         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6998         too.
7000 2007-02-18  Marek Safar  <marek.safar@gmail.com>
7002         A fix for bug #80493 by Atsushi Enomoto
7003         * cs-parser.jay: Ignore invalid attribute target.
7005 2007-02-18  Marek Safar  <marek.safar@gmail.com>
7007         * cs-tokenizer.cs: Ignore '\0' as white space character.
7009 2007-02-17  Miguel de Icaza  <miguel@novell.com>
7011         * cs-parser.jay: Add support for lambda expressions to the mcs
7012         compiler as well.
7014         * lambda.cs: Only clone when we are probing, not on the final call
7015         (Compatible is the final call). 
7017         * statement.cs (CloneContext): Introduce class to provide block
7018         remapping during clone.
7020         All statements Clone themselves now.
7022         (Clone): special handling for blocks, when we clone a block, we
7023         register the block inside this routine, as children of the block
7024         might trigger a lookup. 
7025         
7026         * expression.cs: Add support for CloneContext in all expressions. 
7027         
7028 2007-02-17  Marek Safar  <marek.safar@gmail.com>
7030         A fix for bug #80493
7031         * statement.cs: Report ambiguous warning when interfaces are not related.
7033 2007-02-15  Marek Safar  <marek.safar@gmail.com>
7035         C# 3.0 extension methods.
7037         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
7038         cannot be used directly.
7040         * class.cs (Class.Emit): Emit extension attribute if any class method
7041         is extension method.
7042         (Method.Define): Add basic extension method validation conditions.
7043         (Method.Emit): Emit extension attribute for method.
7045         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
7046         extension method exists. Currently we follow same approach as Microsoft
7047         does, emit even if a method or a class are private but this can change
7048         later.
7050         * cs-parser.jay: Add handling of `this' keyword in method parameters
7051         context.
7053         * decl.cs (DeclSpace.IsStaticClass): New property.
7054         (MemberCache.FindExtensionMethods): Looks for extension methods with
7055         defined name and extension type.
7057         * doc.cs: Updated after OverloadResolve changes.
7059         * driver.cs: Add new soft reference to System.Core.dll.
7061         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
7062         (ExtensionMethodGroupExpr): Represents group of extension methods.
7064         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
7065         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
7066         to MethodGroupExpr and made non-static for easier customization.
7067         (Invocation.DoResolve): Add extension method lookup when no standard
7068         method was found.
7069         (MemberAccess.DoResolve): Try extension methods if no member exists.
7071         * modifiers.cs: Add METHOD_EXTENSION modifier.
7073         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
7074         as well as candidate extension type.
7075         (ComputeNamespaces): When assembly constains extension methods registers
7076         them.
7077         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
7078         extension method lookup.
7079         (Namespace.LookupExtensionMethod): Looks for extension method in this
7080         namespace.
7081         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
7082         find a method which matches name and extensionType.
7084         * parameter.cs (Parameter): Add This modifer.
7085         (HasExtensionMethodModifier): New property.
7086         (Resolve): Add extension parameter check.
7087         (ModFlags): turned to property to exclude this modifier as it is not real
7088         parameter modifier.
7089         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
7091         * support.cs (ParameterData): Add ExtensionMethodType.
7092         (ReflectionParameters): Implemented ExtensionMethodType interface property.
7094         * typemanager.cs: Add type and ctor extension attribute type.
7096 2007-02-15  Miguel de Icaza  <miguel@novell.com>
7098         * report.cs (DisableErrors, EnableErrors): used to prevent error
7099         output when we are "trying" to compile various methods with
7100         different types. 
7102         * ecore.cs (Expression): Add Clone method that calls the virtual
7103         CloneTo method.  The current CloneTo method in Expression throws
7104         an exception so we can track down all the places where this must
7105         be implemented (not using abstract, because that would be a lot of
7106         up-front-work before we can start testing the implementation
7107         idea). 
7109         Important: we only need Clone capabilities for expressions created
7110         by the parser, as the expressions we will be cloning are
7111         expressions in the pre-resolved state.   This vastly simplifies
7112         the work required. 
7113         
7114         (SimpleName): Add CloneTo that does nothing.
7115         (EmptyCast): Add CloneTo.
7116         
7117         * expression.cs (Binary): Implement CloneTo.
7118         (Invocation.IsApplicable): Store the current ec in
7119         EmitContext.TempEc and restore it on return.  This is used so we
7120         do not have to sprinkle hundres of methods with an extra
7121         EmitContext, we know that the only user is the lambda expression
7122         ImplicitConversionExists code. 
7123         
7124         (Argument): Add Cloning capabilities.
7125         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
7126         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
7127         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
7128         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
7129         IndexerAccess): Add Clone capability.
7131         (LocalVariableReference, This): TODO: needs cloned Block mapping.
7133         (Argument): Add cloning capability.
7135         * assign.cs (Assign): Implement CloneTo.
7137         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
7138         
7139         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
7140         version by calling Convert with the EmitContext (that we are
7141         currently storing in ec, this is not great, but will do for now,
7142         to avoid passing EmitContext parameters to hundreds of functions
7143         that do not need them now).
7145         (SetExpression): Remove, it is not needed.
7146         
7147         (ContextualReturn): Implement CloneTo.
7149         * statement.cs (Statement): Implement cloning infrastructure,
7150         similar to expressions.
7152         (Block): Partial implementation of Clone for statements.
7154         (Return): Implement clone.
7155         
7156         * constant.cs (Constant.CloneTo): New method, does nothing.
7158         * codegen.cs (TempEc): Add a static EmitContext as a temporary
7159         solution, until we decide how to exactly do this.  
7160         
7161 2007-02-14  Marek Safar  <marek.safar@gmail.com>
7163         A fix for bug #80493
7164         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
7165         a property is override we need to use second accessor.
7167 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7169         A fix for bug #80418
7170         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
7171         methods.
7173 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7175         Another fix for bug #80749
7176         * pending.cs: Abstract class has priority over interfaces.
7178 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7180         Another fix for bug #80749
7181         * pending.cs: Abstract class has priority over interfaces.
7183 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7185         Another fix for bug #80749
7186         * pending.cs: Abstract class has priority over interfaces.
7188 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7190         Another fix for bug #80749
7191         * pending.cs: Abstract class has priority over interfaces.
7193 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7195         * class.cs Better error message.
7197         * driver.cs: Add shorter versions of -optimize option.
7199 2007-02-13  Martin Baulig  <martin@ximian.com>
7201         * class.cs (Constructor.Emit): Check the return value of
7202         ec.ResolveTopBlock() and return on error.
7204 2007-02-13  Raja R Harinath  <rharinath@novell.com>
7206         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
7207         message to fix error message regression.
7209 2007-02-12  Marek Safar  <marek.safar@gmail.com>
7211         * delegate.cs: Delegate creation expression cannot be of Nullable type.
7213 2007-02-12  Marek Safar  <marek.safar@gmail.com>
7215         A fix for bug #80749
7216         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7217         its parent container.
7219         * class.cs (DefineFieldInitializers): Each initializer can has different
7220         resolve context.
7222         * const.cs: Updated.
7224 2007-02-11  Miguel de Icaza  <miguel@novell.com>
7226         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7227         now all the heavy lifting to check that embedded statements or
7228         expressions have the right form is done in the ContextualReturn.
7230         (ContextualReturn): New class.  
7232         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7233         method that can be invoked to report 201, so we do not replicate
7234         this everywhere.
7236         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7237         
7238         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7239         treating tabs as spaces. 
7241 2007-02-09  Marek Safar  <marek.safar@gmail.com>
7243         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7244         * assign.cs: Use full implicit conversion for right side check.
7246 2007-02-09  Marek Safar  <marek.safar@gmail.com>
7248         * statement.cs (Switch): Switch over boolean type is not standardized.
7250 2007-02-08  Marek Safar  <marek.safar@gmail.com>
7252         A fix for bug #80755
7253         * decl.cs (FindBaseEvent): Don't use method cache for events.
7255 2007-02-07  Marek Safar  <marek.safar@gmail.com>
7257         * cs-parser.jay: Better syntax error handling.
7259         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7260         instead of underlying type value.
7262 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7264         * driver.cs: Check define identifier before is registered.
7266         * namespace.cs: Use existing error message.
7268         * report.cs: New warning.
7270 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7272         A fix for bug #80742
7273         * expression.cs: Delegate Invoke method can be called directly.
7275 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7277         A fix for bug #80676
7278         * class.cs (IsEntryPoint): The Main method can have params modifier.
7280 2007-02-04  Miguel de Icaza  <miguel@novell.com>
7282         * parameter.cs (Parameter, Parameters): Add Clone method.
7284         * anonymous.cs (Compatible): Turn method into virtual method, so
7285         LambdaExpression can implement a different behavior.
7287         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7288         out the basic checking here, so it can be used by
7289         LambdaExpressions.
7290         
7291         * lambda.cs: Introduce "Compatible" function that will do the
7292         heavy lifting.
7294 2007-02-02  Marek Safar  <marek.safar@gmail.com>
7296         * attribute.cs: Unified one error message.
7298         * class.cs (Class): Use type attributes and not properties to test static
7299         class.
7300         (IsEntryPoint): Don's pass local variable.
7302         * convert.cs: Removed duplicate check.
7304         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7306         * driver.cs: Don't crash when soft reference does not exist.
7308         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7309         (UsingEntry): Removed redundant allocation.
7311         * parameter.cs: Add fast path for type parameters.
7313         * support.cs: Don't allocate attribute when it's not used.
7315 2007-01-30  Miguel de Icaza  <miguel@novell.com>
7317         * anonymous.cs
7318         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7319         this into a virtual method, so we can override it in LambdaExpression.
7321         * driver.cs: Improve diagnostics in case of failure. 
7323         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7324         write a function that is slightly more complex and that parses:
7326         type identifier [, type identifier]* )
7328         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7329         this expression:
7331                 (canEmpty ? i >= 0 : i > 0)
7333 2007-01-30  Raja R Harinath  <rharinath@novell.com>
7335         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7336         exception on possibly valid code.
7338 2007-01-29  Raja R Harinath  <rharinath@novell.com>
7340         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7341         Push/PopPosition.
7342         (parse_opt_type_arguments): Remove.  It's almost the same as
7343         parse_less_than.
7344         (parse_namespace_or_typename): Use parse_less_than.
7346 2007-01-28  Miguel de Icaza  <miguel@novell.com>
7348         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7349         this bug took a few hours to find, because the state saved and
7350         restored by PushPosition and PopPosition was ignoring the state of
7351         parse_generic_less_than.
7353         I can also now remove the handling of OP_LT and OP_GT, this solves
7354         the big mistery.
7355         
7356         * cs-tokenizer.cs: store the location for the ARROW token, we use
7357         that in the parser.
7359         (PushPosition, PopPosition): save/restore also `current_token',
7360         restore `parse_generic_less_than' (was missing).
7362         (parse_opt_type_arguments): use parse_type, not
7363         parse_namespace_or_typename to parse types.
7365         * lambda.cs: Empty new file, will eventually have the lambda
7366         expression implementation.
7368         * lambda.test: used to test the internal tokenizer. 
7370         * report.cs (FeatureIsNotISO1): Rename from
7371         FeatureIsNotStandardized, because it was about the language level
7372         (1 vs 2) it was not about standarization.
7374         (FeatureRequiresLINQ): New.
7376         * support.cs (SeekableStreamReader): Only require that the reader
7377         is a TextReader, not a StreamReader, so we can plug StringReader. 
7379         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7380         given position in the input stream the following tokens can be
7381         parsed as a type followed by an identifier.
7383         (is_punct): after a '(' if parse_type_and_parameter returns true,
7384         then return a special token OPEN_PARENS_LAMBDA which is used to
7385         avoid reduce/reduce errors in the grammar for the
7386         lambda_expression rules.
7388         (parse_type): implement a type parser inside the
7389         tokenizer, the parser only returns true or false depending on
7390         whether the input at a given position can be parsed as a type.
7392         (peek_token): new method used during type parsing.
7394 2007-01-28  Raja R Harinath  <rharinath@novell.com>
7396         Fix #80531
7397         * anonymous.cs (ScopeInfo.InflateParameters): New.
7398         (AnonymousContainer.Resolve): Use it to redirect types of
7399         delegate parameters.
7401 2007-01-27  Raja R Harinath  <rharinath@novell.com>
7403         Fix #80530
7404         * expression.cs (Error_InvalidArguments): Don't use two different
7405         messages for CS1503.  Use ExtraInformation and
7406         SymbolRelatedToPreviousError instead.
7408         Fix #80358
7409         * decl.cs (DeclSpace.initialize_type_params): Don't access
7410         'type_params' of a partial class directly.
7412 2007-01-26  Miguel de Icaza  <miguel@novell.com>
7414         * constant.cs: Removed a handful of out-of-range checks that were
7415         not necessary. 
7417 2007-01-25  Marek Safar  <marek.safar@gmail.com>
7419         * expression.cs (CheckUselessComparison): Add additional check for char
7420         constants.
7422         * namespace.cs: Fixed typo.
7424 2007-01-23  Miguel de Icaza  <miguel@novell.com>
7426         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7427         gone, instead we inline the test, preventing the needless casts to
7428         longs, ulongs and doubles for the parameters, avoiding calls to
7429         methods that overchecked stuff, and instead inlined things
7430         nicely. 
7432 2007-01-20  Marek Safar  <marek.safar@gmail.com>
7434         * cs-parser.jay: Better parameter error handling.
7436 2007-01-17  Marek Safar  <marek.safar@gmail.com>
7438         A fix for bug #80368, #80522
7439         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7440         whether array initializer contains constants only.
7441         (ArrayCreation.Emit): Use better formula to decide when
7442         are array initializers for static initialization.
7443         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7444         have to emit even constants otherwise they are pre-initialized.
7446 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
7447             Raja R Harinath  <rharinath@novell.com>
7449         Fix emit order of 'get' vs. 'set'.
7450         * support.cs (Accessors): New.
7451         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7452         Note the order in which accessors are declared in the source.
7453         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7454         Refactored from Property.Define and Indexer.Define.
7455         (PropertyBase.DefineAccessors): New helper that calls the above in
7456         appropriate order as noted by the parser.
7457         (Property.Define, Indexer.Define): Update to changes.
7458         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7460 2007-01-17  Raja R Harinath  <rharinath@novell.com>
7462         Fix cs0029-6.cs and gcs0029-2.cs (regression)
7463         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7464         there's an implicit conversion from the current type to the target
7465         type before converting the underlying constant.
7467 2007-01-16  Marek Safar  <marek.safar@gmail.com>
7469         * const.cs (ResolveValue): Updated after constant conversion was made more
7470         generic.
7472         * constant.cs (GetAttributableValue): constant to object conversion is
7473         used for attributes only.
7474         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7475         constant conversions.
7476         (LongConstant.ConvertImplicitly): Ditto.
7478         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7479         (ImplicitConversionStandard): Handle constant conversion as extra step.
7480         It solves the issue when constant conversion was called indirectly like
7481         inside array initializer and constant folding was skipped.
7483         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7484         this change.
7486         * statement.cs(ImplicitConversionStandard): Updated after constant
7487         conversion was made more generic.
7489 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
7491         * expression.cs (As.DoResolve): Use GenericConstraints instead of
7492         Constraints, solves the problem where the compiler incorrectly
7493         reported that a type parameter was not constrained to a class (Bug
7494         80518)
7496 2007-01-14  Marek Habersack  <grendello@gmail.com>
7498         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7500 2007-01-14  Marek Safar  <marek.safar@gmail.com>
7502         A fix for bug #80368
7503         * assign.cs (FieldInitializer): New class implements field
7504         initializer statement.
7506         * attribute.cs: Update after FieldMember rename.
7508         * class.cs (PropertyBasedMember): New common class for property based
7509         types.
7510         (InterfaceMemberBase): New base class for all members which can be used as
7511         an interface members.
7512         (MethodCore): Moved really common code to InterfaceMemberBase.
7513         (Method.Define): Equal and GetHasCode detection is relevant for methods
7514         only.
7515         (MethodData.Define): Don't assume that public event implements an
7516         interface automatically.
7517         (MethodData.DefineMethodBuilder): Issue an error even if only extern
7518         modifier is used.
7519         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7520         (FieldMember): Merged with FieldBase.
7521         (EventProperty.AEventPropertyAccessor): New specialization to check whether
7522         event extern modifier can be used.
7523         (EventField.EventFieldAccessor): Moved event field specific code here.
7524         (Event.AllowedModifiers): Even event can be extern.
7525         (Event.FindOutBaseMethod): New override specific to events.
7526         (Indexer.parameters): Reintroduce parameters because base class holds
7527         only properties common data.
7528         (Indexer.CheckForDuplications): Indexers are threated as methods so we
7529         need do extra parameters check.
7531         * const.cs: Update after FieldMember rename.
7533         * decl.cs (MemberCache.FindBaseEvent): New method.
7535         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7536         to reflect that indexer is now derived from PropertyBased.
7538         * ecore.cs (GetMemberType): Made public.
7539         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7540         obsolete event.
7542         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7543         
7544         * typemanager.cs (CSharpSignature): Correctly print event accessors.
7545         (RegisterEvent): Removed.
7546         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7547         (GetPrivateFieldOfEvent): Renamed to GetEventField.
7549 2007-01-11  Raja R Harinath  <rharinath@novell.com>
7551         Fix #80249
7552         * statement.cs (CollectionForeach.TryType): Prefer generic
7553         GetEnumerator over non-generic variant.  Fix code to follow comments.
7555 2007-01-09  Raja R Harinath  <rharinath@novell.com>
7557         Fix #80446
7558         * support.cs (ReflectionParameter): Don't use an invalid index on
7559         the generic parameter data.
7561 2007-01-08  Miguel de Icaza  <miguel@novell.com>
7563         * driver.cs: Just add a tiny bit of infrastructure.
7565 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7567         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7568         where field type is struct from current assembly.
7569         
7570         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7571         it is possible.
7573 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7575         A fix for bug #80381
7576         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7577         the core types.
7579         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7580         messages.
7581         (Namespace.LookupType): Always use core types from corlib when speficied.
7583         * report.cs: A new warning.
7585         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7586         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7587         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7589         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7590         (InitCoreTypes): Set expression type of object_type and value_type
7591         immediately after lookup.
7593 2007-01-01  Miguel de Icaza  <miguel@novell.com>
7595         * cs-tokenizer.cs: Accept Pc class characters (Connector
7596         Punctuation) as valid identifiers.  Fixes #78259
7598         * expression.cs (Invocation.DoResolve): Moved the check for the
7599         use of `this' for doing method calls to the Invocation resolution
7600         step, after overload resolution has taken place instead of doing
7601         the check at the low-level `This.DoResolve' level.
7603         The `This.DoResolve'(appens before overload resolution, so it has
7604         no way of knowing if the method that will be called will be
7605         instace or static, triggering an erroneous report for cs0188 (Bug
7606         78113).
7608         We now do the check for instance method invocations after we know
7609         what method will be called.
7611         (This.CheckThisUsage): Move the actual use of this structure
7612         checking into its own method and expose it. 
7614         * Everywhere that called Error_ValueCannotBeConverted: pass a new
7615         EmitContext.
7617         Exceptions: Null.ConvertImplicitly,
7618         Constant.ImplicitConversionRequired as there are too many call
7619         sites for passing the ec. 
7621         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7622         EmitContext, if the value is null, then we do not try to provide
7623         the extra information from the error (If a userdefined conversion
7624         exists, as UserDefinedConversion requires a non null-EmitContext).
7626         Fixes: #80347
7628 2006-12-30  Raja R Harinath  <rharinath@novell.com>
7630         * flowanalysis.cs (MyBitVector): Document some invariants.
7631         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7632         introduced below, and add a couple of others, 
7634 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7636         * attribute.cs (GetMethodObsoleteAttribute): Uses new
7637         GetPropertyFromAccessor and GetEventFromAccessor.
7638         
7639         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7640         overrides non-obsolete one.
7641         (Indexer.Define): Error message has been moved to the parser.
7643         * cs-parser.jay: Better syntax errors handling.
7645         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7646         when an invocation has no arguments.
7648         * ecore.cs: Removed not used caching.
7650         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7651         implementation.
7653         * report.cs: Add a new warning.
7655         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7657         * typemanager.cs (enumeration_type): Removed.
7658         (CSharpSignature): Reuses IsSpecialMethod.
7659         (IsEqual): Hack for MS BCL.
7660         (GetPropertyFromAccessor): New method.
7661         (GetEventFromAccessor): New method.
7662         (IsSpecialMethod): Fixed to handle more cases.
7664 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7666         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7667         Made white spaces array static.
7669         * ecore.cs (RemoveGenericArity): Optimized.
7671         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7672         10 times faster).
7673         (MyBitVector.initialize_vector): Simplified.
7675 2006-12-22  Miguel de Icaza  <miguel@novell.com>
7677         * ecore.cs: Am not entirely happy with this hack, but it seems to
7678         address the issue in 80257 (a small test case for
7679         CreativeDocs.NET). 
7681         I set the MethodGroupExpr.Type to an internal compiler type
7682         (itself in this case) to force the resolution to take place.   Why
7683         it does not take place with a null is beyond me.
7685 2006-12-20  Marek Safar  <marek.safar@gmail.com>
7687         A fix for bug #80288
7688         * expression.cs (ResolveOperator): Consider user defined conversion for
7689         logical and operator too.
7690         (EmitBranchable): Optimization for logical and when full constant folding
7691         could not be applied but one operand is constant.
7693 2006-12-19  Marek Safar  <marek.safar@gmail.com>
7695         * class.cs (GetClassBases): Write 5 times every day, will never use
7696         FullName for error reporting.
7698         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7700 2006-12-19  Martin Baulig  <martin@ximian.com>
7702         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7703         the symbol file info here.
7705 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7707         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7708         of `elseif' is taking then following sections are not taking.
7709         Fixes an issue reported on mono mailing list.
7711 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7713         A fix for bug #80300
7714         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7715         a caller is not taking.
7717 2006-12-18  Raja R Harinath  <rharinath@novell.com>
7719         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7720         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7721         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7722         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7723         * class.cs: Update to changes.
7725 2006-12-17  Marek Safar  <marek.safar@gmail.com>
7727         A fix for bug #79934
7728         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7729         partial container.
7731         * class.cs (ResolveMembers): Register an iterator in current container and
7732         not in shared one.
7734 2006-12-16  Raja R Harinath  <rharinath@novell.com>
7736         Fix test-543.cs
7737         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7738         satisfy a params annotated parameter.
7740 2006-12-16  Marek Safar  <marek.safar@gmail.com>
7742         A fix for bug #77014
7743         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7744         paramters correctly and not rely on hacks in Parameters class.
7745         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7746         at any possition.
7747         (Invocation.VerifyArgumentsCompat): Ditto.
7748         (Invocation.EmitArguments): Changed to correctly emit params arguments at
7749         any possition.
7751         * parameter.cs (HasParams): Don't assume that params is the last one.
7753         * support.cs (ReflectionParameters.ctor): Look for params attribute
7754         correctly.
7755         (ReflectionParameters.ParameterType): Removed hack when we returned last
7756         parameter for out of range parameters.
7757         (ParameterName, ParameterModifier): Ditto.
7759 2006-12-14  Marek Safar  <marek.safar@gmail.com>
7761         A fix for bug #79987
7762         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7763         when assembly is not CLS compliant but type is. I have no idea why is this
7764         allowed.
7766         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7768 2006-12-13  Miguel de Icaza  <miguel@novell.com>
7770         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7771         in struct constructors, they are basically no-ops.
7773 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7775         * cs-tokenizer.cs (Position): Save preprocessor status too.
7777 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7779         A fix for bug #77794
7780         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7782 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7784         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7785         Fixes #69299.
7786         (pp_expr): Report error for an invalid expression.
7787         (handle_preprocessing_directive): Simplified; add more error checking.
7789 2006-12-11  Marek Safar  <marek.safar@gmail.com>
7791         A fix for bug #74939
7792         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7793         directives handling.
7795 2006-12-10  Marek Safar  <marek.safar@gmail.com>
7797         A fix for bugs #80093, and #75984
7798         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7799         logic, it seems to me as it worked before "by coincidence".
7800         (xtoken): Simplified to use reworked handle_preprocessing_directive.
7801         (cleanup): Enabled endif check.
7803 2006-12-09  Marek Safar  <marek.safar@gmail.com>
7805         A fix for bug #80162
7806         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7807         enumerators are never ambiguous.
7809 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7811         Fix #80060
7812         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7814 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7816         A fix for bug #80144
7817         * class.cs (EventProperty.Define): Explicit implementation means
7818         that an even is used.
7820 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7822         Fixes the operators implementation (part II)
7824         * cfold.cs (DoConstantNumericPromotions): Renamed to
7825         DoBinaryNumericPromotions and simplified.
7826         (BinaryFold): Couple of conversion fixes; simplified.
7828         * constant.cs, ecore.cs, literal.cs
7829         (ToType): Renamed to ConvertImplicitly.
7830         (Reduce): Renamed to ConvertExplicitly.
7832         * class.cs, convert.cs: Updated.
7834         * expression.cs: TryReduce doesn't throw an exception.
7836 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7838         A fix for bug #80108
7839         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7840         compatible.
7842 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7844         Fixes unary operators implementation (part I)
7845         Also fixes #80026
7847         * cfold.cs (Error_CompileTimeOverflow): Made internal
7849         * const.cs (IConstant): Changed to use reference to constant and
7850         not constant itself.
7851         Updated IConstant implementations.
7853         * constant.cs (CreateConstant): New factory method.
7854         Updated IConstant implementation.
7856         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7858         * ecore.cs: Updated to use CreateConstantReference.
7860         * enum.cs: Reflects IConstant changes.
7862         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7864         * literal.cs (NullConstant): Change to be independently usable.
7866 2006-11-29  Martin Baulig  <martin@ximian.com>
7868         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7869         we need to emit the scope initializer before calling the base .ctor.
7871         * anonymous.cs: Merged back from the new anonymous methods branch.
7872         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7874         * expression.cs (ParameterReference.DoResolveBase): Create a
7875         "normal" ScopeInfo when capturing parameters rather than using the
7876         root scope; this makes things work with anonymous methods having
7877         parameters.
7879         * statement.cs
7880         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7882 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7884         A fix for bug #79987
7885         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7886         check to a base class.
7887         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7888         only when assembly has missing attribute.
7889         * report.cs: Update.
7891 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7893         * cs-tokenizer.cs: Merged with gmcs version.
7895 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7897         * cs-tokenizer.cs,
7898         * cs-parser.jay: Better error message when partial keyword is misplaced.
7900 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7902         A fix for bug #79810
7903         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7904         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7905         a RuntimeWrappedException by default.
7907 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7909         A fix for bug #79843
7910         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7911         implementation.
7912         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7914 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7916         * driver.cs, namespace.cs: Uses faster IndexOf version.
7918 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7920         A fix for bug #79941
7921         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7922         operators.
7923         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7924         even if internal name is different.
7925         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7926         (UserDefinedConversion): Simplified as the operators cannot be internal.
7927         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7928         conversions.
7929         (MethodLookup): Replaced EmitContext with parentType.
7930         * expression.cs: Updated.
7932 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7934         * driver.cs (BadAssembly): Handle all the ugliness of
7935         DefineDynamicAssembly.
7937 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7939         Address parts of #58244 -- most of what's left is in the runtime
7940         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7941         CS1509 error checks, and handle them for all assembly loads, not
7942         just the first invocation.
7943         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7944         * codegen.cs (AssemblyClass.AddModule): ... here.
7946 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7948         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7949         IEnumerable<T> is ambiguous.
7951 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7953         A fix for bug #67689
7954         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7955         GetEnumerator is ambiguous.
7957         * report.cs: Add new warning.
7959 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7961         A fix for bug #78602
7962         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7963         to protected member can be nested type.
7965 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7967         A fix for bug #78965
7968         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7969         to protected member must derive from current type.
7971 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7973         assign.cs: Reuses error method.
7975         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7976         instead of type for constants.
7977         (Expression.Error_ValueAssignment): Common error method.
7979         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7980         for any assignment.
7982 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7984         A fix for bug #79081
7985         * expression.cs (MemberAccess.DoResolve): Check nested type
7986         accessibility.
7988 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7990         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7992 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7994         A fix for bug #76591
7995         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7997 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7999         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
8000         type forwarder of the same type multiple times.
8002 2006-10-26  Raja R Harinath  <rharinath@novell.com>
8004         Fix #78820
8005         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
8006         instance as an rvalue, even when we later resolve as an lvalue.
8008 2006-10-25  Martin Baulig  <martin@ximian.com>
8010         * anonymous.cs: Fix #79673.
8012 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
8014         A fix for bug #79666
8015         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
8016         ignored when is optimized (= default value) as its value is already set.
8018 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
8020         A fix for bug #79724
8021         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
8022         TypeContainer for type lookup.
8024 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
8026         A fix for bug #79231
8027         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
8028         * expression.cs (OverloadResolve): Always convert type name for
8029         an error message.
8030         (ResolveNamespaceOrType): Don't confuse a nested type with any 
8031         other member.
8033 2006-10-18  Martin Baulig <martin@ximian.com>
8035         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
8037 2006-10-17  Miguel de Icaza  <miguel@novell.com>
8039         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
8040         an int32, but requesting an int64 from the conversion
8042 2006-10-12  Martin Baulig  <martin@ximian.com>
8044         * anonymous.cs
8045         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
8046         
8047 2006-10-12  Martin Baulig  <martin@ximian.com>
8049         * statement.cs
8050         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
8052 2006-10-11  Miguel de Icaza  <miguel@novell.com>
8054         * convert.cs: Remove broken code: I was doing the "Existance"
8055         tests for Implicit conversions.
8057 2006-10-10  Miguel de Icaza  <miguel@novell.com>
8059         * convert.cs: Added one missing case in
8060         ImplicitStandardConversionExists uint64 to intptr.
8062         Fixes #59800
8063         
8064         * typemanager.cs (uintptr_type): another core known type.   
8066         * ecore.cs (OperatorCast): routine used to do cast operations that
8067         depend on op_Explicit.  We could change some of the Decimal
8068         conversions to use this.
8070         This one has a probe mechanism that checks both types for an op_
8071         which it coudl be used to eliminate two classes: CastToDecimal
8072         and CastFromDecimal.
8074         * convert.cs: Implement the conversions documented in #59800
8075         
8076 2006-10-10  Martin Baulig  <martin@ximian.com>
8078         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
8079         before RootScope.ResolveMembers().
8081         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
8082         `CurrentType' if appropriate.
8084 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
8086         A fix for bug #78568
8087         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
8088         when contains binary operators.
8089         * cs-parser.jay: Updated.
8091 2006-10-09  Martin Baulig  <martin@ximian.com>
8093         * delegate.cs
8094         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
8095         moved that into Define() and also do the other type parameter
8096         checks there.  Fixes #79094.  Added gtest-292.cs.
8098         * expression.cs
8099         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
8100         since that doesn't include type parameters; don't use `Ldelema'
8101         for type parameters.  Fixes #78980.  Added gtest-293.cs.
8103 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
8105         A fix for #77796
8106         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
8107         conversion is allowed.
8109 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
8111         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
8112         error reporting when no error occurs.
8114 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
8116         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
8117         does not exist.
8119 2006-10-06  Raja R Harinath  <rharinath@novell.com>
8121         Fix #79584
8122         * class.cs (DefineTypeBuilder): Check circular dependencies before
8123         setting the parent of the TypeBuilder.
8124         (CheckRecursiveDefinition): Don't use 'BaseType', since
8125         it may not be valid until after DefineTypeBuilder.  Use
8126         'base_type' instead.
8128 2006-10-04  Martin Baulig  <martin@ximian.com>
8130         Merged the Anonymous Methods patch.
8132         * anonymous.cs, iterators.cs: The new anonymous methods code.
8134         * statement.cs (Variable): New public abstract class.
8135         (LocalInfo.Variable): New public property.
8136         (LocalInfo.ResolveVariable): New public method.
8137         (Block.Flags): Add `IsIterator'.
8138         (Block.AddVariable): Improved the CS0136 check.
8139         (Block.AnonymousChildren): New public property.
8140         (Block.AddAnonymousChild): New public method.
8141         (ToplevelBlock): Update to use the new anonymous method framework.
8142         (ToplevelBlock.ctor): `container' is now a `Block' and not a
8143         `ToplevelBlock'; this is required to correctly implement the
8144         CS0136 check.
8145         (Fixed, Using): Use `TemporaryVariable' instead of directly
8146         creating the `LocalBuilder'.
8148         * parameter.cs (Parameter.ResolveVariable): New public method.
8149         (Parameters.ResolveVariable): Likewise.
8151         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
8153         * class.cs (TypeContainer): Replaced the `iterators' list and
8154         corresponding methods with a list of `CompilerGeneratedClass'es.
8155         (TypeContainer.ResolveMembers): New public method.
8156         (Method): `IIteratorContainer' has been replaced by
8157         `IAnonymousHost'.
8159         * expression.cs (VariableReference): New public abstract base
8160         class for `LocalVariableReference', `ParameterReference' and
8161         `This'.
8163         * codegen.cs (EmitContext): Removed `capture_context',
8164         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
8165         (EmitContext.EmitThis): Removed.
8167         * cs-parser.jay: Replace `iterator_container' with
8168         `anonymous_host'.       
8170 2006-10-04  Martin Baulig  <martin@ximian.com>
8172         * generic.cs (GenericMethod): Don't make this abstract.
8173         (Constraints.Clone): Added dummy implementation.
8175 2006-10-04  Raja R Harinath  <harinath@gmail.com>
8177         Fix #79577
8178         * namespace.cs (LookForAnyGenericType): Avoid nullref on
8179         'declspaces'.  Avoid allocating arrays willy-nilly.
8181         Fix #79553
8182         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
8183         cases out of the switch.
8185 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
8187         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
8188         message when non-generic type is used with the type arguments.
8189         * expression.cs: Updated.
8191 2006-09-28  Raja R Harinath  <rharinath@novell.com>
8193         Fix #79013
8194         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
8195         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8196         Change semantics slightly.  Don't insist on having only one
8197         temporary EmptyExpression -- just throttle the creation of new ones.
8199         Fix #79451
8200         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
8201         non-interfaces too.  If no methods are found, don't try to create
8202         a MethodGroupExpr.
8204 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
8206         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
8207         generic type.
8209         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
8210         us produce better error message.
8212 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
8214         * expression.cs (Binary.ResolveOperator): Warn about a side effect
8215         of the `|' operator.
8217         * report.cs: A new warning added.
8219 2006-09-27  Martin Baulig  <martin@ximian.com>
8221         * generic.cs (GenericMethod): Don't make this abstract.
8223 2006-09-27  Martin Baulig  <martin@ximian.com>
8225         * report.cs
8226         (InternalErrorException): Added overloaded ctor taking a params array.
8228 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
8230         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8231         Fixed the cases when same error was reported twice.
8233         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8234         now report symbol information.
8236 2006-09-25  Martin Baulig  <martin@ximian.com>
8238         * class.cs: Completely unified with the gmcs version.
8240 2006-09-25  Martin Baulig  <martin@ximian.com>
8242         * typemanager.cs (TypeManager.IsNullableType): New public function.
8243         (TypeManager.IsNullableTypeOf): Likewise.
8244         (TypeManager.IsNullableValueType): Likewise.
8246         * class.cs (MethodCore): Added the `GenericMethod' argument from
8247         gmcs and also unified all classes derived from `MethodCore' with gmcs.
8249 2006-09-24  Raja R Harinath  <harinath@gmail.com>
8251         * convert.cs: Unify with gmcs version.
8253 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8255         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8256         verify them as well.
8258         * report.cs: New warning.
8260 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8262         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8263         for anonymous block with out argument.
8265 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8267         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8268         not used private events only.
8270 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
8272         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8274         * const.cs (Const.Define): Check for constant type.
8275         (Const.IsConstantTypeValid): Looks for valid constant types.
8277         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8279         * ecore.cs (EmptyConstantCast): New common class for all constant based
8280         EmptyCast(s).
8282         * expression.cs (Is.DoResolve): Handle null constant especially.
8283         (New.DoResolve): Check for new void().
8284         (MemberAccess.DoResolve): Cope with all kind of nulls.
8286         * literal.cs (NullConstant): Uses EmptyConstantCast.
8287         (NullDefault): Based on EmptyConstantCast.
8288         (NullLiteral): Uses EmptyConstantCast.
8290         * statement.cs (Block.ResolveMeta): Check for constant type.
8292 2006-09-22  Martin Baulig  <martin@ximian.com>
8294         * delegate.cs, attribute.cs: Merged with the gmcs versions.
8296 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8298         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8299         not the null type.
8301         Fix part of #79451
8302         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8303         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
8304         code slightly.
8306 2006-09-22  Martin Baulig  <martin@ximian.com>
8308         * ecore.cs: Merged with the gmcs version.
8310         * generic.cs (ConstructedType): New dummy class.
8311         (TypeArguments): Don't make this abstract.
8313         * typemanager.cs
8314         (TypeManager.IsGenericTypeDefinition): New method.
8315         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8317 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8319         * expression.cs (ComposedCast): Check for arrays of TypedReference
8320         before creating the type, not after.
8322 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
8324         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8325         after ToType change.
8327         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8328         when constant must be implicitly convertible.
8330         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8332         * ecore.cs (NullCast): Derives from NullConstant.
8334         * expression.cs (Is.DoResolve): Removed useless variables.
8335         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8336         (New.Constantify): Add enum support.
8337         (MemberAccess.DoResolve): Add warning when accessing null constant or
8338         variable.
8340         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8341         property.
8343         * literal.cs (NullConstant): New abstract class with common
8344         functionality for all null specializations.
8345         (NullDefault): Represents default(X) when result can be
8346         reduced to null.
8347         (NullLiteral): Updated.
8349         * report.cs: Add new warning.
8351 2006-09-21  Martin Baulig  <martin@ximian.com>
8353         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8355 2006-09-21  Martin Baulig  <martin@ximian.com>
8357         * generic.cs (GenericConstraints): New dummy class.
8358         (Constraints): Likewise.
8359         (TypeParameter): Likewise.
8360         (TypeParameterName): Likewise.
8361         (GenericMethod): Likewise.
8363         * typemanager.cs (TypeManager.GetGenericArguments): New method.
8365         * decl.cs: Merged with the gmcs version.
8367 2006-09-21  Raja R Harinath  <rharinath@novell.com>
8369         * generic.cs (TypeParameter): Implement IMemberContainer.
8370         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
8372         * rootcontext.cs: Unify with gmcs version.
8374         * report.cs: Unify with gmcs version.
8375         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8376         from gmcs/generics.cs.
8377         * generics.cs (TypeParameter): New dummy class.
8379         * support.cs: Unify with gmcs version.
8381 2006-09-20  Raja R Harinath  <rharinath@novell.com>
8383         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8384         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8386         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8387         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8388         * mcs.exe.sources: Add generic.cs.
8390         * codegen.cs: Unify with gmcs version.
8392         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8393         (EmitContext): Add GenericDeclContainer implementation.
8394         * decl.cs (MemberCore, DeclSpace): Likewise.
8395         * namespace.cs: Remove #ifdef GMCS_SOURCE.
8397         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8398         MCS TypeManager has a corresponding dummy method.
8400 2006-09-19  Martin Baulig  <martin@ximian.com>
8402         * expression.cs: Completely merged with the gmcs version.
8404 2006-09-19  Martin Baulig  <martin@ximian.com>
8406         * expression.cs (Invocation): Merged with the gmcs version.
8407         (ArrayAccess.GetStoreOpcode): Likewise.
8409 2006-09-19  Martin Baulig  <martin@ximian.com>
8411         * typemanager.cs
8412         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8413         (TypeManager.IsGenericMethodDefinition): Likewise.
8415 2006-09-19  Martin Baulig  <martin@ximian.com>
8417         * typemanager.cs
8418         (TypeManager.IsEqual): Moved the gmcs implementation here.
8419         (TypeManager.DropGenericTypeArguments): Likewise.
8420         (TypeManager.DropGenericMethodArguments): Likewise.
8421         (TypeManager.GetTypeArguments): Moved here from gmcs.
8422         (TypeManager.HasGenericArguments): Likewise.
8424 2006-09-19  Martin Baulig  <martin@ximian.com>
8426         * expression.cs (Binary): Merged with the gmcs version.
8428 2006-09-19  Martin Baulig  <martin@ximian.com>
8430         * expression.cs (Probe, As, Is): Merged with the gmcs version.
8432 2006-09-19  Martin Baulig  <martin@ximian.com>
8434         * typemanager.cs: Merged with the gmcs version.
8436 2006-09-16  Raja R Harinath  <rharinath@novell.com>
8438         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8439         * driver.cs: Likewise.
8441 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
8443         A fix for #79401
8444         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8445         only if parent type is class.
8446         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8447         update.
8449 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
8451         * cs-parser.jay,
8452         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8453         keywords are used.
8454         * typemanager.cs(CSharpName): Converts NullType to null.
8456 2006-09-15  Martin Baulig  <martin@ximian.com>
8458         * typemanager.cs
8459         (TypeManager.GetMethodName): Added mcs implementation.
8460         (TypeManager.IsEqual): Likewise.
8462         * ecore.cs
8463         (SimpleName.RemoveGenericArity): Added dummy implementation.
8465         * pending.cs: Merged with the gmcs version.     
8467 2006-09-15  Martin Baulig  <martin@ximian.com>
8469         * statement.cs: Merge with the gmcs version.
8471 2006-09-15  Martin Baulig  <martin@ximian.com>
8473         * statement.cs (Switch): Merge with the gmcs implementation
8474         (without nullables), which is newer.
8476 2006-09-15  Martin Baulig  <martin@ximian.com>
8478         * statement.cs (Block.Variables): Make this public.
8479         (ToplevelBlock.Parameters): Make this a property.
8480         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8482 2006-09-15  Martin Baulig  <martin@ximian.com>
8484         * namespace.cs: Merge with the gmcs version.
8486 2006-09-15  Martin Baulig  <martin@ximian.com>
8488         * decl.cs (MemberName): Minor code cleanups.
8490 2006-09-15  Martin Baulig  <martin@ximian.com>
8492         * parameter.cs: Merge with the gmcs version.
8494 2006-09-15  Martin Baulig  <martin@ximian.com>
8496         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8497         and an error in mcs.
8499 2006-09-15  Martin Baulig  <martin@ximian.com>
8501         * flowanalysis.cs: Merged from GMCS; added the generics code into
8502         a `GMCS_SOURCE' conditional so we can share this file.
8504 2006-09-08  Martin Baulig  <martin@ximian.com>
8506         * typemanager.cs (TypeManager.interlocked_type): New public field.
8507         (TypeManager.int_interlocked_compare-exchange): New public field.
8508         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8509         enumerator types here and call InitGenericCoreTypes().
8510         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8511         after calling InitEnumUnderlyingTypes().
8513         * rootcontext.cs
8514         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8515         `classes_second_stage'. 
8517 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
8519         * assign.cs, ecore.cs, expression.cs: Share error message text.
8520         * class.cs (FieldMember.Define): Check for varible of static type.
8521         * driver.cs (LoadAssembly): Uses error output for errors.
8522         * statement.cs: Updated.
8524 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
8526         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8527         type instance.
8529 2006-09-07  Martin Baulig  <martin@ximian.com>
8531         * driver.cs
8532         (MainDriver): Revert r62663 from Marek; see #70506 for details.
8534 2006-08-29  Miguel de Icaza  <miguel@novell.com>
8536         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8537         
8538 2006-08-17  Miguel de Icaza  <miguel@novell.com>
8540         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8541         #52019 and #79064, the use of the \uXXXX sequence in source code
8542         to represent unicode characters.
8544 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
8546         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8547         support.
8548         * class.cs, ecore.cs, statement.cs: Merged to one error message.
8550 2006-08-13  Miguel de Icaza  <miguel@novell.com>
8552         * assign.cs: Catch attempts to assign to a method groups in += and
8553         report as 1656
8555 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
8557         A fix for #79056
8558         * cs-parser.jay: Don't destroy current array type by typeof of array's.
8560 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
8562         * class.cs (Method.Define): Issue a warning when generic method looks like
8563         an entry point.
8564         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8565         as well.
8567 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
8569         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8570         looking for ctor.
8571         * decl.cs (MemberCache.FindMembers): When container is interface we need to
8572         search all base interfaces as a member can be ambiguous.
8573         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8574         Constructor member type filter. 
8575         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8576         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8577         reporting for returned memberinfos.
8578         * report.cs: Updated.
8579         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8580         version to work on all runtimes.
8581         (TypeManager.RealMemberLookup): Removed members filtering.
8583 2006-08-08  Raja R Harinath  <rharinath@novell.com>
8585         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8586         (PropertyExpr.EmitAssign): Likewise.
8587         * expression.cs (Indirection.EmitAssign): Likewise.
8588         (LocalVariableReference.EmitAssign): Likewise.
8589         (ParameterReference.EmitAssign): Likewise.
8590         (Invocation.EmitArguments): Likewise.
8591         (ArrayAccess.EmitAssign): Likewise.
8592         (IndexerAccess.EmitAssign): Likewise.
8593         (This.EmitAssign): Likewise.
8594         (ConditionalLogicalOperator.Emit): Likewise.
8596         Fix #79026
8597         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
8598         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
8599         leave it in after returning it.
8600         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
8602 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
8604         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8605         message.
8607 2006-08-03  Raja R Harinath  <rharinath@novell.com>
8609         Fix cs0146-3.cs and cs0146-4.cs.
8610         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8611         enclosing types don't depend on the current type.
8613 2006-08-02  Raja R Harinath  <rharinath@novell.com>
8615         Fix #77963
8616         * class.cs (TypeContainer.DoDefineMembers): Use
8617         FindBaseMemberWithSameName on Parent, since we're interested in
8618         whether we hide inherited members or not.
8619         (FindBaseMemberWithSameName): Make slightly more robust.
8621         Fix the non-generic testcase from #77396
8622         * decl.cs (DeclSpace.DeclContainer): Remove override.
8624         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8625         declspaces for doppelgangers too.
8626         (UsingEntry): Implement IResolveContext.
8627         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
8628         'this' as the resolve context.
8629         (LocalAliasEntry): Likewise.
8631         Implement parts of #77403
8632         * roottypes.cs (RootDeclSpace): New.  Used to represent the
8633         toplevel declaration space.  Each namespace declaration introduces
8634         a "partial" root declaretion space.
8635         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8636         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8637         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8638         from 'current_namespace.SlaveDeclSpace'.
8639         (namespace_declaration): Likewise.
8640         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8641         check.  It can't happen now.
8642         * decl.cs (DeclSpace.LookupType): Likewise.
8643         * driver.cs (MainDriver): Sanity check.
8645 2006-08-01  Raja R Harinath  <rharinath@novell.com>
8647         * decl.cs (DeclSpace.FindNestedType): Remove.
8648         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8649         LookupTypeContainer to get the container of the nested type.
8650         * class.cs (TypeContainer.FindNestedType): Make non-override.
8652 2006-07-31  Raja R Harinath  <rharinath@novell.com>
8654         * decl.cs (DeclSpace.PartialContainer): Move field from ...
8655         * class.cs (TypeContainer.PartialContainer): ... here.
8656         (TypeContainer.AddBasesForPart): New helper.
8657         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
8658         instead.
8659         * cs-parser.jay (current_class): Convert to DeclSpace.
8660         (struct_declaration, interface_declaration, class_declaration):
8661         Use AddBasesForPart instead of .Bases directly.
8662         * const.cs, iterators.cs: Update to changes.
8664 2006-07-28  Raja R Harinath  <rharinath@novell.com>
8666         * class.cs (TypeContainer.AddMemberType): Rename from
8667         AddToTypeContainer.
8668         (TypeContainer.AddMember): Rename from AddToMemberContainer.
8669         (AddTypeContainer): New.  Combine AddClassOrStruct and
8670         AddInterface.
8671         (AddPartial): Update.  Add 'is_partial' argument.
8672         * roottypes.cs: Update to changes.
8673         * cs-parser.jay (push_current_class): New helper for handling
8674         current_container and current_class.
8675         (struct_declaration, interface_declaration, class_declaration):
8676         Use it.
8678 2006-07-26  Raja R Harinath  <rharinath@novell.com>
8680         * roottypes.cs: Rename from tree.cs.
8682         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8683         * tree.cs (Tree, ITreeDump): Remove types.
8684         * rootcontext.cs (tree, Tree): Remove fields.
8685         (root, ToplevelTypes): New.
8686         * *.cs: Update to rename.
8688         * tree.cs (Tree.RecordDecl): Remove.
8689         (RootTypes.AddToTypeContainer): Record the toplevel type in its
8690         namespace here.
8691         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8693 2006-07-23  Raja R Harinath  <harinath@gmail.com>
8695         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8696         DoFlowAnalysis and OmitStructFlowAnalysis here.
8697         (ec.With): Rename from WithUnsafe and generalize.
8698         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
8699         (ec.WithFlowAnalyis): New.
8700         * ecore.cs, expression.cs, statement.cs: Update.
8702 2006-07-22  Raja R Harinath  <harinath@gmail.com>
8704         * statement.cs (Block.ResolveMeta): Simplify slightly.
8706         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
8707         multiple boolean fields.  Convert InUnsafe, constant_check_state,
8708         check_state to flags.
8709         (CheckState, ConstantCheckState): Update.
8710         (InUnsafe): New read-only property.
8711         (FlagsHandle): Rename from CheckStateHandle and convert to handle
8712         arbitrary flags.
8713         (WithUnsafe): New helper similar to WithCheckState.
8714         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8715         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8717 2006-07-21  Raja R Harinath  <rharinath@novell.com>
8719         Make comparisons use the same IL irrespective of whether they're
8720         in a 'checked' or 'unchecked' context: one of the issues in #78899
8721         * codegen.cs (EmitContext.CheckState): Make read-only property.
8722         (EmitContext.ConstantCheckState): Likewise.
8723         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8724         helper that implement a save/restore stack for CheckState
8725         values.  This is the only way to change check-state.
8726         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8727         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8728         (CheckedExpr.EmitBranchable): New forwarding method.
8729         (UnCheckedExpr): Likewise.
8730         * statement.cs (Block.ResolveMeta): Use WithCheckState.
8731         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8732         (Checked.Resolve, checked.DoEmit): Likewise.
8734 2006-07-20  Miguel de Icaza  <miguel@novell.com>
8736         * anonymous.cs: Cache the resolved anonymous delegate, and return
8737         this so that the ResolveTopBlock is only triggered once, not
8738         twice.
8740         Currently we trigger ResolvetopBlock twice due to a first pass of
8741         argument check compatibility, and a second pass that does the
8742         actual resolution.   
8743         
8744 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8746         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8747         modifiers.
8748         * rootcontext.cs (Reset): Add helper_classes.
8750 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8752         A fix for #78860
8753         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8754         correctly.
8756 2006-07-13  Miguel de Icaza  <miguel@novell.com>
8758         * statement.cs (Lock): Handle expressions of type
8759         TypeManager.null_type specially.  Fixes #78770
8761 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8763         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8764         to an event.
8766 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8768         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8769         for accessors as well.
8770         * ecore.cs (EventExpr): Add AccessorTable.
8772 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
8774         A fix for #78738
8775         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8776         for CS0122 where appropriate.
8777         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8778         level attributes.
8779         (Filter): Assembly can be null in the case of top level attributes.
8781 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
8783         A fix for #78690
8785         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8786         is done at global level.
8788 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8790         A fix for #77002, Implemented TypeForwarder support.
8792         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8793         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8794         * typemanager.cs (): Add type_forwarder_attr_type.
8796 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8798         * report.cs: Add CS0469 warning.
8800 2006-06-21  Martin Baulig  <martin@ximian.com>
8802         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8803         the `try'-block, so we also report CS0016 etc. there.
8805 2006-06-21  Martin Baulig  <martin@ximian.com>
8807         * delegate.cs
8808         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8810 2006-06-21  Martin Baulig  <martin@ximian.com>
8812         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8813         also report CS1686 for parameters.
8815 2006-06-21  Martin Baulig  <martin@ximian.com>
8817         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8818         instead of an error if the value is not implicitly convertible to
8819         the switch types; fixes #77964.
8821 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8823         Fix #78673
8824         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8825         FieldBuilder is null.
8827         Fix #78662
8828         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8829         'left' and 'right' before error-checking.
8831 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8833         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8834         Fixed bug #78601.
8835         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8836         (FieldExpr.DoResolve): likewise.
8837         (PropertyExpr.InstanceResolve): likewise.
8838         (EventExpr.InstanceResolve): likewise. 
8840 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8842         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8843         attribute applicable tests for attribute argument.
8845 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8847         Fix #78079
8848         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8849         (Binary.OverloadResolve_PredefinedIntegral): New.
8850         (Binary.OverloadResolve_PredefinedFloating): New.
8851         (Binary.OverloadResolve_PredefinedString): New.
8852         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8853         Follow the standard more closely, and treat numeric promotions in
8854         terms of overload resolution.
8855         (Binary.CheckShiftArguments): Simplify.
8857 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8859         * flowanalysis.cs (MyBitVector): Simplify representation.
8860         (MyBitVector.Clone): Avoid allocating BitArray.
8861         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8862         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8863         (*): Update.  Change all references to MyBitVector.And and
8864         MyBitVector.Or to &= and |=.
8866 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8868         Fix cs0231-[34].cs.
8869         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8870         to param arguments too.
8872 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8874         * cs-parser.jay: Catch another parsing form for arglist being
8875         followed by other arguments.  Fixes #78313.
8877 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8879         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8880         checking of out parameters to ...
8881         (FlowBranchingToplevel.Merge): ... here.
8882         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8883         set, propagate the origin upward, and only complain if there was
8884         no other error.
8885         (FlowBranchingException.AddContinueOrigin): Likewise.
8886         (FlowBranchingException.AddReturnOrigin): Likewise.
8887         (FlowBranchingException.AddGotoOrigin): Likewise.       
8889 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8891         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8892         unreachable, skip it.
8893         (FlowBranchingException.Merge): Always propagate jumps, even if
8894         the finally block renders subsequent code unreachable.
8896 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8898         Fix #77601
8899         * statement.cs (Goto.Resolve): Move responsibility for resolving
8900         'goto' to FlowBranching.AddGotoOrigin.
8901         (Goto.SetResolvedTarget): New.  Callback to set the
8902         LabeledStatement that's the target of the goto.
8903         (Goto.DoEmit): Use Leave instead of Br when crossing an
8904         unwind-protect boundary.
8905         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8906         LookupLabel and adjust to new semantics.
8907         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8908         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8909         Goto.SetResolvedTarget to update target.
8910         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8911         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8912         AddBreakOrigin & co.  Delay propagation until ...
8913         (FlowBranchingException.Merge): ... this.
8915         * statement.cs (Block.Resolve): Always depend on flow-branching to
8916         determine unreachability.  Kill workaround that originally emitted
8917         only one statement after an "unreachable" label (see infloop in
8918         test-515.cs).
8920         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8921         This is still "wrong", but anything better would probably need a
8922         multi-pass algorithm.
8923         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8924         usage vector.  Force current usage vector to be reachable, to
8925         optimistically signify backward jumps.
8926         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8927         detected.
8928         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8929         detected, return the original salted-away usage vector instead,
8930         updated with appropriate changes.  Print unreachable warning if
8931         necessary.
8932         * statement.cs (Block.Resolve): Don't print unreachable warning on
8933         a labeled statement.
8935 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8937         * driver.cs: Pass filename without path to AssemblyBuilder's 
8938         AddResourceFile. Fixes bug #78407.
8940 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8942         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8943         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8944         (FlowBranching.MergeChild): Overwrite
8945         reachability information from Labeled branchings too.
8947 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8949         * statement.cs (Goto.Resolve): Merge jump origins here ...
8950         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8952         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8953         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8954         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8955         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8956         here, ...
8957         * statement.cs (Goto.Resolve): ... not here.
8958         (Goto.Emit): Remove CS1632 check.
8960 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8962         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8963         error message.
8965 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8967         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8968         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8969         (FlowBranchingException.Label): Likewise.
8971         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8972         given value.
8973         (MyBitVector.Or): Use it to avoid losing information (Count).
8974         (FlowBranching.MergeOrigins): Likewise.
8976         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8977         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8978         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8979         (UsageVector.ToString): Simplify.
8980         (UsageVector.MergeSiblings): Move here from ...
8981         (FlowBranching.Merge): ... here.
8982         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8983         not a MyBitVector.
8985 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8987         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8988         null bitvector is treated as all-true.
8990         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8991         (MyBitVector): Rationalize invariants.  'vector != null' implies
8992         that we have our own copy of the bitvector.  Otherwise,
8993         'InheritsFrom == null' implies all inherited bits are true.
8995 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8997         * statement.cs (LocalInfo): Add IsConstant.
8998         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8999         local variable for constants.
9001 2006-05-09  Raja R Harinath  <rharinath@novell.com>
9003         * flowanalysis.cs (MyBitVector.Empty): New.
9004         (MyBitVector): Don't allow InheritedFrom to be null.
9005         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
9006         (UsageVector, FlowBranching): Update to changes.
9008         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
9009         recursion.  The 'Parent == null' condition isn't sufficient for
9010         anonymous methods.
9011         (FlowBranching.AddBreakOrigin): Likewise.
9012         (FlowBranching.AddContinueOrigin): Likewise.
9013         (FlowBranching.AddReturnOrigin): Likewise.
9014         (FlowBranching.StealFinallyClauses): Likewise.
9015         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
9016         (FlowBranching.CheckOutParameters): Likewise.
9017         (FlowBranchingToplevel): Terminate all the above recursions here.
9018         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
9019         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
9021         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
9022         toplevel block.
9023         (FlowBranchingToplevel): New.  Empty for now.
9024         (FlowBranching.MergeTopBlock): Update.
9025         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
9026         branching for the anonymous delegate.
9027         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
9029         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
9030         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
9031         information at the start of the merge.  Reorganize.
9033 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
9035         * class.cs (MethodData.Define): Method cannot implement interface accessor.
9037 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
9039         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
9040         to newly introduced ctor.
9042         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
9043         message to one place.
9044         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
9045         global namespace.
9047 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
9049         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
9051         * ecore.cs (Expression.ResolveAsConstant): Updated.
9053         * statement.cs (ResolveMeta): Updated.
9055 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
9057         * cs-parser.jay: __arglist cannot be used in initializer.
9059 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
9061         A fix for #77879
9062         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
9063         private types.
9065 2006-05-05  Raja R Harinath  <rharinath@novell.com>
9067         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
9068         (LabeledStatement): Add 'name' parameter.
9069         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
9070         (Block.AddLabel): Update to changes.
9071         * cs-parser.jay (labeled_statement): Likewise.
9073         * flowanalysis.cs (BranchingType.Labeled): New.
9074         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
9075         (FlowBranchingLabeled): New.  Does nothing for now, but will
9076         eventually handle 'goto' flows.
9077         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
9078         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
9079         that's terminated ...
9080         (Block.Resolve): ... here.
9082         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
9083         (UsageVector.MergeFinallyOrigins): Likewise.
9084         (FlowBranching.InTryOrCatch): Likewise.
9085         (FlowBranching.AddFinallyVector): Likewise.
9086         (FlowBranchingException): Update to changes.
9088         Fix #78290
9089         * statement.cs (Return.Resolve): Move error checking to ...
9090         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
9091         (FlowBranchingException): Handle return origins like break and
9092         continue origins.
9093         (FlowBranching.UsageVector.CheckOutParameters): Remove.
9095 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
9097         A fix for #76122
9098         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
9099         filter.
9101 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
9103         A fix for #77543
9104         * class.cs (MethodData.Define): Do public accessor check only when method
9105         implements an interface.
9107 2006-05-04  Raja R Harinath  <rharinath@novell.com>
9109         Remove special handling of 'break'
9110         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
9111         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
9112         (UsageVector.Break): Remove.
9113         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
9114         reachability.
9115         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
9117         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
9118         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
9120 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
9122         A fix for #75726
9123         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
9124         be the interface member.
9126 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
9128         A fix for #60069
9129         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
9130         for emitting small (int) values.
9132 2006-05-03  Raja R Harinath  <rharinath@novell.com>
9134         Fix #59427
9135         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
9136         control-flow passes through the 'finally' after merging-in all the
9137         control-flows from 'try' and the 'catch' clauses.
9139         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
9140         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
9141         always true at the only non-recursive entry point.
9142         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
9143         FlowBranchingBreakable.
9144         (FlowBranchingLoop): Remove.
9145         * statement.cs (Return.DoResolve): Update to changes.
9147         Fix #76471, #76665
9148         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
9149         (FlowBranching.CreateBranching): Handle it: create a
9150         FlowBranchingContinuable.
9151         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
9152         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
9153         except that it handles the 'continue' command.
9154         (FlowBranching.UsageVector.MergeOrigins): Rename from
9155         MergeBreakOrigins.
9156         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
9157         except that it overrides AddContinueOrigin.
9158         (FlowBranchingException): Override AddContinueOrigin, similar to
9159         AddBreakOrigin.
9160         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
9161         Create a new branching around the embedded statement.
9162         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
9163         control flow after the embedded statement.
9164         (Continue.Resolve): Move all error checking to AddContinueOrigin.
9166         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
9167         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
9168         FlowBranchingBreakable.
9169         (FlowBranchingSwitch): Remove.
9171         Fix test-503.cs
9172         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
9173         error reporting to ...
9174         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
9175         Rename from 'AddBreakVector'.  Add new location argument.  Return
9176         a bool indicating whether the 'break' crosses an unwind-protect.
9177         (FlowBranchingException.AddBreakOrigin): Add.
9178         (FlowBranchingException.Merge): Propagate 'break's to surrounding
9179         flowbranching after updating with the effects of the 'finally'
9180         clause.
9181         (FlowBranchingBreakable): New common base class for
9182         FlowBranchingLoop and FlowBranchingSwitch.
9184         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
9185         embedded statement.
9186         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
9188 2006-05-02  Raja R Harinath  <rharinath@novell.com>
9190         * statement.cs (Do.Resolve): If the loop is infinite, set the
9191         barrier.
9192         (While.Resolve, For.Resolve): Set a barrier after the embedded
9193         statement.  There's no direct control flow that goes from the end
9194         of the embedded statement to the end of the loop.
9195         * flowanalysis.cs (FlowBranching.Infinite): Remove.
9196         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
9197         above ensure that the reachability is correctly computed.
9199         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
9200         (UsageVector.MergeBreakOrigins): If the current path is
9201         unreachable, treat it as if all parameters/locals are initialized.
9202         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
9203         infinite loops before merging-in break origins.
9205         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
9206         (Reachability.Reachable): Split part into ...
9207         (Reachability.Unreachable): ... this.  Simplify.
9208         (Reachability.IsUnreachable): Use 'Unreachable' instead.
9210         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
9211         (Reachability.SetThrowsSometimes): Likewise.
9212         (FlowBranchingBlock.MergeTopBlock): Don't compare against
9213         TriState.Always, use corresponding property.
9214         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
9215         (Block.Resolve): Likewise.  Remove some redundant checks.
9217 2006-05-02  Raja R Harinath  <harinath@gmail.com>
9219         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
9220         (Reachability.Meet): Don't bother checking AlwaysThrows --
9221         barrier is always set.
9222         (FlowBranchingBlock.Merge): Likewise.
9224 2006-05-01  Raja R Harinath  <harinath@gmail.com>
9226         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9227         checks for unreachable.
9229 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
9231         A fix for #77980
9232         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9234         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9235         whether field is really assigned.
9237 2006-04-30  Raja R Harinath  <harinath@gmail.com>
9239         * flowanalysis.cs (Reachability): Make 4-argument constructor
9240         private.
9241         (Reachability.Meet): Rename from 'And'.  Remove static variant.
9242         (Reachability.Always): Rename from the highly misleading
9243         'Reachability.Never'.
9244         (FlowBranching.Merge): Update to changes.  Mark an impossible
9245         situation with a 'throw'.
9246         (*): Update to changes.
9248 2006-04-29  Raja R Harinath  <harinath@gmail.com>
9250         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9251         Remove 'Undefined'.
9252         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9253         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9254         (*): Update to changes.
9255         * statement.cs: Update to changes.
9257 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
9259         A fix for #78049
9260         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9262 2006-04-28  Raja R Harinath  <harinath@gmail.com>
9264         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9265         dummy UsageVector.
9267         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9268         argument to two arguments: an usage-vector and a bool.  Move call
9269         to FlowBranching.Merge () ...
9270         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9272         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9273         handling of loop and switch reachability to ...
9274         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9276 2006-04-27  Raja R Harinath  <harinath@gmail.com>
9278         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9279         handling to FlowBranchingLoop.InLoop.
9280         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9282 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
9284         A fix for #78115
9285         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9286         anonymous method is allowed from AnonymousContainer here.
9288         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9290 2006-04-24  Raja R Harinath  <rharinath@novell.com>
9292         Fix #78156
9293         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9295 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
9297         A fix for #49011.
9298         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9299         (DoubleConstant.Reduce): Ditto.
9301 2006-04-23  Raja R Harinath  <rharinath@novell.com>
9303         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9304         Remove 'lvalue_right_side' argument.  Move parts to ...
9305         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9306         (LocalVariable.DoResolveLValue): ... these.
9308 2006-04-21  Raja R Harinath  <rharinath@novell.com>
9310         Fix cs1655.cs
9311         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9312         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9313         (LocalVariableReference.DoResolveBase): Use it to implement new
9314         CS1655 check.
9315         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9316         (Argument.Resolve): Simplify.  Move CS1510 check ...
9317         * ecore.cs (Expression.ResolveLValue): ... here.
9318         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9319         (PropertyExpr.DoResolveLValue): Likewise.
9320         (FieldExpr.Report_AssignToReadonly): Likewise.
9321         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
9322         LValueMemberAccess or LValueMemberOutAccess on instance depending
9323         on it.
9324         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9325         DoResolve as appropriate.
9327 2006-04-20  Raja R Harinath  <rharinath@novell.com>
9329         Fix #75800
9330         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9331         implicit conversions on 'out' and 'ref' arguments.
9333         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9334         improve clarity.  Remove dead code.
9336         Fix #66031
9337         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9338         (Catch.Resolve): Resolve VarBlock if it exists.
9340 2006-04-19  Miguel de Icaza  <miguel@novell.com>
9342         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9343         twice, this was some residual code, the enumerator was emitted
9344         properly in the two branche of if later.
9346 2006-04-19  Raja R Harinath  <rharinath@novell.com>
9348         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
9349         cast is never an lvalue.
9350         (Cast.DoResolve, Cast.ResolveRest): Combine.
9351         (Argument.Emit): Simplify slightly.  Move 'Expr is
9352         IMemoryLocation' check ...
9353         (Argument.Resolve): ... here.
9354         (Argument.Error_LValueRequired): Remove.  Inline into only user.
9356         Simplifications.  Fix cs0191-2.cs
9357         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9358         CS1649 and CS1651 to ...
9359         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
9360         the actual selection of the error code and message to a lookup
9361         table.  Add a dummy return value to simplify callsites.
9362         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9363         readonly fields of other instances of the same type.  Move CS0197
9364         warning from ...
9365         * expression.cs (Argument.Resolve): ... here.  Simplify code.
9366         Ensure that ec.InRefOutArgumentResolving is only set during LValue
9367         resolution of an out or ref argument.  The code simplification
9368         above uses this invariant.
9370 2006-04-18  Raja R Harinath  <rharinath@novell.com>
9372         Possibly fix #77752.  Fix cs1690-[4-7].cs.
9373         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9374         CheckMarshallByRefAccess.  Drop parameter.
9375         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
9376         warning.
9377         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9378         InstanceExpression.
9379         * report.cs (AllWarnings): Add CS1690.
9380         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9381         for ref access too.
9382         (LocalVariableReference.DoResolveBase): Update.
9384 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9386         * class.cs (MethodOrOperator): Moved common parts from method class.
9387         detect obsolete attributes.
9388         (Method.Define): Simplified as it reuses code from base.
9389         (Constructor.ValidAttributeTargets): Fixed issue found during
9390         refactoring.
9391         (Destructor.ValidAttributeTargets): Fixed issue found during
9392         refactoring.
9393         (Operator): Finished refactoring set off by #78020. Operator class is now
9394         ordinary method class.
9396         * anonymous.cs: Updated.
9398         * decl.cs (DeclSpace): Add IsGeneric
9400 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9402         * class.cs (Constructor.Emit): Don't emit the attributes twice.
9404 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9406         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9407         detect obsolete attributes.
9408         (Method.CreateEmitContext): Moved to MethodOrOperator.
9410 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9412         A fix for #78048.
9413         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9414         customized exception to make crash detection easier.
9415         (MethodOrOperator): Started to work on new base class for methods and
9416         operators.
9417         (Method): Derives from MethodOrOperator.
9418         (Constructor.Emit): Emits its own attributes.
9419         (AbstractPropertyEventMethod.Emit): Ditto.
9420         (Operator): Derives from MethodOrOperator, will refactor fully in extra
9421         patch.
9422         (Operator.Emit): It's temporary more tricky than should be.
9423         
9424         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9426         * report.cs (InternalErrorException): Add ctor with inner exception.
9428 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
9430         A fix for #76744.
9431         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9432         only not visible.
9434 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
9436         A fix for #77916.
9437         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9438         array.
9440 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9442         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9443         attribute is present and Guid not.
9444         (Interface.ApplyAttributeBuilder): Ditto.
9446         * attribute.cs: Add error message.
9448 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9450         A fix for #78020.
9452         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9453         sources (it's composite) so hold them in extra array as they are used in
9454         Emit phase only. It worked in the previous versions by mistake.
9455         (Attribute.Emit): Emit attribute for more owners when exist.
9457         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9458         it has now different behaviour.
9460 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
9462         * constant.cs (Constant.IsDefaultInitializer): New method.
9464         * class.cs: Updated.
9466         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9467         re-initialize default values. It saves KBs almost for every assembly.
9468         Thanks Zoltan for the idea.
9469         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9470         (ArrayCreation.DoResolve): Resolve only once.
9471         (ArrayCreation.Emit): Emit static initializer only when it is faster.
9472         (ArrayCreation.GetAttributableValue): Cope with optimized values.
9474 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
9476         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9477         From #77961.
9479 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9481         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9482         in an embedded statement too.
9484 2006-04-01  Raja R Harinath  <rharinath@novell.com>
9486         Fix #77958
9487         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9489 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9491         A fix for #77966.
9493         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9494         was not specified.
9496         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9498 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
9500         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9501         phase.
9503         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9504         LocalTemporary change.
9506         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9507         TypeContainer.
9508         (ClassOrStruct.DefineFieldInitializers): Implemented static field
9509         initializers optimization.
9510         (ClassOrStruct.TypeAttr): Moved from modifiers.
9511         (Constructor.CheckBase): Don't crash when static ctor has parameters.
9512         (FieldBase.ResolveInitializer): Resolves initializer.
9513         (FieldBase.HasDefaultInitializer): New property.
9515         * cs-parser.jay: Removed message.
9517         * expression.cs (CompilerGeneratedThis): New specialization.
9519         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9521 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
9523         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9525 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9527         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9528         be now EnumConstants only.
9530 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9532         * attribute.cs, driver.cs: Reset more caches.
9534 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9536         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9538 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9540         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9541         for easier reuse. Updated all overrides.
9542         (IntegralConstant): New base class for all integral constants.
9543         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9544         of the constant range, report custom error.
9545         (UIntConstant.Reduce): Fixed uint conversion.
9547         * ecore.cs, literal.cs: Reduce updates.
9549 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9551         A fix for #75813.
9553         * class.cs (Constructor.Define): Removed extra if for default ctors.
9554         A patch from Atsushi Enomoto.
9556 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9558         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9559         GetAttributableValue.
9561         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9562         when required.
9564         * convert.cs (ImplicitConversionRequired): Error message moved to
9565         DoubleLiteral.
9567         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9568         automatic implicit conversion of an output value.
9569         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9571         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9572         conversion.
9573         (TypeOf.GetAttributableValue): Add extra handling for object type.
9575         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9576         special error message.
9578 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
9580         * class.cs (Constructor.Emit): Don't crash when struct ctor is
9581         InternalCall.
9582         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9583         compatible with MS runtime.
9585 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
9587         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9588         attribute arguments here.
9590         * class.cs (Indexer.Define): The check was moved to attribute class.
9592 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
9594         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9595         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9596         easier.
9598 2006-03-22  Raja R Harinath  <rharinath@novell.com>
9600         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
9601         mcs to keep code differences small.
9602         * attribute.cs (Attribute.GetParameterDefaultValue): New.
9603         * typemanager.cs (parameter_default_value_attribute_type): New.
9604         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
9605         CS1908 check.
9607 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9609         * expression.cs (StringConcat.Append): Reverted back to no warning state.
9611 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9613         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9615         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9616         the blocks too.
9618 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
9620         * doc-bootstrap.cs : fix build.
9622 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9624         * expression.cs (StringConcat.Append): Issue a warning when empty string
9625         is going to append.
9627 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9629         * assign.cs (CompoundAssign.ResolveSource): Removed.
9631         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9632         clean up.
9634         * class.cs (TypeContainer.FindMethods): Removed.
9635         (TypeContainer.CheckMemberUsage): Made static.
9637         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9639         * constant.cs (CheckRange): Removed unused type argument.
9640         (CheckUnsigned): Removed unused type argument.
9642         * cs-parser.jay: Updated after MemberAccess clean up.
9643         Uses Length for empty string test.
9645         * cs-tokenizer.cs: Uses Length for empty string test.
9646         (IsCastToken): Made static.
9647         (is_hex): Made static.
9648         (real_type_suffix): Made static.
9650         * decl.cs (SetupCache): Made static.
9651         (OnGenerateDocComment): Removed unused ds argument.
9653         * delegate.cs (VerifyDelegate): Removed unused argument.
9655         * doc.cs: Uses Length for empty string test.
9657         * driver.cs: Uses Length for empty string test.
9659         * enum.cs (IsValidEnumType): Made static
9661         * expression.cs (EnumLiftUp): Removed unused argument.
9662         (ResolveMethodGroup): Ditto.
9663         (BetterConversion): Ditto.
9664         (GetVarargsTypes): Ditto.
9665         (UpdateIndices): Ditto.
9666         (ValidateInitializers): Ditto.
9667         (MemberAccess.ctor): Ditto.
9668         (GetIndexersForType): Ditto.
9670         * flowanalysis.cs: (MergeFinally): Removed unused argument.
9672         * iterators.cs: Updated after MemberAccess clean up.
9674         * location.cs: Uses Length for empty string test.
9676         * namespace.cs: Uses Length for empty string test.
9678          * report.cs (CheckWarningCode): Made static.
9680         * statement.cs (LabeledStatement): Removed unused argument.
9682         * typemanager.cs (FilterNone): Removed.
9684 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9686         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9687         obsolete.
9689         * class.cs: Updated.
9691 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9693         * cs-parser.jay.cs: __arglist is not allowed for delegates.
9695 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9697         A fix for #77822.
9699         * expression.cs (VerifyArgumentsCompat): Reverted to double error
9700         reporting, it's more tricky than I thought.
9702 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9704         A fix for #77816.
9706         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
9707         host container.
9708         (AnonymousMethod.ImplicitStandardConversionExists): New method.
9709         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9710         Add more error reporting; Fixed issue with params.
9712         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9714         * cs-parser.jay: AnonymousMethod requires host container.
9716         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9718 2006-03-18  Raja R Harinath  <harinath@gmail.com>
9720         * class.cs: Change 'TypeContainer ds' constructor argument to
9721         'DeclSpace parent'.  Some classes were missed below due to
9722         different naming convention.
9724         * class.cs (MemberCore.Parent): Delete.  This makes the
9725         ParentContainer changes below enforceable by the compiler.
9727         Treat pointers to enclosing declaration space as 'DeclSpace', not
9728         'TypeContainer'.
9729         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9730         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9732         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9733         of TypeContainer.
9734         (Block.AddThisVariable): Likewise.
9735         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9736         (AbstractPropertyEventMethod.Emit): Likewise.
9737         (AbstractPropertyEventMethod.EmitMethod): Likewise.
9738         (GetMethod.Define, SetMethod.Define): Likewise.
9739         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9740         (DelegateMethod.EmitMethod): Likewise.
9742         Fix regression test-partial-13.cs.
9743         Rationalize use of PartialContainer.  Ensure that the partial
9744         class semantics can be tied to type-correctness, i.e., any
9745         violation will cause a compile error.
9746         * class.cs, const.cs: Access all fields that belong to class
9747         TypeContainer via ParentContainer.  Arguments of EmitContexts and
9748         Resolve()-like functions still use 'Parent'.
9750         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9751         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9752         (PropertyMethod.CheckModifiers): Remove unused argument.
9753         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9754         DeclSpace.
9756 2006-03-17  Raja R Harinath  <harinath@gmail.com>
9758         Make semantics of PartialContainer simpler.
9759         * decl.cs (DeclSpace.IsPartial): Remove.
9760         * class.cs (TypeContainer.IsPartial): Likewise.
9761         (TypeContainer..ctor): Set PartialContainer to point to self.
9762         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9763         (TypeContainer.FindNestedType): Likewise.
9764         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
9766 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
9768         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9770 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9772         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9773         classes.
9775 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9777         * class.cs (Operator.Define): An error for base conversion was not
9778         reported correctly.
9780 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
9782         * iterator.cs : yield break is allowed in try statement which has
9783           catch clauses. Fixed bug #77767.
9785 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
9787         A fix for #77593, #77574.
9789         * class.cs (MethodCore.CheckBase): Another if for operator.
9791 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9793         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9794         were not resolved
9796         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9797         (DelegateCreation.ImplicitStandardConversionExists): New method for just
9798         conversion test.
9799         
9800         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9801         not needed.
9803         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9804         Updated after another emitcontext usage was clean up. It should help us to
9805         synchronize with gmcs easier.
9807 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9809         A fix for #77353.
9811         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9812         (Event.Define): ditto
9813         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9815         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9816         Removed redundant code and set NewSlot for Invoke method too.
9818         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9819         (Parameters.MergeGenerated): New method. Use this method when you merge
9820         compiler generated argument with user arguments.
9822 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9824         * attribute.cs (ResolveAsTypeTerminal): Removed.
9826         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9827         specialization for predefined types; 30% speed up.
9828         Finally placed obsolete check to right place.
9829         (Expression.ResolveType): Removed.
9831         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9832         Updated after ResolveType was removed.
9834         * expression.cs (Cast.ctor): Check void cast.
9835         (Binary.ResolveAsTypeTerminal): Is never type.
9836         (Conditional.ResolveAsTypeTerminal): Is never type.
9838         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9840 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9842         Fix #77679.
9843         * expression.cs (ParameterReference.DoResolveBase): Change return
9844         type to bool.
9845         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9846         Update.
9848         Fix #77628.
9849         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9851         Fix #77642.
9852         * typemanager.cs (GetFullNameSignature): Don't nullref on
9853         protected accessors.
9855 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9857         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9858         these two separated members to simplify the code.
9859         (Attribute.Resolve): Refactored to use new fields and methods.
9860         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9861         implemented obsolete attribute checking.
9862         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9863         implemented obsolete checking again. It look line never ending quest ;-)
9864         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9866         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9868         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9870         *class.cs (Property.Define): Add RegisterProperty call.
9872         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9873         argument groups (only 2).
9875         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9876         encoding expression to arguments.
9877         (Expression.ExprClassToResolveFlags): Just turned to property.
9879         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9880         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9881         optimized as well as implemented support for zero-length attributes.
9883         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9884         Add caching of PropertyInfo's.
9886 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9888         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9889         error multiple times.
9891 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9893         New partial class implementation.
9894         A fix for #77027, #77029, #77403
9896         * attribute.cs (Attributable): Made attributes protected.
9898         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9899         the replacements of ClassPart and PartialContainer.
9900         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9901         (TypeContainer.AddInterface): Ditto.
9902         (TypeContainer.AddPartial): The main method for partial classes. It checks
9903         for errors and merges ModFlags and attributes. At the end class is added to
9904         partial_parts list.
9905         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9906         required here.
9907         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9908         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9909         from the rest of partial classes.
9910         (TypeContainer.GetClassBases): Simplified.
9911         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9912         DefineType.
9913         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9914         (TypeContainer.HasExplicitLayout): Uses Flags now.
9915         (PartialContainer): Removed.
9916         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9917         (StaticClass): Was merged with Class.
9918         (Class.GetClassBases): class and static class bases are verified here.
9919         (Class.TypeAttr): Added static attributes when class is static.
9920         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9921         (MemberBase): In some cases we need to call parent container for partial
9922         class. It should be eliminated but it's not easy now.
9924         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9926         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9927         partial classed to accumulate class comments.
9928         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9930         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9932         * driver.cs (MainDriver): Tree.GetDecl was removed.
9934         * modifiers.cs (Modifiers): Add partial modifier.
9936         * tree.cs (Tree.decl): Removed.
9937         (RootTypes): Started to use this class more often for root types
9938         specializations.
9940 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9942         A fix for #77615
9944         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9945         external interface does not have an attribute.
9947 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9949         Another prerequisites for new partial classs implementation.
9950         
9951         * attribute.cs (Attribute.Equal): Implemented.
9952         (Attribute.Emit): Changed as attributes can be applied more than twice.
9953         (Attributes.Emit): Check for duplicate attributes here.
9955         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9956         as a parameter, clean-up.
9958 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9960         A fix for #77485
9962         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9963         contains obsolete attribute check which can in some cases look for base
9964         type of current class which is not initialized yet.
9965         (TypeContainer.BaseType): Replacement of ptype.
9967         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9969 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9971         First of prerequisites for new partial classs implemention.
9972         
9973         * attribute.cs (Attributable): Extended by ResolveContext;
9974         Attributes finally have correct context for resolving in all cases.
9975         (AttachTo): Attribute owner is assigned here.
9977         * codegen.cs (IResolveContext): Introduce new interface to hold
9978         all information needed in resolving phase.
9979         (EmitContext): Implements IResolveContext; more clean-up needed here.
9980         
9981         * decl.cs (MemberCore): Implemented IResolveContext.
9983         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9984         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9985         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9986         Refactored to use new IResolveContext instead of EmitContext; cleanup
9988 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9990         * codegen.cs (EmitScopeInitFromBlock): check here the
9991         capture_context, there is no need to make two calls to the
9992         EmitContext. 
9994         * anonymous.cs: Add some debugging messages that might help me
9995         track other instances of this problem in the future (the
9996         regression of test 467).
9998         * cs-parser.jay: track the variable block, as we need to initalize
9999         any captured variables declared in this block for the "catch"
10000         portion of the "Try" statement.
10002         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
10003         scope initialization for captured variables. 
10005         Also, move the emit for the variables after the block location has
10006         been marked.
10008 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
10010         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
10012 2006-02-02  Miguel de Icaza  <miguel@novell.com>
10014         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
10015         commit yesterday, the initialization for the roots is necessary.
10016         What is not necessary is the scope activation.
10018 2006-02-02  Raja R Harinath  <rharinath@novell.com>
10020         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
10021         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
10022         CS0206 checks.
10023         (Argument.Resolve): Remove CS0206 checks.
10025 2006-02-01  Miguel de Icaza  <miguel@novell.com>
10027         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
10028         scopes for all the roots, the scopes will now be emitted when the
10029         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
10031         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
10032         code.  This reduces a lot of existing cruft.
10033         
10034         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
10035         that the ScopeInfo is generated as we enter the scope, not at the
10036         time of use, which is what we used to do before.
10038         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
10039         every time a Block is about to be emitted if we have a
10040         CaptureContext. 
10042 2006-02-01  Raja R Harinath  <rharinath@novell.com>
10044         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
10045         (Reset): Update.
10046         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
10048         * typemanager.cs (cons_param_array_attribute): Make private.
10049         (Reset): Set it to null.
10050         (InitCoreHelpers): Don't initialize it.
10051         (ConsParamArrayAttribute): New.  Initialize it as needed.
10052         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
10054 2006-01-31  Miguel de Icaza  <miguel@novell.com>
10056         * expression.cs: There might be errors reported during the
10057         selection of applicable methods.  If there are errors, do not
10058         continue execution as it will lead the compiler to crash.
10060 2006-01-30  Miguel de Icaza  <miguel@novell.com>
10062         * expression.cs: Member access is not allowed on anonymous
10063         methods.  Fixes #77402.
10065 2006-01-30  Raja R Harinath  <rharinath@novell.com>
10067         Fix #77401
10068         * cs-parser.jay (VariableDeclaration): Don't set
10069         current_array_type to null.
10070         (field_declaration, event_declaration, declaration_statement):
10071         Set it to null here.
10073 2006-01-28  Raja R Harinath  <harinath@gmail.com>
10075         * typemanager.cs (GenericParameterPosition): New.
10076         * doc.cs: Use it.
10078 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
10080         * doc.cs : To process "include" elements, first we should create
10081           another list than XmlNodeList, because it could result in node
10082           removal, which could result in that the XmlNodeList gives up
10083           yielding next node.
10085           (Also made code identical to gmcs again.)
10087 2006-01-25  Miguel de Icaza  <miguel@novell.com>
10089         * ecore.cs: Introduce an error report that we were not catching
10090         before, if not silent, we must report the error.  Gonzalo ran into
10091         it.
10093 2006-01-23  Miguel de Icaza  <miguel@novell.com>
10095         A fix for bug: #76957
10096         
10097         * iterators.cs (MoveNextMethod.CreateMethodHost): call
10098         ComputeMethodHost before creating the method, this is a new
10099         requirement. 
10101         * anonymous.cs (AnonymousContainer): Now we track all the scopes
10102         that this method references (RegisterScope).  The actual scope
10103         where the method is hosted is computed with the ComputeMethodHost
10104         before we create the method.
10106         Moved the Deepest routine here.
10108         (AnonymousContainer.ComputeMethodHost): New routine used to
10109         compute the proper ScopeInfo that will host the anonymous method.
10111         (ScopeInfo): Deal with multiple roots.  The problem was that we
10112         did not have a unique root where all ScopeInfos could be hanged
10113         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
10114         of roots.  
10116         Remove AdjustMethodScope which is now computed at the end.  Remove
10117         LinkScope which did a partial link, instead link all ScopeInfos
10118         before code generation from the new "LinkScopes" routine. 
10120         Simplify all the Add* routines as they no longer need to maintain
10121         the tree, they just need to record that they are using variables
10122         from a ScopeInfo.
10124         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
10125         routines to produce the forest of ScopeInfo trees.
10127         * class.cs (TypeContainer.AppendMethod): This is just like
10128         AddMethod, but ensures that an interface implementation method
10129         (IEnumerable.XXX) is not inserted at the beginning of the queue of
10130         methods, but at the end.
10132         We use this functionality to ensure that the generated MoveNext
10133         method in the iterator class is resolved/emitted before the
10134         enumerator methods created.   
10136         This is required because the MoveNext method computes the right
10137         ScopeInfo for the method.  And the other methods will eventually
10138         need to resolve and fetch information computed from the anonymous
10139         method. 
10141 2006-01-21  Raja R Harinath  <harinath@gmail.com>
10142             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
10144         Fix rest of #76995.
10145         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
10146         the 'aliases' hash.
10147         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
10148         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
10150 2006-01-18  Raja R Harinath  <rharinath@novell.com>
10152         Fix #76656, cs0231-2.cs.
10153         * cs-parser.jay (formal_parameter_list): Make error case catch
10154         more issues.
10155         (parenthesized_expression_0): Add CS1026 check.
10156         (invocation_expression): Remove unused { $$ = lexer.Location }.
10158 2006-01-17  Raja R Harinath  <rharinath@novell.com>
10160         Fix #76824.
10161         * cs-parser.jay (statement_expression): Don't list out the
10162         individual statement-expressions.  Convert syntax error into
10163         CS0201 check.
10165 2006-01-16  Raja R Harinath  <rharinath@novell.com>
10167         Fix #76874.
10168         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
10169         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
10170         CheckIntermediateModification.
10171         (FieldExpr.DoResolve): Add new two-argument version that
10172         allows us to resolve the InstanceExpression as an lvalue.
10173         The one-argument variant is now just a wrapper.
10174         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
10175         Resolve the lhs as an lvalue if the it has a value type.
10176         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
10177         from Assign.DoResolve.
10178         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
10179         resolved as an lvalue.
10180         (PropertyExpr.DoResolve): Update.
10181         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
10182         has a value type.  Move CS1612 check here from
10183         CheckIntermediateModification.
10184         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
10185         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
10186         'right_side' of a ResolveLValue on an 'out' argument.
10187         (EmptyExpression.LValueMemberAccess): New.  Used as the
10188         'right_side' of a propagated ResolveLValue on a value type.
10189         (LocalVariableReference.DoResolveBase): Recognize
10190         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
10191         Add CS1654 check.
10192         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
10193         EmptyExpression.Null.
10195 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
10197         * typemanager.cs : added IsGenericParameter(). In mcs it always
10198           return false.
10199         * doc.cs : for generic parameters, use GenericParameterPosition,
10200           not FullName.
10202 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
10204         * expression.cs: Fix Console.WriteLine ((this = x).foo);
10206 2006-01-12  Miguel de Icaza  <miguel@novell.com>
10208         This fixes the problem where we used ldfld instead of ldflda to
10209         load the "THIS" pointer on captured parameters, when THIS is a
10210         value type.  See bug #77205.
10211         
10212         * iterators.cs (CapturedThisReference.Emit): Pass false to
10213         EmitThis (we do not need the address).
10215         * codegen.cs (EmitThis): it needs to know whether we need the
10216         address of `this' or not.  This is used by value types.  
10218         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
10219         every other call passes false.
10221 2006-01-12  Raja R Harinath  <rharinath@novell.com>
10223         Fix #77221.
10224         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
10225         GetOverride.
10226         * expression.cs (Invocation.OverloadResolve): Update.
10227         (Invocation.DoResolve): Avoid double resolution of invocation.
10229 2006-01-11  Raja R Harinath  <rharinath@novell.com>
10231         Fix #77180.
10232         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10233         unary negation of floating point types as 0-expr; negation cannot
10234         overflow in floating point types.
10236         Fix #77204.
10237         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10238         on operands of 'void' type.
10240         Fix #77200.
10241         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10242         and ExclusiveOr for boolean constants too.
10244 2006-01-09  Raja R Harinath  <rharinath@novell.com>
10246         Fix #75636.
10247         * expression.cs (Invocation.OverloadResolve): Replace reflected
10248         override methods with their base virtual methods, rather than
10249         skipping over them.
10250         * typemanager.cs (TypeManager.GetOverride): New.
10252 2006-01-05  Jb Evain  <jbevain@gmail.com>
10254         * class.cs (Property.Define, Indexer.Define): do not tag the
10255         properties as SpecialName | RTSpecialName.
10257 2006-01-04  Miguel de Icaza  <miguel@novell.com>
10259         * class.cs (MethodCore.IsDuplicateImplementation): This method was
10260         doing a low-level comparission of parameter types.  It was lacking
10261         a check for __argslist. 
10263 2005-12-30  Miguel de Icaza  <miguel@novell.com>
10265         * expression.cs (ParameterReference.DoResolveBase): Allow
10266         reference parameters if they are local to this block. 
10268         This allows the ref and out parameters of a delegate to be used in
10269         an anonymous method, for example:
10271         delegate void set (out int x);
10273         set s = delegate (out int x){
10274                 x = 0;
10275         };
10277         This is used by functionality introduced late in the C# language.
10278         
10279         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10280         method that take ref and out parameters. 
10282         Fixes #77119 which was a late change in the spec.
10284 2005-12-23  Miguel de Icaza  <miguel@novell.com>
10286         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10287         parent if its the same scope.  Fixes #77060.
10289 2005-12-21  Miguel de Icaza  <miguel@novell.com>
10291         * driver.cs: Report the case of no source files and no -out:
10292         argument provided.
10294 2005-12-20  Raja R Harinath  <rharinath@novell.com>
10296         Fix #77035.
10297         * expression.cs (ComposedCast.GetSignatureForError): Define.
10299 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10301         Fix #76995
10303         * namespace.cs (NamespaceEntry): Add extern_aliases as a
10304         ListDictionary, to contain the ExternAliasEntry entries (in
10305         addition to the NamespaceEntry.aliases hashtable). This field is
10306         shared between the original entry and its doppelganger (bodyless 
10307         copy of it).
10308         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10309         extern_aliases field.
10310         (NamespaceEntry.Lookup): Move the IsImplicit check after the
10311         lookup in extern_aliases.
10313 2005-12-16  Raja R Harinath  <rharinath@novell.com>
10315         Fix #77006.
10316         * class.cs (TypeContainer.Mark_HasEquals): New.
10317         (TypeContainer.Mark_HasGetHashCode): New.
10318         (ClassPart): Override them.
10319         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10321         Fix #77008.
10322         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10323         'parent' argument to the base constructor.
10325         Remove all mention of TypeContainer from decl.cs.
10326         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10327         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10328         (DeclSpace.DeclSpace): Likewise.
10329         (DeclSpace.DefineMembers): Remove unused argument.
10330         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
10331         debugging check -- we don't care if the debug code throws an
10332         InvalidCastException instead of an InternalErrorException.
10333         * class.cs (TypeContainer.DefineMembers): Update to changes.
10334         (TypeContainer.DoDefineMembers): Likewise.
10335         (TypeContainer.GetMethods): Likewise.
10336         (PropertyMember.Define): Likewise.
10337         (MemberBase.Parent): New property that forwards to
10338         MemberCore.Parent, but ensures that we get a TypeContainer.
10339         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10340         (RootContext.PopulateTypes): Likewise.  Remove special case code
10341         for !RootContext.StdLib: DefineMembers is idempotent.
10343 2005-12-14  Miguel de Icaza  <miguel@novell.com>
10345         * convert.cs (ExplicitConversionCore): Check the return value from
10346         ExplicitConversionCore which can return null on failure.  Fixes #76914
10348 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
10350         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10352 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
10354         * doc.cs : The search for referenced namespace was insufficient to
10355           get global one as it used to do. Fixed bug #76965.
10357 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
10359         * doc.cs : check name in cref in the last phase that whether it is
10360           namespace or not.
10362 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10364         * cs-tokenizer.cs : reverted the latest change: it somehow broke
10365           Mono.C5.
10367 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10369         * doc.cs : so it turned out that we cannot skip override check for 
10370           interface members. Fixed bug #76954.
10372 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10374         * cs-tokenizer.cs : fixed bug #75984:
10375           - #warning and #error should not be handled when the source line
10376             is disabled.
10377           - #line is not checked strictly when the source line is disabled.
10378           - #define and #undef is on the other hand checked strictly at any
10379             state.
10381 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
10383         * cs-tokenizer.cs : missing Location (actually, filename) in one of
10384           CS1027 report.
10386 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10388         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10390         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10391         event initializers.
10392         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10393         (FieldBase.Initializer): Initializer is now optional.
10394         (EventField.Define): Only event field can have initializer.
10396         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10398         * const.cs (Const): Reuse initializer.
10400         * cs-parser.jay: Updated after FieldBase changes.
10401         Added current_array_type to simplify array initializers.
10403         * ecore.cs (NullCast.IsDefaultValue): Implemented.
10405         * expression.cs, iterators.cs: Updated.
10407         * namespace.cs (NamespaceEntry): Made UsingFound private.
10409 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10411         * parameterCollection.cs: Obsolete, removed.
10412         * parser.cs: Obsolete, removed.
10414 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10416         Fix #76849.
10417         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10419         * enum.cs (Enum.Define): Set obsolete context here.
10421 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10423         * doc.cs :
10424           - FindDocumentedMember() now expects 1) paramList as null
10425             when "we don't have to check the number of parameters" and
10426             2) Type.EmptyTypes when "there is no arguments".
10427           - Introduced FoundMember struct to hold the exact type which was
10428             used to find the documented member (the above change broke
10429             test-xml-044; it might be better just to use DeclaringType than
10430             what MS does, like this change does, but it depends on usage.)
10432 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10434         * doc.cs : documented member might be from DeclaringType for nested
10435           types. Fixed bug #76782.
10437 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
10439         * anonymous.cs: Have the param code handle leaving copies on the
10440         stack etc. Allows anonymous params to take part in the assignment
10441         code (++, +=, etc). Fixes bug #76550
10443         * expression.cs: Handle the prepare_for_load/leave_copy by passing
10444         it down to the anon code.
10446         * iterators.cs: Use dummy var here
10448         * codegen.cs: Handle new vars
10450 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10452         Fix #76849.
10453         * class.cs (MethodData.Define): Set proper Obsolete context.
10455         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10456         obsolete context.
10457         (FieldExpr.DoResolve): Ditto.
10459 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10461         Fix #76849.
10462         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10463         parent is not obsolete.
10465 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
10467         * doc.cs : (FindDocumentedMember) find parameterless members first
10468           and get CS0419 in the early stage. Fixed first case of bug #76727.
10470 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
10472         Fix #76859.
10473         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10474         no error was reported.
10476         *expression.cs (Binary.DoResolve): left can be null.
10478 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
10480         Fix #76783.
10481         * class.cs (MethodData.Emit): Parameters should be labeled first.
10483 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
10485         Fix #76761.
10486         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10488 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
10490         * attribute.cs (AreParametersCompliant): Moved to Parameter.
10492         * class.cs (MethodCore): Parameter clean up.
10493         (IMethodData): Added ParameterInfo.
10494         (MethodData): Parameter clean up.
10495         (Indexer.Define): Parameter clean up.
10497         * anonymous.cs,
10498         * codegen.cs,
10499         * cs-parser.jay,
10500         * decl.cs,
10501         * doc.cs,
10502         * ecore.cs,
10503         * flowanalysis.cs,
10504         * iterators.cs,
10505         * pending.cs,
10506         * statement.cs,
10507         * typemanager.cs: Parameter clean up.
10509         * delegate.cs (Define): Get rid of duplicated code.
10511         * expression.cs (ParameterReference): Removed useless parameters
10512         and simplified.
10513         (Invocation): Ditto.
10515         * parameter.cs (ParamsParameter): New class, params specialization.
10516         (ArglistParameter): Attemp to separate arglist.
10517         (Parameter): Refactored to be reusable and faster.
10518         (Parameter.Modifier): Made understandable.
10519         (Parameters): Changed to be used as a class for `this' assembly
10520         parameters. Refactored to use new specialized classes.
10522         * support.cs (ParameterData): Added Types property.
10523         (InternalParameters): Deleted.
10525 2005-08-20  Martin Baulig  <martin@ximian.com>
10527         Merging this patch from GMCS to fix #75867.
10529         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10530         scope if we don't already have it.
10532 2005-11-17  Martin Baulig  <martin@ximian.com>
10534         * anonymous.cs
10535         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10536         inherit the scope from our parent.  Fixes #76653.
10538 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10540         * doc.cs : the previous patch does not actually fix the bug.
10541           PropertyInfo override check is now implemented and really fixed it.
10542         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10544 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10546         * doc.cs : apply "override filter" also to properties.
10547           Fixed bug #76730.
10549 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10551         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10552           no need to check overrides. For classes, omit those results from 
10553           interfaces since they must exist in the class. Fixed bug #76726.
10555 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10557         * typemanager.cs : (GetFullNameSignature) differentiate indexers
10558           with different parameters. Fixed the second problem in #76685.
10560 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10562         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10563           get expected 'protected' access in CheckValidFamilyAccess()).
10564           Fixed bug #76692.
10566 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10568         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10569           Fixed bug #76705.  CS1569 was incorrectly commented out.
10571 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10573         * doc.cs : use Invocation.IsOverride() to do real override check.
10574         * expression.cs : made Invocation.IsOverride() internal.
10576 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10578         * doc.cs : use TypeManager.FindMembers() instead of (possible)
10579           TypeBuilder.FindMembers() and filter overriden base members out.
10580           Fixed bug #76990.
10582 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10584         * doc.cs : ref/out parameters are represented as '@' (instead of
10585           '&' in type FullName). Fixed bug #76630 (additionally crefs).
10587 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10589         * doc.cs : when there was no '.' in cref to methods in doc comment,
10590           then parameters were missing in the output. Fixed bug #76691.
10592 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10594         * driver.cs : don't output docs when there is an error.
10595           Fixed bug #76693.
10597 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10599         * doc.cs :
10600           Now it should detect indexers. Fixed primary concern in bug #76685.
10601           Fixed CS0419 message to not show the identical member signature in
10602           the message.
10604 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10606         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10607           instead of Type.FindMembers() since it does not handle events.
10608           Fixed bug #71604.
10610 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
10612         * codegen.cs: Fixed typo (speficied -> specified).
10614 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10616         Fix #76369.
10617         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10619 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10621         * attribute.cs: Changed error message.
10623         * cs-tokenizer.cs: One more check.
10625 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10627         * statement.cs (Block.Resolve): Ignore empty statement.
10629 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10631         * report.cs: Made error/warning methods more strict to avoid
10632         their misuse.
10634         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10635         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10636         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10637         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10639 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
10641         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10642         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10644         * class.cs (TypeContainer.IsComImport): New property.
10645         (Constructor.Define): Create proper ctor for ComImport types.
10647         * expression.cs (New.CheckComImport): Fixed.
10649 2005-11-07  Miguel de Icaza  <miguel@novell.com>
10651         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10652         that a parameter has been captured does not mean that we do not
10653         have to do the rest of the processing.  This fixes the second part
10654         of #76592.  If there was another anonymous method capturing
10655         values in the past, the Scope would never be set for the second
10656         method that captured the same parameter.
10658         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10659         properly manipulate the stack.   Second part of fix for #76592.
10661         * expression.cs (New): Add support for invoking "new" on
10662         interfaces that have been flagged with the ComImport attribute and
10663         the CoClass.  Fixes #76637 
10665         * statement.cs (Try.DoEmit): When a variable is captured, do not
10666         try to emit the vi.LocalBuilder variable as it has been captured.
10667         Create a temporary variable and store the results on the
10668         FieldBuilder.  Fixes #76642
10670 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
10672         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10674         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10676         * expression.cs (Binary.DoResolve): Added && optimalization.
10677     
10678         * typemanager.cs (AddUserType): Removed useless argument.
10680 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
10682         * statement.cs (Block.variables): Uses ListDictionary.
10684 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10686         Fix #75969.
10687         * class.cs (PartialContainer.EmitType): Customized to emit
10688         security attributes.
10689         (ClassPart.ApplyAttributeBuilder): Transform security attribute
10690         for partial classes.
10692 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10694         Fix #76599.
10695         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10696         access has to be fixed.
10697         
10698         * typemanager.cs (IsUnmanagedType): Wrong common field type.
10700 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
10702         Fix #76590.
10703         * ecore.cs (NullCast.Reduce): Implemented.
10705         * expression.cs (ArrayCreation.CheckIndices): Correcly check
10706         constant type.
10707         
10708         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10709         properly.
10710         (Foreach.Resolve): Catch null properly.
10712 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10714         * cs-tokenizer.cs: Warning text fix.
10716         * driver.cs: AllWarningNumbers exposed on public interface.
10718         * report.cs (): Reviewed warning numbers.
10719         (IsValidWarning): Use binary search.
10721 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10723         * driver.cs: Implemeted resource visibility.
10724         (Resources): New class for code sharing between /res: and
10725         /linkres:
10727 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
10729         Fix #76568.
10730         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10731         folding.
10732         
10733         * convert (Convert.ImplicitReferenceConversion): NullCast holds
10734         contants only.
10735         
10736         * ecore.cs (NullCast): Child is contant only.
10737         
10738         * literal.cs (NullLiteral.Reduce): null can be converted to any
10739         reference type.
10741 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
10743         * driver.cs: Use Encoding.Default as default code page instead
10744           of ISO-28591.
10746 2005-10-27  Raja R Harinath  <rharinath@novell.com>
10748         Fix #76085.
10749         * expression.cs (Invocation.Error_InvalidArguments): Handle
10750         __arglist parameters.
10751         (Invocation.VerifyArgumentsCompat): Likewise.
10752         * support.cs (ReflectionParameters.GetSignatureForError): Print
10753         __arglist parameters.
10754         (InternalParamters.GetSignatureForError): Likewise.
10755         * parameter.cs (Parameters.GetSignatureForError): Likewise.
10757 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
10759         * attribute.cs (GetPropertyValue): Made public.
10761         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10762         Resolve.
10763         Add new property WrapNonExceptionThrows to handle 2.0 assembly
10764         attribute.
10765         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10766         is not defined.
10767         
10768         * driver.cs: Reflect method name change.
10769         
10770         * statement.cs (Try.Resolve): Warn when try has both general
10771         exception handlers.
10772         
10773         * typemanager.cs: runtime_compatibility_attr_type new predefined
10774         type.
10776 2005-10-26  Raja R Harinath  <harinath@gmail.com>
10778         Fix #76419.
10779         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10780         treat it as an empty parameter list.
10782 2005-10-26  Raja R Harinath  <rharinath@novell.com>
10784         Fix #76271.     
10785         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
10786         ResolveAsTypeStep silent.
10787         * statement.cs (Block.AddConstant): Mark block as used.
10788         (Block.ResolveMeta): Avoid piling on error messages
10789         if a constant initializer resolution fails.
10791 2005-10-25  Raja R Harinath  <rharinath@novell.com>
10793         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10794         Remove.
10795         (NamespaceEntry.VerifyAllUsing): New.
10796         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
10797         behaviour.  Delegates actual resolution of alias to ...
10798         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
10799         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10800         Update.
10801         * driver.cs (Driver.MainDriver): Update.
10802         
10803         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10804         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10805         property.
10806         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10807         Remove.
10808         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10809         RootNamespace.DefineNamespacesForAll.
10811 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10813         * typemanager.cs (assemblies, external_aliases, modules)
10814         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10815         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10816         overhead.  Move resposibility ...
10817         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10818         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10820 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10822         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10823         cached_namespaces.  Improve usage.
10824         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10825         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10826         Move from GlobalRootNamespace and simplify.
10827         (RootNamespace.Global): Make instance variable.
10828         (RootNamespace.RootNamespace): Add "alias name" parameter.
10829         (GlobalRootNamespace): Simplify drastically.
10830         (Namespace.Lookup): Don't use GetNamespace.
10831         * typemanager.cs (GetRootNamespace): Rename from
10832         ComputeNamespaceForAlias.
10833         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10835 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10837         * anonymous.cs (AnonymousContainer): Don't crash when container
10838         doesn't exist.
10840 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10842         * expression.cs (Binary.DoResolve): Warn when comparing same
10843         values.
10845 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10847         Fix #76486.
10848         * expression.cs (Binary.DoResolve): It looks like there are no
10849         convetsion rules in enum context.
10851 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10853         Add support for extern alias qualifiers.
10854         * typemanager.cs: Move some LookupTypeReflection code
10855         to namespace.cs, to have cleaner code. Added some methods
10856         to help us keep track of the extern aliased references.
10857         * driver.cs: Add suport for extern alias assemblies on command
10858         line and check for their warnings/errors. Also keep track of the
10859         extern aliased assemblies.
10860         * namespace.cs: Move the global functionality of Namespace
10861         to GlobalRootNamespace/RootNamespace. Now the global namespace
10862         is GlobalRootNamespace.Globa. Also the code moved from 
10863         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10864         Finally added LocalAliasEntry (AliasEntry before) and
10865         ExternAliasEntry, to handle alias statements.
10866         * cs-parser.jay: Add support in the grammar for extern alias
10867         statement.
10868         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10869         Update callings to Namespace (now in GlobalRootNamespace).
10871 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10873         Fix #76371.
10874         * class.cs (TypeContainer.DefineType): Move updating of
10875         topological sort earlier in the code.
10876         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10878 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10880         Fix #76273.
10881         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10882         
10883         * constant.cs (Constant.TryReduce): Moved from Cast class.
10884         (Reduce): Made little bit more OO and fixed missing conversions.
10885         
10886         * ecore.cs (Reduce): Implemented.
10887         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10888         
10889         * literal.cs (Reduce): Implemented.
10890         
10891         * class.cs: Reverted Miguel's wrong commit.
10893 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10895         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10897 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10899         * cs-parser.jay, expression.cs : CS0214 was missing error location
10900           for constants. Fixed bug #76404.
10902 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10904         Fix #76370.
10905         * convert.cs (ExplicitConversionCore): Fixed object->enum
10906         conversion.
10908 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10910         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10911         InstanceExpression.
10912         (PropertyExpr.EmitCall): Likewise.
10913         * expression.cs (Invocation.EmitArguments): Handle case where
10914         arguments == null.
10915         (Invocation.EmitCall): Avoid allocating temporary variable if
10916         there are no arguments.
10918 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10920         Fix #76323.
10921         * convert.cs (ImplicitConversionStandard): Move conversion of
10922         void* to arbitrary pointer types ...
10923         (ExplicitConversionStandard): .. here.
10924         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10925         error to always print typenames.
10927 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10929         * convert.cs (GetConversionOperator): Rename from
10930         GetConversionOperators.  Move operator selection code from ...
10931         (UserDefinedConversion): ... here.
10933 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10935         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10936         conversion.
10938 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10940         * assign.cs (Assign.DoResolve): Error method changed.
10942         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10943         
10944         * const.cs (ResolveValue): Reset in_transit immediately.
10945         
10946         * constant.cs: Error method changed.
10947         
10948         * convert.cs: Removed useless location parameter.
10949         (ExplicitNumericConversion): Don't do double enum check.
10950         (ExplicitConversionCore): Renamed from ExplicitConversion.
10951         (ExplicitUnsafe): Extracted from ExplicitConversion.
10952         (ExplicitConversion): Uses for error reporting.
10953         
10954         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10955         error messages.
10956         (ResolveBoolean): Uses common error method.
10957         (CastToDecimal): Get rid of ec.
10958         (CastFromDecimal): Optimized.
10959         (ConvCast): Get rid of ec.
10960         
10961         * enum.cs (ResolveValue): Reset in_transit immediately.
10962         (Emit): Return after first error.
10963         
10964         * expression.cs: Convert changes.
10965         
10966         * literal.cs: Error method changed.
10967         
10968         * statement.cs: Error method changed.
10970 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10972         * support.cs (SeekableStreamReader.Position): Don't error out when
10973         the requested position is just beyond the end of the current
10974         buffered data.
10976 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10978         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10979         try to keep in sync with the byte count of the underlying Stream.
10980         However, this limits us to a window size of 2048 characters: i.e.,
10981         the maximum lookahead of our lexer/parser can be 2048 characters.
10983 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10985         Fix #76255.
10986         * driver.cs: Fix compilation files with full root path.
10988 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10990         * report.cs (SymbolRelatedToPreviousError): Format the output so
10991         it does not use an open parenthesis that is never closed. 
10993         * driver.cs: Follow coding guidelines
10995 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10997         Fix #72930.
10998         * const.cs (Const.ResolveValue): Check for assigning non-null
10999         value to reference type.
11001 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
11003         * anonymous.cs: Implemented ExprClassName.
11004         
11005         * assign.cs (Assign.DoResolve): Don't chrash when type is not
11006         delegate.
11007         
11008         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
11009         check.
11010         
11011         * class.cs (StaticClass.DefineContainerMembers): Report protected
11012         members as error.
11013         
11014         * codegen.cs: if(ed) PRODUCTION.
11015         
11016         * convert.cs (Error_CannotImplicitConversion): Better error
11017         distinction.
11018         
11019         * cs-parser.jay: More error checks.
11020         
11021         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
11022         
11023         * driver.cs (CSCParseOption): Enabled wrong option check.
11024         
11025         * ecore.cs (Expression.ExprClassName): Turned to property.
11026         (MemberExpr.CheckIntermediateModification): For checking boxed
11027         value types     modification.
11028         
11029         * statement.cs (Fixed.Resolve): Expression type must be
11030         convertible to fixed type.
11031         (CollectionForeach.GetEnumeratorFilter,TryType):
11032         Small refactoring for easier error checking.
11034 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
11036         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
11037         attributes.
11038         
11039         * class.cs (GeneratedBaseInitializer): New class for customization
11040         compiler generated initializers.
11041         (MemberBase.DoDefine): Check Obsolete attribute here.
11042         (FieldMember.DoDefine): Ditto.
11043         
11044         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
11045         constants.
11046         
11047         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
11048         (MemberCore.GetObsoleteAttribute): Removed argument.
11049         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
11050         (MemberCore.CheckObsoleteType): New helper.
11051         
11052         * delegate.cs,
11053         * enum.cs,
11054         * statement.cs: Updates after MemberCore changes.
11055         
11056         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
11057         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
11058         
11059         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
11060         obsolete attribute for compiler construct.
11061         (As.DoResolve): Cache result.
11062         
11063         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
11065 2005-09-26  Raja R Harinath  <rharinath@novell.com>
11067         Fix #76133.
11068         * expression.cs (This.VerifyFixed): In a value type T, the type of
11069         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
11070         value type R, 'this' is treated as a value parameter.
11072 2005-09-22  Miguel de Icaza  <miguel@novell.com>
11074         * statement.cs (Lock): Use the TemporaryVariable class instead of
11075         manually using local variables as those do not work when variables
11076         are captured.
11078         * ecore.cs: Moved the TemporaryVariable class from being a nested
11079         class inside Foreach to be a public class that can be employed in
11080         other places. 
11082 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
11084         * cs-parser.jay: interface_accessors replaced by
11085         accessor_declarations.
11087         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
11088         location.
11089         
11090         * statement.cs (GotoCase.Resolve): Convert null constant to
11091         null case.
11092         (SwitchLabel.ResolveAndReduce): Ditto.
11093         (SwitchLabel.NullStringCase): Custom null stamp.
11094         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
11095         
11096         typemanager.cs (CSharpSignature): Don't skip first argument
11097         for full names.
11099 2005-09-18  Miguel de Icaza  <miguel@novell.com>
11101         * driver.cs: Set InEmacs based on the environment variable EMACS. 
11103         * location.cs (InEmacs): in this mode, do not report column
11104         location as it confuses Emacs.
11106 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
11108         * cfold.cs, constant.cs, convert.cs, ecore.cs,
11109         expression.cs, iterators.cs, literal.cs: Store constants and
11110         literals location.
11111         
11112         * class.cs (MemberBase.ShortName): Pass location.
11113         
11114         * cs-parser.jay: Some location fixes.
11115         
11116         * ecore.cs (Expression.Location): Made virtual.
11118 2005-09-05  Miguel de Icaza  <miguel@novell.com>
11120         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
11121         if the underlying types are the same, otherwise we need to produce
11122         code that will do the proper cast.
11124         This was exposed by Marek's constant rewrite which produced
11125         invalid code for the call site:
11127         enum X : long { a }
11128         void Method (X v) {}
11130         Method ((X) 5)
11132         This fixes test-49.cs
11134 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
11136         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
11137           Type/Object should be allowed as well. Fixed bug #75968.
11139 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
11141         * expression.cs : (Binary.DoResolve): when one is enum constant and
11142           another is constant 0, then return enum one *as enum type*.
11143           Fixed bug 74846.
11145 2005-09-02  Raja R Harinath  <rharinath@novell.com>
11147         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
11148         internal.
11150         Fix #75941.
11151         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
11152         flow-branching for LocalVariableReferences in case we were invoked
11153         from a MemberAccess.
11154         * expression.cs (LocalVariableReference.VerifyAssigned): New.
11155         Carved out of ...
11156         (LocalVariableReference.DoResolveBase): ... this.
11157         (MemberAccess.Resolve): Do the check that was disabled during
11158         SimpleNameResolve.
11160 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
11162         * class.cs :
11163           (PartialContainer.Create): check abstract/sealed/static strictly
11164           but abstract/sealed can exist only at one side. Fixed bug #75883.
11166 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
11168         Fix #75945.
11169         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
11170         specified, don't default to UnmanagedType.I4.
11172 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
11174         * expression.cs : conditional operator should check possibly
11175           incorrect assign expression. Fixed bug #75946.
11177 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
11179         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
11180           Reverting the change. gmcs is much complex than mcs on this matter.
11182 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
11184         * cs-tokenizer.cs : To read another token ahead of the actual 
11185           consumption, use new SavedToken and cache token instead of moving
11186           back the stream with SeekableStreamReader (it seemed problematic).
11187         * cs-parser.jay,
11188           driver.cs : Thus use StreamReader directly.
11189         * support.cs : Thus removed SeekableStreamReader.
11191 2005-08-30  Raja R Harinath  <rharinath@novell.com>
11193         Fix #75934.
11194         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
11195         (ScopeInfo.EmitScopeType): Use it to construct field names from
11196         names of captured locals.
11198         Fix #75929.
11199         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
11200         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11201         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
11202         (ExplicitConversion): Remove enum cases already handled by
11203         implicit conversion.  Move implicit conversion check to the beginning.
11204         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
11205         * expression.cs (ArrayCreation.EmitDynamicInitializers):
11206         Don't treat System.Enum as a struct.
11208 2005-08-30  Jb Evain  <jbevain@gmail.com>
11210         * attribute.cs: handles as expression in parameters.
11212 2005-08-30  Raja R Harinath  <rharinath@novell.com>
11214         Fix #75802.
11215         * class.cs (TypeContainer.VerifyClsName): Don't use a
11216         PartialContainer when verifying CLS compliance.
11217         (AbstractPropertyEventMethod): Set Parent here, ...
11218         (PropertyMethod): ... not here.
11220 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
11222         * attribute.cs : escaped attribute name should not be allowed to be
11223           resolved (e.g. @class as classAttribute). Fixed bug #75930.
11225 2005-08-29  Raja R Harinath  <rharinath@novell.com>
11227         Fix #75927.
11228         * convert.cs (ImplicitStandardConversionExists): Allow zero also
11229         when converting a long constant to unsigned long.
11230         * expression.cs (Invocation.OverloadResolve): Add sanity check to
11231         detect where IsApplicable and VerifyArgumentsCompat disagree.
11233 2005-08-29  Raja R Harinath  <rharinath@novell.com>
11234         and Carlos Alberto Cortez  <carlos@unixmexico.org>
11236         Fix #75848.
11237         * class.cs (TypeContainer.CanElideInitializer): New helper.
11238         (TypeContainer.EmitFieldInitializers): Use it to determine if we
11239         can safely emitting the initializer of a field.
11241 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11243         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11244           allowed inside a switch (without loop). Fixed bug #75433.
11246 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
11248         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11249         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11251 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11253         * driver.cs : kinda reverting the default encoding changes (not exact 
11254           revert since I noticed that "codepage:reset" might not work fine).
11256 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11258         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11259           Location. Now getter and setter store location correctly.
11260           (errors/cs0111-12.cs now reports the expected location.)
11262 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11264         * driver.cs : Use default encoding on the environment.
11265           Removed (now that) extra parameter for SeekableStreamReader.
11266         * support.cs : (SeekableStreamReader) third .ctor() argument for
11267           StreamReader is not required (always true). preamble size could
11268           be acquired in simpler and safe way.
11270 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
11272         * cs-parser.jay: report CS0642 at warning level 3
11273           and report CS0642 for an if else statement also
11274           fixes bug #74745. Patch by John Luke (and a bit
11275           modified by me).
11276           Removed extra CS0642 warning check for "while",
11277           "for" and "fixed".
11278         * statement.cs: In Block.Resolve(), CS0642 check
11279           is reimplemented to check a sequence of an empty
11280           statement and a block.
11282           Both fix bug #66777.
11284 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
11286         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11287         detection until I fix it.
11288         
11289         * cs-tokenizer.cs: Changed error message.
11290         
11291         * cs-parser.jay: Fixed 2 error locations.
11292         
11293         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11294         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11295         properties.
11296         
11297         * enum.cs (GetSignatureForError): Fixed.
11298         
11299         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11300         method detection.
11301         
11302         * class.cs,
11303         * typemanager.cs (RegisterProperty): Removed.
11304         
11305         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11307 2005-08-24  Raja R Harinath  <rharinath@novell.com>
11309         Fix #75874.
11310         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11311         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11313 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11315         * expression.cs : tiny fix is required for not warning positive ulong.
11316           See test-441.cs.
11318 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11320         * expression.cs : add CS0652 check for constant and integral
11321           expression. Fixed bug #53974.
11323 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11325         * expression.cs : in DoNumericPromotions(), check if there is implicit
11326           conversion overload for string (to check CS0034). Fixed bug #52492.
11328 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11330         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11332 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11334         * ecore.cs : report location when it is *not* Null.
11336 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11338         * codegen.cs,
11339           ecore.cs,
11340           flowanalysis.cs,
11341           expression.cs:
11342           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11343           correctly. Fixed bug #75721.
11345 2005-08-23  Raja R Harinath  <rharinath@novell.com>
11347         * support.cs (SeekableStreamReader.Position): Avoid an expensive
11348         loop that performs 'min (pos, char_count)'.
11350         Fix #75862.
11351         * expression.cs (Unary.ResolveOperator): Don't discard implicit
11352         converted value in Operator.OnesComplement.
11354 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
11356         * anonymous.cs: If the anon method is pulled into a helper class,
11357         it needs to be `internal' not `private'. Fixes runtime behavior on
11358         msft. bug #75704
11360 2005-08-20  Martin Baulig  <martin@ximian.com>
11362         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11363         scope if we don't already have it.
11365         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11366         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11367         fixes #75867.
11369 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
11371         Fix #75803
11372         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11373         is a partial class.
11375 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
11377         The big constants rewrite
11378         Fix #75746, #75685 and more
11379         As a side effect saved 1MB for MWF ;-)
11380         
11381         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11382         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11383         enum based for corlib compilation.
11384         
11385         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11386         subtractions.
11387         
11388         * class.cs (FixedField.Define): Use ResolveAsConstant.
11389         
11390         * const.cs (IConstant): Interface constants and enums.
11391         (Const.ResolveValue): New method for constant resolvning.
11392         (ExternalConstant): Constants from imported assemblies.
11393         
11394         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11395         conversion; like enums.
11396         (Constant.ToType): Converts this constant to different type.
11397         (Constant.Increment): Adds 1.
11398         
11399         * convert.cs (ImplicitConversionRequired): Simplified.
11400         
11401         * cs-parser.jay: Create EnumMember directly.
11402         
11403         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11404         
11405         * doc.cs (GenerateEnumDocComment): Removed.
11406         
11407         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11408         (ConvertIntLiteral): Removed.
11409         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11410         
11411         * enum.cs (EnumMember): Implement IConstant.
11412         (Enum.IsValidEnumConstant): Removed.
11413         (Enum.GetNextDefaultValue): Removed.
11414         (Enum.FindMembers): Updated.
11415         (Enum.GenerateDocComment): Iterate enum members.
11416         
11417         * expression.cs (Cast.TryReduce): Handle enums correctly.
11418         (New.Constantify): Made public.
11419         (MemberAccess.DoResolve): Removed contant specific if(s).
11420         
11421         * literal.cs (NullLiteral): Implement new abstract methods.
11422         
11423         * statement.cs (GotoCase.Resolve): Use new constant methods.
11424         (SwitchLabel.ResolveAndReduce): Use new constant methods.
11425         
11426         * typemanager.cs (LookupEnum): Removed.
11427         (IsEnumType): Fixed to work with corlib.
11428         (RegisterConstant): Removed.
11429         (LookupConstant): Removed.
11430         (GetConstant): Changed to work with IConstant.
11432 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
11434         * location.cs : Fixed overflown (>255) column number.
11436 2005-08-03  Raja R Harinath  <rharinath@novell.com>
11438         First cut of the qualified-alias-member feature.
11439         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11440         token.
11441         * cs-parser.jay (DOUBLE_COLON): New token.
11442         (namespace_or_type_name): Add rule for recognizing
11443         qualified-alias-members.
11444         (primary_expression): Likewise.
11445         (element_access): Allow QualifiedAliasMember as a possible
11446         type-bearing expression.
11447         (local_variable_type, local_variable_pointer_type): Likewise.
11448         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
11449         aliases in the current and enclosing namespace declarations.
11450         (NamespaceEntry.UsingAlias): Add CS0440 warning.
11451         * decl.cs (MemberName.is_double_colon): New.
11452         (MemberName.MemberName): Add new constructor for alias-member.
11453         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11454         * expression.cs (QualifiedAliasMember): New expression type.
11456 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11458         * location.cs : it borked when no argument was specified.
11460 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11462         * location.cs : tiny ToString() format fix.
11464 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11466         * statement.cs : oops, it was missing.
11468 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11470         A set of fixes for precise line/column location.
11472         * location.cs :
11473           "token" field now holds a file/line "delta", a line number offset 
11474           from the segment, and a column number. See also:
11475           http://lists.ximian.com/pipermail/mono-devel-list/2004-
11476           December/009508.html
11477           Removed static IsNull. Use instance IsNull property instead.
11478         * cs-tokenizer.cs :
11479           For some tokens it stores Location. For Identifier it stores
11480           LocatedToken which is a pair of string name and location.
11481           Column numbers are adjusted only at getChar().
11482         * report.cs :
11483           Use Location.ToString() for reporting (it now contains column).
11484         * cs-parser.jay :
11485           Largely modified to use LocatedToken instead of
11486           string (IDENTIFIER), and to acquire Location from some tokens.
11487         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11488           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11489           codegen.cs :
11490           Now MemberName holds Location. DeclSpace.ctor() receives Location
11491           as a parameter. Removed extra parameters to all derived classes.
11492           Replaced Location.IsNull() with instance property.
11493         * assign.cs, expression.cs :
11494           Added .ctor() overload that omits Location.
11495         * attribute.cs :
11496           Added "nameEscaped" flag that indicates the identifier was escaped
11497           in the source file. This fixes bug #57047.
11499 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
11501         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11502         New method, looking for lo-case imported cls type.
11504         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11505         here.
11507         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11509         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11511         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11512         all_imported_types.
11513         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11515         Optimized to save 3.5 MB for SWF compilation.
11517 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11519         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11520         (PartialContainer.Create): Moved logic AddToContainer.
11521         (PartialContainer.MarkForDuplicationCheck): Shares name.
11522         
11523         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11524         place.
11525         
11526         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11527         initialization.
11528         (Namespace.GetSignatureForError): New method.
11529         
11530         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11531         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11533 2005-08-01  Raja R Harinath  <rharinath@novell.com>
11535         Fix #75669.
11536         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11537         member lookup rather than qualifier_type, since qualifier_type can
11538         be null.
11540 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11542         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11543         enum member.
11545 2005-07-31  Miguel de Icaza  <miguel@novell.com>
11547         * statement.cs: Copy the local exception into the exception
11548         captured local.  Fixes 75674
11550 2005-07-31  Raja R Harinath  <harinath@gmail.com>
11552         Fix #75658.
11553         * expression.cs (Invocation.OverloadResolve): Don't report error
11554         CS1501 if error CS1502 has been reported.
11555         (New.DoResolve): Delegate CS1501 reporting to
11556         Invocation.OverloadResolve.
11558         Fix #75656.
11559         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11560         invariant-meaning-in-block property in an enclosing block if
11561         necessary.
11563 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
11565         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11566         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11567         (Switch.CheckSwitch): Just save 50kb for SWF.
11569 2005-07-27  Martin Baulig  <martin@ximian.com>
11571         * anonymous.cs (CaptureContext.AddField): Added
11572         `AnonymousContainer am' argument; compute its toplevel scope if
11573         it's not already computed.  Fixes #75649.
11575 2005-07-26  Raja R Harinath  <rharinath@novell.com>
11577         Fix #75628.
11578         * class.cs (Constructor.Emit): Reset block to null if the block
11579         resolve fails.
11581 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11583         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11585 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11587         * class.cs (MethodData.Define): Check whether accessor implementing
11588         interface is public.
11590         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11592 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
11594         Fix #57245
11595         * namespace.cs (LookupType): Moved same type check to...
11596         
11597         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11598         with the same name.
11600 2005-07-21  Raja R Harinath  <rharinath@novell.com>
11602         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11603         already found a typebuilder.
11604         * class.cs (MethodCore.IsDuplicateImplementation): Compare
11605         MemberNames, not strings.
11607         * const.cs (Error_ExpressionMustBeConst): 
11608         Rename from Error_EpressionMustBeConst.
11609         * const.cs, class.cs, statement.cd: Update.
11611 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
11613         Fix #65573
11615         * const.cs (Const.LookupConstantValue): Report missing contant expression
11616         everytime.
11617         (Error_EpressionMustBeConstant): Only one error method.
11619         * class.cs, statement.c: Updated.
11621 2005-07-20  Raja R Harinath  <rharinath@novell.com>
11623         * statement.cs (Block.Flags): Add back HasVarargs.
11624         (Block.flags): Make protected.
11625         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11627         * typemanager.cs (types, typecontainers, user_types): Remove.
11628         (UserTypes, TypeContainers): Likewise.
11629         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11630         (CleanUp, Reset): Update.
11631         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
11632         (GetNestedType): Use Type.GetNestedType.
11633         (CoreLookupType): Take two arguments, the namespace and the
11634         basename of the type.  Update to use the Namespace.Lookup
11635         mechanism.
11636         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11637         (RealMemberLookup): Use IsNestedChildOf instead of playing with
11638         string concatenation and substring matches.
11639         * class.cs, enum.cs, delegate.cs: Update to changes.
11641 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
11643         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11644         Expression and made virtual.
11646         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11647         (ImplicitStandardConversionExists): Fixed `byte' typo ?
11649         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11651         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11652         error message.
11654         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11655         change.
11657 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
11659         Fix #57707
11660         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11661         AssemblyCultureAttribute is not used on executable.
11663         * rootcontext.cs,
11664         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11666 2005-07-16  Raja R Harinath  <rharinath@novell.com>
11668         Fix #60638.
11669         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11670         New.  Reports CS0252/CS0253.
11671         Mostly taken from preliminary patch by Duncak Mak.
11672         (Binary.DoResolveOperator): Store results of operator lookup.
11673         Use them to detect if we need to warn about unintended reference
11674         comparisons.
11676 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11678         Fix #72969.
11679         * namespace.cs (Namespace.Lookup): Add back location parameter.
11680         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
11681         * delegate.cs, ecore.cs, expression.cs: Update to changes.
11683         * codegen.cs (EmitContext.DeclSpace): Make readonly.
11684         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11685         (Namespace.LookupType): ... this.
11686         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11687         of namespaces.
11688         * typemanager.cs (LookupTypeReflection): Remove buggy code that
11689         purported to handle pointers.
11690         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11691         CoreLookupType.
11693 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
11695         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11696         type as namespace.
11698 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11700         * namespace.cs (Namespace.Lookup): Drop location parameter.
11701         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
11702         (NamespaceEntry.Lookup): ... this.
11703         (NamespaceEntry.Error_AmbiguousTypeReference):
11704         Move here from DeclSpace.
11705         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11706         names ...
11707         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11708         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11709         Move to NamespaceEntry.
11710         * delegate.cs, expression.cs: Update to changes.
11712 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
11714         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11715         CheckAttributeType and refactored.
11716         (Attribute.ResolvePossibleAttributeType): Changed to reuse
11717         ResolveAsTypeTerminal error handling.
11718         (ResolveAsTypeTerminal): Introduced because of global attributes extra
11719         handling.
11720         (GetSignatureForError): Print errors in same way.
11722         * class.cs,
11723         * codegen.cs: Reflect attribute GetSignatureForError change.
11725         * ecore.cs,
11726         * expression.cs: Add silent parameter to ResolveAsTypeStep.
11728         * namespace.cs (UsingEntry): Refactored to make fields private.
11730         * assign.cs,
11731         statement.cs: Error_UnexpectedKind has extra parameter.
11733 2005-07-14  Raja R Harinath  <rharinath@novell.com>
11735         * ecore.cs (IAlias): Remove.
11736         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
11737         that implement the interface.
11738         * namespace.cs (Namespace): Likewise.
11739         (Namespace.declspaces): Renamed from 'defined_names'.
11740         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
11741         DeclSpace instead of an IAlias.
11742         * tree.cs (Tree.AddDecl): Update.
11744 2005-07-12  Raja R Harinath  <rharinath@novell.com>
11746         * statement.cs (Block.Flags); Remove HasVarargs.
11747         (Block.HasVarargs): Move to ToplevelBlock.
11748         (Block.ThisVariable, Block.AddThisVariable): Likewise.
11749         (Block.Variables): Make protected.  Initialize variable hashtable
11750         if necessary.
11751         (Block.AddVariable): Update.
11752         (Block.Resolve): Update to changes.
11753         (ToplevelBlock.HasVarargs): New boolean.
11754         (ToplevelBlock.ThisVariable): Move here from Block.
11755         (ToplevelBlock.AddThisVariable): Likewise.
11756         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
11757         * expression.cs (This.ResolveBase): Update to changes.
11758         (ArglistAccess.DoResolve): Likewise.
11760 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11762         Fix #75321
11763         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11765         * class.cs (TypeContainer.VerifyMembers): Distinguish between
11766         not used and not used & assigned.
11767         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11769 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11771         Fix #75053
11772         * expression.cs (Is.DoResolve): null is never provided type.
11774 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
11776         Fix #52496
11777         * cs-parser.jay: Less strict event error rule to catch more errors.
11779 2005-07-08  Martin Baulig  <martin@ximian.com>
11781         Fix test-iter-10.cs - distinguish whether we `yield' in a property
11782         gettter (allowed) or setter (not allowed).
11784         * class.cs (Accessor): Implement IIteratorContainer.
11785         (Accessor.Yields): New public field.
11786         (PropertyBase.PropertyMethod.Define): Handle iterators on a
11787         per-accessor basis.
11789         * cs-parser.jay
11790         (get_accessor_declaration, set_accessor_declaration): Set the
11791         `yields' flag on the accessor, not the property.
11792         (property_declaration): Do the iterators check on a per-accessor
11793         basis and not for the whole property.
11795 2005-07-08  Martin Baulig  <martin@ximian.com>
11797         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11798         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11800 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
11802         Fix #74975
11803         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11804         (ExtractSecurityPermissionSet): Cope with self referencing security
11805         attributes properly.
11807         * driver.cs (SetOutputFile): Made public property OutputFile.
11809 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11811         Fix #75486.
11812         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11813         has_nonstatic_fields.  Make into a FieldBase pointer.
11814         (TypeContainer.AddField): Add CS0282 check.
11815         (TypeContainer.EmitType): Update.
11817 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11819         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11820         compare if they start with __.
11822 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11824         * statement.cs (Switch.SwitchGoverningType): Only look at
11825         UserCasts that don't need implicit standard conversions to one of
11826         the allowed switch types (Fixes test-322.cs).
11827         (LocalInfo.Resolve): Re-enable sanity-test.
11829 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11831         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11832         
11833         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11834         
11835         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11837 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11839         Fix #75472.
11840         * ecore.cs (SimpleName.GetSignatureForError): Add.
11841         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11842         (MemberAccess.GetSignatureForError): Add.
11844 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11846         The big error and warning messages review.
11847         
11848         * anonymous.cs,
11849         * assign.cs,
11850         * attribute.cs,
11851         * class.cs,
11852         * codegen.cs,
11853         * convert.cs,
11854         * cs-parser.jay,
11855         * cs-tokenizer.cs,
11856         * decl.cs,
11857         * delegate.cs,
11858         * doc.cs,
11859         * driver.cs,
11860         * ecore.cs,
11861         * enum.cs,
11862         * expression.cs,
11863         * flowanalysis.cs,
11864         * iterators.cs,
11865         * literal.cs,
11866         * location.cs,
11867         * modifiers.cs,
11868         * namespace.cs,
11869         * parameter.cs,
11870         * pending.cs,
11871         * report.cs,
11872         * rootcontext.cs,
11873         * statement.cs,
11874         * support.cs,
11875         * tree.cs,
11876         * typemanager.cs: Updated.
11877         
11878         * class.cs: (MethodCore.SetYields): Moved here to share.
11879         (PropertyMethod.Define): Moved iterator setup here.
11880         
11881         * iterators.cs: Add orig_method to have full access to parent
11882         container.
11884 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11886         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11887         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11888         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11889         variable of struct type.
11890         * expression.cs (Unary.ResolveOperator): Update to change.
11891         (Indirection.VerifyFixed): Likewise.
11892         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11893         (ParameterReference.VerifyFixed): Value parameters are fixed.
11894         (This.VerifyFixed): Treat 'this' as a value parameter.
11895         * statement.cs (LocalInfo.IsFixed): Remove.
11897 2005-07-01  Martin Baulig  <martin@ximian.com>
11899         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11900         `ec.EmitThis ()' to get the correct scope.
11902 2005-07-01  Martin Baulig  <martin@ximian.com>
11904         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11905         instance is a ParameterReference; fixes #75299.
11907 2005-07-01  Martin Baulig  <martin@ximian.com>
11909         Reverted Marek's latest patch (r46725):
11910         - it contains structural changes which are neither mentioned in
11911           the ChangeLog nor explained anywhere; for example the additional
11912           argument of EmitContext's and Iterator's .ctor's and the
11913           TypeContainer.DefineMembers() change.
11914         - structural changes like this should go in in seperate patches
11915           and not be hidden in a huge patch which just seems to affect
11916           warnings and errors.
11917           a big and hard to understand patch.
11918         - it breaks iterators and causes regressions, for instance in
11919           test-iter-03.cs.      
11921 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11923         Fix #75412.
11924         * expression.cs (Indexers.map): Remove.
11925         (Indexers.Append): Filter out inaccessible setters and getters.
11926         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11928         Fix #75283.
11929         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11930         Refactored from ...
11931         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11932         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11933         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11934         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11936 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11938         Fix #75322
11939         * class.cs (FieldBase.GetInitializerExpression): One more field
11940         for backup.
11942 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11944         * pending.cs: Do not define a proxy if the base method is virtual,
11945         it will be picked up by the runtime (bug 75270).
11947 2005-06-08  Martin Baulig  <martin@ximian.com>
11949         The big Iterators rewrite :-)
11951         * iterators.cs: Rewrite this to use the anonymous methods framework.
11953         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11954         before the TypeContainers; see 2test-21.cs.
11956         * class.cs
11957         (TypeContainer.DefineType): Don't create a new EmitContext if we
11958         already have one (this only happens if we're an Iterator).
11959         (TypeContainer.Define): Also call Define() on all our iterators.
11960         (Method.CreateEmitContext): Added support for iterators.
11962         * anonymous.cs
11963         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11964         (AnonymousContainer.CreateMethodHost): Moved here from
11965         AnonymousMethod and made abstract.
11966         (AnonymousContainer.CreateScopeType): New abstract method.
11967         (AnonymousContainer.IsIterator): New public property.
11968         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11969         get the ScopeTypeBuilder rather than manually defining it here. 
11970         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11971         iterators here.
11973         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11974         before RootContext.DefineTypes().
11976         * codegen.cs (EmitContext.RemapToProxy): Removed.
11977         (EmitContext.CurrentAnonymousMethod): Changed type from
11978         AnonymousMethod -> AnonymousContainer.
11979         (EmitContext.ResolveTopBlock): Protect from being called twice.
11980         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11981         (EmitContext.EmitThis): Removed the iterators hacks; use the
11982         anonymous methods framework for that.
11984         * statement.cs
11985         (ToplevelBlock.Container): Make this a property, not a field.
11986         (ToplevelBlock.ReParent): New public method; move the
11987         ToplevelBlock into a new container.
11988         (Foreach.TemporaryVariable): Simplify.
11990 2005-06-05  Martin Baulig  <martin@ximian.com>
11992         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11993         (Block.AddTemporaryVariable): New public method; creates a new
11994         `LocalInfo' for a temporary variable.
11995         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11996         variables here.
11997         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11998         non-iterator variables.
12000 2005-06-05  Martin Baulig  <martin@ximian.com>
12002         * statement.cs (Foreach.TemporaryVariable): Create the
12003         LocalBuilder in the Emit phase and not in Resolve since in some
12004         situations, we don't have an ILGenerator during Resolve; see
12005         2test-19.cs for an example.
12007 2005-06-04  Martin Baulig  <martin@ximian.com>
12009         **** Merged r45395 from GCS ****
12011         The big Foreach rewrite - Part II.
12013         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
12014         with `PropertyInfo ienumerator_getcurrent'.
12016         * codegen.cs (VariableStorage): Removed.
12018         * statement.cs
12019         (Foreach): Derive from Statement, not ExceptionStatement.
12020         (Foreach.CollectionForeach): New nested class.  Moved all the code
12021         dealing with collection foreach here.
12022         (Foreach.ForeachHelperMethods): Removed.
12023         (Foreach.TemporaryVariable): Implement IMemoryLocation.
12025 2005-05-23  Martin Baulig  <martin@ximian.com>
12027         * statement.cs (Try.DoResolve): Don't create a `finally' if we
12028         don't need to.  Fix #75014.
12030 2005-05-20  Martin Baulig  <martin@ximian.com>
12032         Merged r44808 from GMCS.
12034         * class.cs (TypeContainer.CircularDepException): Removed.
12035         (TypeContainer.DefineType): Removed the `InTransit' stuff.
12036         (TypeContainer.CheckRecursiveDefinition): Check for circular class
12037         (CS0146) and interface (CS0529) dependencies here.
12039 2005-06-21  Raja R Harinath  <rharinath@novell.com>
12041         * expression.cs (Invocation.EmitCall): Fix initialization
12042         'this_call' to reflect current behaviour.  Fix indentation.
12044         * convert.cs (FindMostEncompassedType): Add two trivial special
12045         cases (number_of_types == 0 || number_of_types == 1).
12046         (FindMostEncompasingType): Likewise.
12048 2005-06-17  Raja R Harinath  <rharinath@novell.com>
12050         Some cleanups preparing for the fix of #75283.
12051         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
12052         error testing.
12053         (EventExpr.InstanceResolve): Likewise.
12054         (EventExpr.DoResolve): Remove redundant checks.
12056 2005-06-10  Duncan Mak  <duncan@novell.com>
12058         * cs-tokenizer.cs (process_directives): New flag for controlling
12059         the processing of preprocessor directives.
12060         (x_token): After seeing a '#', return Token.NONE instead of going
12061         to handle_preprocessing_directive() when not processing
12062         directives. This avoids unnecessary processing during the token peek in
12063         is_punct().
12065         This fixes #74939.
12067         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
12068         the existing error reporting methods instead of Report.Error.
12070         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
12071         after Raja's rewrite.
12073 2005-06-08  Miguel de Icaza  <miguel@novell.com>
12075         * class.cs: Small fix.
12077 2005-06-08  Raja R Harinath  <rharinath@novell.com>
12079         Fix #75160.
12080         * class.cs (GetPartialBases): Fix return value check of
12081         part.GetClassBases.
12083 2005-06-07  Raja R Harinath  <rharinath@novell.com>
12085         Ensure that partial classes are registered in their enclosing
12086         namespace.  Initial part of fix of #75160.
12087         * tree.cs (Tree.RecordDecl): Add new namespace argument.
12088         Register declspace with namespace here, not in
12089         DeclSpace.RecordDecl.
12090         * cs-parser.jay: Pass namespace to RecordDecl.
12091         * class.cs (PartialContainer.Create): Likewise.
12092         (ClassPart.DefineType): New sanity-check.  Throws an exception if
12093         called.
12094         * decl.cs (Declspace.RecordDecl): Remove.
12095         * namespace.cs (NamespaceEntry.DefineName): Remove.
12097 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
12099         * rootcontext.cs: Reset TargetExt as well.
12101 2005-06-03  Raja R Harinath  <rharinath@novell.com>
12103         * ecore.cs (Expression.Resolve): Emit CS0654 error when
12104         -langversion:ISO-1.
12106 2005-06-02  Raja R Harinath  <rharinath@novell.com>
12108         Fix #75080, cs0119.cs.
12109         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
12110         of ...
12111         (Expression.Resolve): ... this.  Use it.  Remove bogus code
12112         allowing ExprClass.Type and ExprClass.Namespace for
12113         ResolveFlags.VariableOrValue.
12114         (Expression.Resolve) [1-argument variant]: Change default resolve
12115         flags based on language version.
12116         (Expression.Error_UnexpectedKind): Use a simple string array
12117         rather than an ArrayList.
12118         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
12119         not ExprClass.Type.
12120         (TypeOfVoid.DoResolve): Likewise.
12121         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
12122         flags argument -- it always has the same value.
12124 2005-05-31  Raja R Harinath  <rharinath@novell.com>
12126         Fix #75081.
12127         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
12128         Use it in the error message.
12129         * assign.cs, expression.cs, statement.cs: Update.
12131 2005-05-30  Raja R Harinath  <rharinath@novell.com>
12133         Fix #75088.
12134         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
12135         the "almostMatchedMember" case too.
12136         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
12137         that failed the accessibility checks to 'almost_match'.
12139 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
12141         * attribute.cs: Use internal MethodBuilder methods to set
12142         ExactSpelling and SetLastError on PInvoke methods, instead
12143         of passing them via charset.  Fixes #75060.
12145 2005-05-27  Raja R Harinath  <rharinath@novell.com>
12147         * parameter.cs (Parameter): Remove TODO comment.
12148         (Parameter.DefineParameter): Remove Location parameter.
12149         (Parameters.LabelParameters): Likewise.
12150         * class.cs (Constructor.Emit): Update to change.
12151         (MethodData.Emit): Likewise.
12152         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
12153         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
12155 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
12157         * parameter.cs,
12158           Removed Parameters.Location and added Parameter.Location instead.
12159           Removed Location parameter from Emit() and GetSignature().
12160         * anonymous.cs,
12161           class.cs,
12162           cs-parser.jay,
12163           delegate.cs,
12164           iterators.cs,
12165           statement.cs :
12166           Modified all related calls.
12168 2005-05-26  Raja R Harinath  <rharinath@novell.com>
12170         Improve user-defined conversion handling.
12171         * convert.cs (GetConversionOperators): Rewrite.  Return only the
12172         applicable operators.
12173         (AddConversionOperators): New.  Helper for GetConversionOperators.
12174         (FindMostEncompassedType, FindMostEncompassingType): Verify that
12175         there is only one most encompassed/encompassing type.
12176         (FindMostSpecificSource, FindMostSpecificTarget): Remove
12177         "applicable operator" handling.
12178         (UserConversion): Move cache here from GetConversionOperators.
12179         Directly cache the chosen operator, rather than the whole
12180         MethodGroup.
12181         (ExplicitNumericConversion): Fix buggy implementation of Decimal
12182         case.  Allow conversion of decimal to sbyte and byte too.
12183         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
12184         New static methods.  Used to avoid allocating EmptyExpressions in
12185         convert.cs.
12187 2005-05-24  Duncan Mak  <duncan@novell.com>
12189         * ecore.cs (CastFromDecimal): New class for casting a decimal to
12190         another class, used in Convert.ExplicitNumericConversion.
12191         (CastToDecimal): New class, similar to above, but casts to
12192         System.Decimal, used in Convert.ImplicitNumericConversion and also
12193         in explicit convesion from double/float to decimal.
12195         * convert.cs (ImplicitNumericConversion): Handle implicit
12196         conversions to System.Decimal.
12197         (ExplicitNumericConversion): handle explicit conversions to
12198         System.Decimal.
12200         This fixes #68711.
12201         
12202 2005-05-20  Miguel de Icaza  <miguel@novell.com>
12204         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
12205         know the type at this stage, just break through.   Fixes #75008 
12207 2005-05-19  Martin Baulig  <martin@ximian.com>
12209         * delegate.cs
12210         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
12211         to disable error reporting.
12213         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
12214         here since we don't want to report an error; see the new test-336.cs.
12216 2005-05-19  Raja R Harinath  <rharinath@novell.com>
12218         * statement.cs (ToplevelBlock.GetParameterReference)
12219         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
12220         Move here from class Block.
12221         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
12222         * expression.cs (ParameterReference.DoResolveBase): Likewise.
12224 2005-05-18  Martin Baulig  <martin@ximian.com>
12226         Fix #74978.
12228         * flowanalysis.cs
12229         (FlowBranching.Reachability): Add non-static public And() and Or()
12230         methods.
12231         (FlowBranchingSwitch): New class; do the `break_origins' thing
12232         like in FlowBranchingLoop.
12233         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12234         reachability, not just locals and parameters.
12235         (FlowBranching.MergeChild): Remove some of the hacks for loop and
12236         switch; MergeBreakOrigins() now takes care of that.
12238 2005-05-18  Martin Baulig  <martin@ximian.com>
12240         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12241         a loop and may leave it, reset the barrier; fixes #74974.
12243 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
12244         
12245         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12246         is back.
12247         
12248         * cs-parser.jay: Catch more lexical errors.
12249         
12250         * report.cs: Add one more Error method.
12251         
12252         * rootcontext.cs,
12253         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12255 2005-05-17  Martin Baulig  <martin@ximian.com>
12257         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12258         #70970. 
12260 2005-05-16  Raja R Harinath  <rharinath@novell.com>
12262         Fix test-382.cs.  Emit values of decimal constants.
12263         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12264         Carved out of ...
12265         (TypeContainer.AddField): ... this.
12266         (TypeContainer.EmitFieldInitializers): Allow the list of fields
12267         with initializers to include 'Const's.
12268         (ClassPart.RegisterFieldForInitialization): Forward to
12269         PartialContainer.
12270         * const.cs (Const.Const): Pass initializer to base class.
12271         (Const.Define): In case of decimal constants, register them for
12272         initialization in a static constructor.
12274 2005-05-14  Martin Baulig  <martin@ximian.com>
12276         * statement.cs (Block.Resolve): Correctly handle unreachable code;
12277         do not call ResolveUnreachable() on unreachable statements in
12278         here, see the comment in the source code.
12280 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12282         Fix #74934.
12283         * expression.cs (BinaryResolveOperator): If one of the operands of
12284         an equality comparison is 'null' and the other is a pointer type,
12285         convert the null to a NullPointer.
12286         * convert.cs (ImplicitReferenceConversion): If the expression is a
12287         NullLiteral and the target type is a pointer type, return a
12288         NullPointer instead.
12289         (ImplicitConversionStandard): Likewise.
12291 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
12292         
12293         * cs-parser.jay: Set readonly context based on special constructs.
12294         
12295         * expression.cs (LocalVariableReference.DoResolveBase): Improved
12296         readonly variable error handling.
12297         
12298         * rootcontext.cs (EmitCode): Don't verify members when error
12299         occurred.
12300         
12301         * statement.cs (LocalInfo): Add reaodnly context information.
12302         (SetReadOnlyContext, GetReadOnlyContext): New methods.
12304 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12306         * statement.cs (Block.Resolve): Revert change below.  Modify fix
12307         for #74041 to initialize 'resolved' to false only for explicit
12308         blocks.  Fixes #74873.
12310 2005-05-12  Raja R Harinath  <harinath@gmail.com>
12312         Fix #74920.
12313         * typemanager.cs (unmanaged_enclosing_types): New.
12314         (IsUnmanagedType): Avoid infloops by using
12315         'unmanaged_enclosing_types' to talk with recursive invocations.
12317 2005-05-13  Martin Baulig  <martin@ximian.com>
12319         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12320         instance variable, not a local.  Fix #74873.
12321         (Block.ResolveUnreachable): Set it to true here.
12323 2005-05-11  Duncan Mak  <duncan@novell.com>
12325         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12326         continuing to process for 'arg'.
12327         (handle_preprocessing_directive): Check the argument of the #endif
12328         directive and report error CS1025 if there are any trailing
12329         characters.
12331         According to the C# spec, having even whitespace after the #endif
12332         directive is illegal; however, because we call arg.TrimEnd ()
12333         beforehand, we have the same behavior as csc, allowing whitespace
12334         after the directive.
12336         Fixes #74892.
12338 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
12340         Fix #74863.
12341         
12342         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12343         (Constructor.GetObsoleteAttribute): Implemented correctly.
12345 2005-05-10  Martin Baulig  <martin@ximian.com>
12347         * support.cs (ReflectionParameters.ParameterModifier): Use
12348         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12349         and `ParameterAttributes.In'.  Fixes #74884.
12351 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
12353         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12354         
12355         * expression.cs (Argument.GetParameterModifier): Turned to property.
12356         (Invocation.Error_InvalidArguments): Add more descriptive errors.
12357         
12358         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12359         its C# equivalent.
12360         
12361 2005-05-09  Raja R Harinath  <rharinath@novell.com>
12363         Fix #74852.
12364         * decl.cs (MemberCache.AddMethods): Register override methods,
12365         rather than non-override methods.
12366         * typemanager.cs (RegisterOverride): New.
12367         (IsOverride): Update.
12369 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
12371         Fix #73105.
12372         
12373         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12374         recursive declaration.
12375         
12376         * statement.cs (Block.ResolveMeta): Report any error in resolving.
12377         
12378 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
12380         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12381         
12382         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12384 2005-05-05  Raja R Harinath  <rharinath@novell.com>
12386         Fix #74797.
12387         * decl.cs (DeclSpace.FamilyAccessible): 
12388         Use TypeManager.IsNestedFamilyAccessible.
12390         Fix reopened #64812.
12391         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12392         internal'.
12394 2005-05-04  Raja R Harinath  <rharinath@novell.com>
12395             Abin Thomas  <projectmonokochi@rediffmail.com>
12396             Anoob V E  <projectmonokochi@rediffmail.com>
12397             Harilal P R  <projectmonokochi@rediffmail.com>
12399         Fix #64812.
12400         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12401         allow access to all static members.
12403 2005-05-04  Martin Baulig  <martin@ximian.com>
12405         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12407 2005-05-04  Martin Baulig  <martin@ximian.com>
12409         Fix #74655.
12411         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12412         section at the end; make things work if `default' is not the last
12413         section.        
12415 2005-05-04  Martin Baulig  <martin@ximian.com>
12417         Fix #70400.
12419         * statement.cs (Switch): Replaced the `got_default' field with a
12420         `default_section' one.
12421         (Switch.CheckSwitch): Set `default_section' here.
12422         (Switch.Resolve): If we're a constant switch and the constant is
12423         not found, use the default section.
12425 2005-05-03  Martin Baulig  <martin@ximian.com>
12427         * expression.cs (ArrayAccess.EmitGetLength): New public method.
12429         * statement.cs (Foreach.ArrayForeach): New nested class.
12430         (Foreach.TemporaryVariable): New nested class.
12431         (Foreach.EmitArrayForeach): Removed; this is now in the new
12432         ArrayForeach class.
12434 2005-05-03  Raja R Harinath  <rharinath@novell.com>
12436         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
12437         more conservative.
12438         (VerifyPendingMethods): Revert change below.
12440         * typemanager.cs (IsOverride, RegisterNonOverride): New.
12441         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12442         that used to trigger warning -28.  Remove warning -28.
12443         * expression.cs (Invocation.OverloadResolve): Use
12444         TypeManager.IsOverride to distinguish override methods.
12446         Fix #74773.
12447         * pending.cs (VerifyPendingMethods): If a base type implements the
12448         requested interface, don't bother checking individual methods of
12449         the base type.  As a side-effect, this prevents the creation of
12450         unnecessary proxies.
12452 2005-05-02  Martin Baulig  <martin@ximian.com>
12454         Fix #70182.
12456         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12457         Also `And' the locals if the old vector is null.
12458         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12459         null; in this case we basically reset all the variables.        
12461 2005-05-02  Martin Baulig  <martin@ximian.com>
12463         Fix #74529.
12465         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12466         Added `FlowBranching branching' argument; always `and' the
12467         variables instead of `or'ing them unless we're an infinite loop.
12469         * statement.cs (While.Resolve): Create a new sibling unless we're
12470         infinite.       
12472 2005-05-02  Martin Baulig  <martin@ximian.com>
12474         Fix #70140.
12476         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12477         arguments; use it instead of creating a new TopLevelBlock.
12478         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12479         our ConstructorInitializer.
12481         * statement.cs
12482         (TopLevelBlock.TopLevelBranching): New public property.
12483         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12484         and create our `TopLevelBranching'.
12486         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12487         anonymous method host, use `block.TopLevelBranching' rather than
12488         creating a new branching.
12490 2005-04-20  Miguel de Icaza  <miguel@novell.com>
12492         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12493         a ScopeInfo, if any of the current children is a child of the new
12494         entry, move those children there.
12496 2005-04-30  Martin Baulig  <martin@ximian.com>
12498         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12499         at the beginning of a SwitchSection.  Fix #73335.
12501 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
12503         Fix #74378
12504         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12505         
12506         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12507         (FieldExpr.DoResolve): Obsolete members are ignored for field
12508         initializers.
12509         
12510 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
12512         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12513         of arrays detection.
12515         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12516         verification.
12517         (Field.VerifyClsCompliance): Volatile fields are not compliant.
12519         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12520         arrays report.
12522 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
12524         * cs-parser.jay: Use the prefered version of -unsafe in error
12525         message.
12527 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
12529         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12530         circumstances.
12532 2005-04-20  John Luke  <john.luke@gmail.com>
12534         * driver.cs: fix typo in error message, --outout to --output
12536 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
12538         * codegen.cs (InRefOutArgumentResolving): New field.
12539         
12540         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12541         fields outside contructor.
12542         
12543         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12544         
12545 2005-04-19  Miguel de Icaza  <miguel@novell.com>
12547         * anonymous.cs (CaptureContext.EmitParameterInstance): The
12548         parameter code was not completed ever, so it was not as up-to-date
12549         as local variables.  Must finish it.
12551         The bug fix was to compare the Toplevel of the block, not the
12552         current block.  Thanks for Ben for pointing this out. 
12554 2005-04-19  Raja R Harinath  <rharinath@novell.com>
12556         * decl.cs (AddMethods): Use the declaring type of the problem
12557         method to determine if we want to squash a warning.
12559 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
12561         * attribute.cs: Removed debug output.
12563         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12564         
12565         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12566         Report.Stderr.
12567         
12568 2005-04-18  Raja R Harinath  <rharinath@novell.com>
12570         Fix #74481.
12571         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12572         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12573         all null comparisons against reference types.
12575 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
12577         Fix# 74565
12578         * class.cs (TypeContainer.CircularDepException) New nested
12579         exception class.
12580         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12581         (TypeContainer.DefineType): Removed error, reset InTransit before
12582         exit.
12583         (Class.DefineType): Throw exception when is in Transit.
12584         Catch exception and report error.
12585         (Struct.DefineType): Throw exception when is in Transit.
12586         Catch exception and report error.
12587         (Interface.DefineType): Throw exception when is in Transit.
12588         Catch exception and report error.
12590         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12591         handle nested exception handlers.
12593         * flowanalysis.cs (InTryWithCatch): New method, search for try with
12594         a catch.
12596         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12597         InFinally and InCatch storage.
12599         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12600         (Catch.Resolve): Set and Restore ec.InCatch.
12601         (Try.Resolve): Set and Restore ec.InFinally.
12602         (Try.HasCatch): True when try has catch.
12604 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
12606         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12607           for the same event member, so exclude such cases from warning 419.
12608           Fixed bug #74633.
12610 2005-04-16  Miguel de Icaza  <miguel@novell.com>
12612         * expression.cs (Binary.ResolveOperator): Apply patch from John
12613         Luke to fix bug 59864: operators &, | and ^ on enumerations
12614         require that the same enum type on both sides.
12616         * driver.cs: Add warnings to old flag usage, this is to assist
12617         people who produce Makefiles and hope that the Makefiles will be
12618         used on Windows.
12620         * class.cs (TypeContainer.EmitType): Moved the definition of the
12621         special $PRIVATE$ field from the resolve phase to the Emit phase.
12622         During resolve we do not know if we are a struct with
12623         HasExplicitLayout, we know this only after the attributes for the
12624         type are emitted.
12626         Set the FieldOffset to zero on the dummy field that we create for
12627         the class.   Fixes 74590.
12629 2005-04-16  Raja R Harinath  <rharinath@novell.com>
12631         Fix #73834.
12632         * ecore.cs (PropertyExpr.resolved): New.
12633         (DoResolve): Use it to handle a case of double resolution here.
12634         Handle a case of identical-name-and-type-name.
12635         * expression.cs (ArrayCreation.CheckIndices): Avoid double
12636         resolution by storing the results of expression resolution back
12637         into the "probes" array.
12639 2005-04-15  Raja R Harinath  <rharinath@novell.com>
12641         Fix cs0208-7.cs and cs0208-8.cs.
12642         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12643         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
12644         error reporting to point out the reason a struct is not unmanaged.
12646 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12648         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
12649           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12651 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12653         Fix #74528.
12654         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12655         IdenticalNameAndTypeName here.
12656         (EventExpr.InstanceResolve): Likewise.
12658 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
12660         C# 2.0 DefaultCharSetAttribute implementation
12661         
12662         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12663         which allows us to set GlobalNamespace for every resolve.
12664         (Attribute.ResolveArguments): Cut from Resolve.
12665         (Attribute.GetCharSetValue): Returns CharSet named argument.
12666         (Attribute.DefinePInvokeMethod): Gets default charset from
12667         module settings.
12668         (GlobalAttribute.ResolveAsTypeStep): Override.
12669         (GlobalAttribute.ResolveArguments): Override.
12670         
12671         * class.cs (TypeAttr): Is protected.
12672         
12673         * codegen.cs (ModuleClass.DefaultCharSet): New member.
12674         (ModuleClass.DefaultCharSetType): New memeber.
12675         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12676         
12677         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12678         charset from module.
12679         
12680         * delegate.cs (TypeAttr): Override.
12681         (Delegate.DefineType): Use this TypeAttr.
12682         
12683         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12684         at very early stage (before types are defined) to resolve model
12685         module attributes. It will probably not work with corlib but it
12686         should be ok.
12687         
12688         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12689         charset from module.
12690         
12691         * typemanager.cs (default_charset_type): New type.
12693 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12695         * decl.cs (MemberCache.AddMethods): Don't warn if
12696         System.Object.Finalize has buggy MethodAttributes.
12698         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12699         removed below.
12701 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12703         * doc.cs : detect ambiguous reference to overloaded members.
12704           Fixed bug #71603. MS 1.1 csc does not detect it.
12706 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12708         * doc.cs : delegates must not be referenced with parameters.
12709           Fixed bug #71605.
12711 2005-04-12  Miguel de Icaza  <miguel@novell.com>
12713         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12715 2005-04-10  Miguel de Icaza  <miguel@novell.com>
12717         * driver.cs (MainDriver): Stop processing if the CLS stage found
12718         errors. 
12720         (CompilerCallableEntryPoint.InvokeCompiler): Always
12721         reset after execution;   Take a TextWriter argument for the
12722         output.
12724         * report.cs: Use the error stream instead of hardcoding stderr. 
12726 2005-04-09  Miguel de Icaza  <miguel@novell.com>
12728         * class.cs: Reduce code paths to test, too small of an
12729         optimization to make it worth the extra testing.  Always perform
12730         it. 
12732 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12734         Fix #74510.
12735         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12736         operators that had errors reported on them.
12738 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
12740         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12741         argument types.
12742         (Attribute.Resolve): Add named argument type checking.
12743         
12744         * class.cs (FixedField.Define): Use IsPrimitiveType
12745         
12746         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12747         
12748         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12749         unsafe parameter types.
12750         
12751         * statement.cs (Using.ResolveExpression): Add better error description.
12752         
12753         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12754         
12755 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12757         Fix #74484.
12758         * attribute.cs (Attribute.GetAttributeUsage): Resolve
12759         AttributeUsageAttribute in the emitcontext of the attribute class,
12760         not in the emitcontext of the attributable entity it was attached to.
12761         * cs-parser.jay: Use 'current_class', not 'current_container',
12762         when creating a GlobalAttribute.
12764 2005-04-08  Alp Toker  <alp@atoker.com>
12766         * pending.cs: The fix to #58413 failed to compile methods implementing
12767         interfaces with/without params modifiers and vice versa, even though
12768         params modifiers aren't part of the signature. Make the modifier check
12769         less strict as in csc.
12771 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
12772             Anoob V E  <projectmonokochi@rediffmail.com>
12773             Harilal P R  <projectmonokochi@rediffmail.com>
12775         Fix #58413.
12776         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
12777         modifiers of pending methods.
12778         (PendingImplementation.PendingImplementation): Initialize it.
12779         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12780         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12781         with ParameterData.  Add check for modifiers.
12782         * class.cs (MethodData.Define): Update to changes.
12784 2005-04-07  Raja R Harinath  <rharinath@novell.com>
12786         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12788 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
12790         * class.cs (PropertyMethod.Define): Check private accessor in abstract
12791         property.
12792         
12793         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12794         
12795         * rootcontext.cs,
12796         * typemanager.cs: Registered RequiredAttributeAttribute.
12797         
12798 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
12800         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12801         Warning CS0169 is back at level 3.
12802         (IMethodData.SetMemberIsUsed): New method.
12803         
12804         * decl.cs (IsUsed): New value; moved from FieldBase.Status
12805         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12806         
12807         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12809         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12810         contants.
12811         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12812         is used.
12813         
12814         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12815         is used.
12816         
12817         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12818         to avoid the problems with nested types.
12820 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12821             Anoob V.E  <projectmonokochi@rediffmail.com>
12822             Harilal P.R  <projectmonokochi@rediffmail.com>
12823             Raja R Harinath  <rharinath@novell.com>
12825         Fix #73820.
12826         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12827         attribute.
12828         * typemanager (GetConstructor): Make public.
12830 2005-04-05  John Luke  <john.luke@gmail.com>
12831             Raja R Harinath  <rharinath@novell.com>
12833         Fix #62232.
12834         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12835         struct too.  Return false quicker in a few cases.
12836         (VerifyUnManaged): Use it.
12838 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12840         Fix #74041.
12841         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12842         not 'unreachable_seen'.
12844 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12846         * attribute.cs (Attribute.GetValue): Removed unused.
12847         
12848         * codegen.cs (CodeGen.TrimExt): Removed unused.
12849         
12850         * cs-parser.jay (output): Removed unused.
12851         
12852         * cs-tokenizer.cs (hex_digits): Removed unused.
12853         
12854         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12855         
12856         * expression.cs (Indirection.LoadExprValue): Removed unused.
12857         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12858         
12859         * iterators.cs (Iterator.param_types): Removed unused.
12860         
12861         * statement.cs (Goto.block): Removed unused.
12862         (ToplevelBlock.did): Removed unused.
12863         (Switch.ResolveConstantSwitch): Removed unused.
12865 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12867         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12868         resetting thingy.
12870 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12872         Fix #74232 and cs0208-3.cs.
12873         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12874         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12875         unmanaged type.  Don't use FieldBuilders when 't' is a
12876         TypeBuilder.  Use ModFlags and MemberType fields.
12877         * class.cs (MemberBase.member_type): Rename from MemberType.
12878         (MemberBase.MemberType): New property.  Determines member_type on
12879         demand.
12880         (MemberBase.DoDefine): Don't initialize MemberType here.
12881         (FieldMember.Define): Likewise.
12883 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12885         Fix #74241
12886         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12887         Attributes are emitted there.
12888         
12889 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12891         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12892         keyword in 'partial enum' too.
12893         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12894         is not allowed).
12895         Report from Kamil Skalski <nazgul@omega.pl>.
12897         Fix #74309.
12898         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12899         have partial containers too.
12901         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12902         in block' checks to Block.CheckInvariantMeaningInBlock.
12903         * statement.cs (Block.GetKnownVariableInfo): Make private.
12904         (Block.IsVariableUsedInChildBlock): Remove.
12905         (Block.IsVariableUsedInBlock): Likewise.
12906         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12907         conflicting declaration.
12908         (Block.AddVariable): Make error messages less long-winded and more
12909         specific.  Show location of conflicting declaration.
12910         * parameter.cs (Parameters.Location): New readonly property.
12912 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12914         Clean up semantics of invoking ResolveMemberAccess.
12915         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12916         can have an instance, ensure that we pass in a non-TypeExpression
12917         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12918         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12919         argument.  Update to changes and simplify.
12920         (FieldExpr.Emitinstance): Remove CS0120 check.
12921         (PropertyExpr.EmitInstance): Likewise.
12922         * expression.cs (Argument.Resolve): Likewise.
12923         (Invocation.DoResolve): Update to changes in semantics of
12924         InstanceExpression.
12926 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12928         Fix #74241
12929         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12930         customization.
12931         
12932         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12934 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12936         Fix difference in behaviour with commandline invocation.
12937         * driver.cs (Driver.Reset): New.
12938         (CompilerCallableEntryPoint): Call it.
12940         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12941         variable" warnings if the boolean expression failed to resolve.
12943 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12945         * attribute.cs: Fix the union of several permissions when some of them
12946         are unrestricted (so the result isn't an unrestricted permission set).
12947         Fix #74036.
12949 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12951         * ecore.cs (MemberExpr): New class.  Convert from interface
12952         IMemberExpr.
12953         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12954         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12955         error checks.
12956         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12957         (MethodGroupExpr.IsExplicitImpl): Remove.
12958         (Expression.GetFieldFromEvent): Remove.
12959         (SimpleName.MemberStaticCheck): Remove.
12960         (SimpleName.DoSimpleNameResolve): Update to changes.
12961         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12962         (MemberAccess.IdenticalNameAndTypeName): Remove.
12963         (MemberAccess.error176): Move to MemberExpr.
12964         (MemberAccess.DoResolve): Update to changes.
12965         (BaseAccess.DoResolve): Likewise.
12967 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12969         C# 2.0 Conditional attribute class implementation
12970         
12971         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12972         Analyzes class whether it has attribute which has ConditionalAttribute
12973         and its condition is not defined.
12974         
12975         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12976         (Class.IsExcluded): New method. Search for at least one defined
12977         condition in ConditionalAttribute of attribute class.
12979 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12981         * ecore.cs (PropertyExpr): Derive from Expression, not
12982         ExpressionStatement.
12983         (PropertyExpr.EmitStatement): Remove.
12985 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12987         Fix #74060.
12988         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12989         internal field "value__" of an enum be private.  The examples for
12990         "value__" that I found on MSDN all used FieldAttributes.Private.
12992         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12993         Don't mention IL method attribute names.
12995         Fix #47991.  Remove a TODO.
12996         * statement.cs (Block.Toplevel): Make into a field.
12997         (Block.Parameters): Move into ToplevelBlock.
12998         (Block.known_variables): Rename from child_variable_names.
12999         (Block.Block): Remove variants that take Parameters.  Initialize
13000         'Toplevel' with the immediately surrounding toplevel block.
13001         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
13002         LocalInfo parameter.
13003         (Block.GetKnownVariableInfo): New.
13004         (Block.IsVariableNameUsedInChildBlock): Update.
13005         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
13006         the block, even though it may not be in scope.
13007         (Block.AddVariable): Remove Parameters parameter.  Use
13008         Toplevel.Parameters instead.
13009         (Block.AddConstant): Remove Parameters parameter.
13010         (Block.GetParameterReference): Update to use Toplevel.Parameters.
13011         (Block.IsParamaterReference): Likewise.
13012         (Block.IsLocalParameter): Likewise.  Simplify a lot.
13013         (ToplevelBlock.Parameters): New.  Moved from Block.
13014         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
13015         initialize Parameters to a non-null value.
13016         * cs-parser.jay: Update to changes.
13017         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
13018         simple names that mean different things in the same block.  Use
13019         Block.IsVariableNameUsedInBlock.
13021 2005-03-28  Raja R Harinath  <rharinath@novell.com>
13023         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
13024         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
13025         GetTypeHandle.  It is possible for a reflected type to derive from
13026         a TypeBuilder (e.g., int[] derives from the TypeBuilder
13027         System.Array during mscorlib compilation).
13028         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
13029         contain a method_hash, don't create one either.  Don't create a
13030         deep copy of the base cache's method_hash.
13031         (MemberCache.SetupCache): Rename back from DeepCopy.
13032         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
13033         already initialized.  If we see an override function, add its
13034         underlying base virtual function to the member_hash too.
13036         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
13038 2005-03-26  Raja R Harinath  <harinath@acm.org>
13040         Fix #73038.
13041         * assign.cs (Assign.DoResolve): When the RHS of an assignment
13042         fails to resolve, ensure that the LHS is still resolved as an
13043         lvalue.
13045 2005-03-25  Raja R Harinath  <harinath@acm.org>
13047         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
13048         ec.ContainerType.
13049         (Enum.current_ec): Remove.
13050         (Enum.LookupEnumValue): Remove EmitContext argument.
13051         Just uses the one created during DefineType.
13052         (Enum.FindMembers): Update.
13053         * expression.cs (MemberAccess.DoResolve): Update.
13055 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
13057         * assign.cs (Assign.DoResolve): Check for CS1717 when
13058         source and target are same (uses Equals).
13060         * expression.cs (LocalVariableReference, ParameterReference,
13061         This): Implemented Equals, GetHashCode.
13063         * statement.cs (Block.GetParameterReference): Removed useless
13064         local variable.
13066 2005-03-22  Raja R Harinath  <rharinath@novell.com>
13068         Fix cs0128.cs
13069         * statement.cs (Block.AddVariable): Ensure that we skip implicit
13070         blocks before deciding whether the error is cs0136 or cs0128.
13072         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
13073         (using_alias_directive, using_namespace_directive): Pass
13074         MemberName, not an expression to Namespace.UsingAlias and
13075         Namespace.Using.
13076         (MakeName): Use the MemberName of the namespace.
13077         * namespace.cs (Namespace.MemberName): New.
13078         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
13079         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
13080         Likewise.
13081         * decl.cs (MemberName.Name): Make readonly.
13082         (MemberName.FromDotted): New "constructor".
13083         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
13084         (MemberCore.Name): Compute from MemberName on demand.
13085         (MemberCore.SetMemberName): Provide a way to change the
13086         MemberName.
13087         (MemberCore.AddToContainer): Don't take a fullname parameter.
13088         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
13089         fully qualified name of the container to the member name.
13090         (TypeContainer.AddToTypeContainer): Use a fully qualified name
13091         only if the type is a member of the root container.
13092         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
13093         MemberName.Left rather than searching for an embedded ".".
13094         (PartialContainer.CreatePart): Update to changes in RootContext.
13095         (MemberBase.ShortName): Turn into a property.  Use
13096         MemberCore.SetMemberName.
13097         (MemberBase.ExplicitInterfaceName): Remove.
13098         (MemberBase.UpdateMemberName): Remove.
13099         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
13100         (PropertyBase.SetMemberName): New override.
13101         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
13102         (Tree.GetDecl): New.
13103         (Tree.AllDecls): Rename from Decls.
13104         * attribute.cs, enum.cs, report.cs: Update to changes.
13105         * driver.cs (MainDriver): Use MemberName.FromDotted on
13106         RootContext.MainClass.
13108 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
13110         * class.cs (FixedField.Define): Check for CS1664 and more sanity
13111         checks.
13113         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
13115 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
13117         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
13118         property accessor modifiers.
13120         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
13121         fixed buffer attribute (CS1716).
13122         (PropertyMethod.HasCustomAccessModifier): When property accessor
13123         has custom modifier.
13125         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
13126         modifiers.
13127         (PropertyExpr.DoResolveLValue): Add CS0272.
13129 2005-03-17  Miguel de Icaza  <miguel@novell.com>
13131         * convert.cs: When converting to a pointer, use the proper Conv.U
13132         or Conv.I depending on the source data type.
13134         * cs-tokenizer.cs: Make the size for large decimal constants,
13135         fixes #72957.
13137 2005-03-17  Martin Baulig  <martin@ximian.com>
13139         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
13140         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
13142 2005-03-17  Martin Baulig  <martin@ximian.com>
13144         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
13145         to bool so we can return an error condition.
13146         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
13147         returned an error.
13149 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
13151         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
13152         attributes.
13154 2005-03-16  Raja R Harinath  <rharinath@novell.com>
13156         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
13157         Refactor to avoid traversing the list of assemblies, and to avoid
13158         string concatenation.
13159         * typemanager.cs (guid_attr_type): Remove.
13160         (negative_hits, pointers, references): Remove hashes.
13161         (type_hash): New.
13162         (GetConstructedType): New.  Uses type_hash to handle constructed
13163         types (arrays, references, pointers).
13164         (GetReferenceType, GetPointerType): Use it.
13165         (GetNestedType): New.  Uses type_hash to handle nested types of
13166         reflected types.
13167         (LookupType, LookupTypeDirect): Remove.
13168         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
13169         'types' hash and LookupTypeReflection directly.
13170         (params_string, params_object): Use GetConstructedType.
13171         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
13172         top-level types.
13173         (Namespace.Lookup): Use cached_types.
13174         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
13175         provided by old TypeManager.LookupType.
13176         * rootcontext.cs (MakeFQN): Remove.
13177         * decl.cs (DeclSpace.MakeFQN): Likewise.
13178         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
13179         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13180         TypeManager.GetConstructedType.
13181         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
13183 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
13185         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
13186         indexers.
13188         * cs-parser.jay: Reports CS1527 for any namespace element.
13190         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
13191         Added CS0407.
13193         * expression.cs (ParameterReference.IsAssigned): Changed error to
13194         CS0269.
13195         (Error_WrongNumArguments): Moved CS0245 detection here.
13197         * statement.cs (Return.Resolve): Add CS1622 report.
13199 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
13201         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
13203 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
13205         * attribute.cs expression.cs: Get rid of some allocations.
13207 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
13209         * doc.cs : just eliminate the latest change.
13211 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13213         * doc.cs : commented out the latest change. It breaks xml-030.cs
13215 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13217         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
13218           fail. So invoke CreateType() in FindDocumentedType().
13220 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13222         * cs-tokenizer.cs : added IsKeyword().
13223         * doc.cs : Detect keyword incorrectly used as identifier.
13224           Allow identifiers prefixed by @.
13226 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
13228         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13229         It caused exception in namespace resolving (again!).
13230         
13231         * class.cs (Class.ctor): Removed exit.
13232         (PropertyMethod.ctor): ditto.
13233         
13234         * codegen.cs (Codegen.Reset): Reset static data.
13235         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13236         
13237         * cs-tokenizer.cs (Cleanup): Removed.
13238         
13239         * driver.cs (GetSystemDir): Rewrote to one line command.
13240         It caused problem with unloaded dynamic modules.
13241         (UnixParseOption): Removed Exit.
13242         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13243         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13244         Now can be mcs used as library.
13245         
13246         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13247         empty location.
13248         
13249         * location.cs (Reset): Reset static data.
13250         
13251         * namespace.cs (Reset): Reset static data.
13252         
13253         * report.cs (Report.Reset): Reset static data.
13254         
13255         * rootcontext.cs (RootContext.Reset): Reset static data.
13256         
13257         * tree.cs (RootTypes.ctor): Use Location.Null
13258         
13259         * typemanager.cs (TypeManager.Reset): Reset static data.
13260         (CoreLookupType): Removed Exit.
13261         (TypeHandle.Reset): Reset static data.
13262         
13263 2005-03-10  Raja R Harinath  <rharinath@novell.com>
13265         Fix #73516.
13266         * typemanager.cs (ComputeNamespaces): Import namespaces from
13267         referenced modules too.
13269 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13271         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13272         than '.'.
13274 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13276         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13277         enclosing DeclSpace.  This ensures that a name-lookup populates
13278         more caches and there are fewer 'TypeExpression's.  Carve out
13279         nested type lookup into ...
13280         (LookupNestedTypeInHierarchy): ... this.
13282 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13284         Clean up a few partial-class semantics.  
13285         Fixes test-357.cs and cs1618-2.cs.
13286         * cs-parser.jay (struct_declaration): Use 'current_class' as
13287         parent of newly-created struct.  Remove call to Register ().
13288         Use 'pop_current_class' to complete handing the current struct.
13289         (interface_declaration): Likewise.
13290         (class_declaration): Likewise.
13291         (enum_declaration): Use 'current_class' as parent of newly created
13292         enum.
13293         (delegate_declaration): Likewise.
13294         (pop_current_class): New function.  This is used to handle closing
13295         up the 'current_class' and 'current_container', and pointing them
13296         to the enclosing class/container.
13297         (CSharpParser): Initialize 'current_class' too.
13298         * decl.cs (MemberCore): Add check for invariant: a partial
13299         container is not a parsed entity, and thus does not enclose any
13300         parsed members.
13301         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13302         (DeclSpace.BaseTypeExpr): Use it.
13303         (DeclSpace.LookupType): Add check for invariant.
13304         * class.cs (TypeContainer): Add check for invariant: a nested
13305         class should have the same NamespaceEntry as its enclosing class.
13306         (TypeContainer.EmitFieldInitializers): Make virtual.
13307         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13308         MemberCore.
13309         (TypeContainer.Register): Remove.
13310         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13311         null.  Use TypeResolveEmitContext for resolving base types and
13312         interfaces.  Move initialization of Parts.TypeBuilder here from
13313         ...
13314         (TypeContainer.DefineNestedTypes): ... here.
13315         (PartialContainer): Take a Namespace not a NamespaceEntry.
13316         (PartialContainer.Create): Don't use Register.  Call the
13317         appropriate Add... function directly.
13318         (ClassPart): Take both the PartialContainer and the enclosing
13319         class as constructor arguments.
13320         (ClassPart.EmitFieldInitializers): Override.
13321         (ClassPart.PartFindNestedTypes): Remove.
13322         (FieldBase.GetInitializerExpression): Resolve the initializer
13323         expression in the emit context of the enclosing class.
13324         * tree.cs (RootTypes): Remove Register ().
13325         
13326 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
13328         * cs-parser.jay: Removed CS0134.
13329         
13330         * driver.cs: Removed CS1901.
13331         
13332         * expression.cs (SizeOf.DoResolve): Don't report CS0233
13333         for predefined types.
13335 2005-03-07  Duncan Mak  <duncan@novell.com>
13337         * codegen.cs (Save):  Catch UnauthorizedAccessException as
13338         well. Fixes bug #73454.
13340 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
13342         * cs-tokenizer.cs (xtoken): Add CS1035.
13343         
13344         * class.cs (MethodData.Define): Add CS0683.
13345         (FieldMember.ctor): Add CS0681.
13347 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13349         * ecore.cs (SimpleName.DoResolve): Rename from
13350         SimpleName.DoResolveAllowStatic.
13351         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13352         Pass 'intermediate' flag to MemberStaticCheck.
13353         (SimpleName.MemberStaticCheck): Skip "static check" only in case
13354         of "intermediate" lookups via MemberAccess.
13355         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
13356         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13358 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13360         Fix #73394.
13361         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13362         slipped in because of variable names that are identical to a
13363         builtin type's BCL equivalent ('string String;', 'int Int32;').
13364         (PropertyExpr.EmitInstance): Likewise.
13366 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
13368         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13369         
13370         * report.cs (warning_ignore_table): Made public.
13372 2005-03-04  Raja R Harinath  <rharinath@novell.com>
13374         Fix #73282.
13375         * class.cs (MethodData.Emit): Pass 'container' to
13376         container.GetObsoleteAttribute instead of 'container.Parent'.
13378 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
13380         * cs-parser.jay: Add 1534 error test.
13382         * iterators.cs (Yield.CheckContext): Add error 1629.
13383         (Iterator.ctor): Save unsafe modifier.
13384         (MoveNextMethod.DoEmit): Restore unsafe context.
13386         * namespace.cs (UsingAlias): Better error message.
13388 2005-03-03  Dan Winship  <danw@novell.com>
13390         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13391         the warning message [#73219]
13393 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13395         Fix compile with MCS 1.0.0.0.
13396         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13397         w_restore to not depend on string constant folding.
13399 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13401         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
13402         CS0246 check to users who passed 'silent = false'.
13403         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13404         check.
13405         (SimpleName.SimpleNameResolve): Update.
13406         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13407         (MemberAccess.IdenticalNameAndTypeName): Update.
13408         * doc.cs (FindDocumentedTypeNonArray): Update.
13410 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
13412         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13413         * parameters.cs (ComputeAndDefineParameters): Remove.
13414         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13415         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13416         Use GetParameterInfo.
13418 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
13420         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13422 2005-03-02  Raja R Harinath  <rharinath@novell.com>
13424         Unify DeclSpace.LookupType and DeclSpace.FindType.
13425         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
13426         is in charge of defining nested types on demand.
13427         (DeclSpace.LookupType): Use it when the current_type is a
13428         TypeBuilder.  Use LookupTypeDirect for reflected types.
13429         (DeclSpace.FindType): Remove.
13430         (DeclSpace.LookupInterfaceOrClass): Likewise.
13431         (DeclSpace.DefineTypeAndParents): Likewise.
13432         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13433         DeclSpace.LookupType.
13434         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13435         * typemanager.cs (LookupType): Simplify.
13436         (AddUserType): Remove type from negative_hits.
13437         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13438         * class.cs (TypeContainer.FindMembers): Move handling of nested
13439         types ...
13440         (TypeContainer.FindMembers_NestedTypes): ... here.
13441         (TypeContainer.FindNestedType): Implement override.
13442         (ClassPart.FindNestedType): Delegate to PartialContainer.
13443         (ClassPart.PartFindNestedType): Looks up the nested types of the
13444         part alone.
13446 2005-03-02  Martin Baulig  <martin@ximian.com>
13448         * class.cs (TypeContainer.DoDefineMembers): We also need a default
13449         static constructor in static classes.
13451 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
13453         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13454         sizeParamIndex is not specified.
13456 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
13458         Fix #73117
13459         * report.cs (WarningMessage.IsEnabled): Missing null check.
13461 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13463         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13464         in the fields and not in the properties.
13466 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
13468         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
13469         fields as well.
13471 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13473         * attribute.cs: Small refactoring (improved robustness).
13474         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13475         (ValidateGuid): Removed.
13476         (Resolve): Removed referenced to above mentioned.
13477         (GetAttributeUsage): Made private and changed to work without
13478         class assistance.
13479         (GetIndexerAttributeValue): Don't crash.
13480         (GetConditionalAttributeValue): Ditto.
13481         (GetClsCompliantAttributeValue): Ditto.
13482         (ExtractSecurityPermissionSet): All attributes exceptions are
13483         error 648.
13484         (GetPropertyValue): New helper.
13485         (GetMethodImplOptions): New method.
13486         (DefinePInvokeMethod): Reuse common code. Implemented handling of
13487         some missing properties.
13488         
13489         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13490         (Method.ApplyAttributeBuilder): Updated.
13491         
13492         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13493         exception.
13495 2005-02-28  Raja R Harinath  <rharinath@novell.com>
13497         Fix #73052.
13498         * report.cs (Report.SymbolRelatedToPreviousError): Handle
13499         non-simple types (array, pointer, reference).
13501 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13503         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13505         * class.cs (MethodCore.IsDuplicateImplementation): Special error
13506         for operators.
13507         (Method.CheckBase): Catch wrong destructor here.
13508         (MethodData.Define): Add errors 550, 668.
13510         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13512         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13514         * pending.cs (VerifyPendingMethods): Add error 551.
13516         * typemanager.cs (CSharpName): Next error report helper.
13518 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
13520         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13521         attributes. Removed useless attribute double check.
13522         It saves almost 2MBs for corlib.
13524 2005-02-25  Raja R Harinath  <rharinath@novell.com>
13526         Fix #72924.
13527         * statement.cs (ExpressionStatement.Resolve): Make robust to being
13528         called twice in case of error.
13530 2005-02-23  Chris Toshok  <toshok@ximian.com>
13532         Fix compiler portions of #72827.
13533         * statement.cs (Block.Emit): call Begin/EndScope on the
13534         EmitContext instead of the ILGenerator.
13536         * codegen.cs (EmitContext.BeginScope): new method, call
13537         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13538         we have one.)
13539         (EmitContext.BeginScope): same, but EndScope and CloseScope
13541         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13542         offset and call the superclass's OpenScope(int) with it.
13543         (SymbolWriter.CloseScope): get the current il
13544         offset and call superclass's CloseScope(int) with it.
13546 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
13548         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13549         CS1677 for out and ref as well.
13551         * class.cs (Method.Define): Add error CS1599 detection.
13552         
13553         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13554         
13555         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13556         
13557         * delegate.cs (Delegate.Define): Add error CS1599 detection.
13558         
13559         * support.cs.cs (ModifierDesc): New helper method.
13561 2005-02-23  Raja R Harinath  <rharinath@novell.com>
13562             Abin Thomas  <projectmonokochi@rediffmail.com>
13563             Anoob V E  <projectmonokochi@rediffmail.com>
13564             Harilal P R  <projectmonokochi@rediffmail.com>
13566         Fix #57851, #72718.
13567         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13568         MemberLookup (used for error reporting) actually returns a result.
13569         Fix error report number (122, not 112).
13571 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
13572             Anoob V E  <projectmonokochi@rediffmail.com>
13573             Harilal P R  <projectmonokochi@rediffmail.com>
13575         Fix #71134.
13576         * pending.cs (PendingImplementation.GetAbstractMethods):
13577         Find NonPublic members too.
13579 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
13581         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13582         Fixed error 217.
13583         
13584         * class.cs (MethodCore.CheckMethodAgainstBase):
13585         Add error 239 report.
13587 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13589         Fix #68955.
13590         * expression.cs (Invocation.IsApplicable): Make public.
13591         (Invocation.IsParamsMethodApplicable): Likewise.
13592         * delegate.cs (Delegate.VerifyApplicability): Don't use
13593         Invocation.VerifyArgumentCompat for parameter applicability
13594         testing.  Use Invocation.IsApplicable and
13595         Invocation.IsParamsMethodApplicable.
13597 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13599         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13600         
13601         * class.cs (Operator.Define): Add error 217 report.
13602         
13603 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13605         * namespace.cs (UsingEntry.Resolve): Undo change below.
13607 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13609         Fix #72756.
13610         * ecore.cs (Expression.MemberLookupFailed): Add argument to
13611         disable the error message when the extended MemberLookup also
13612         fails.
13613         (Expression.MemberLookupFinal): Update.
13614         (SimpleName.DoSimpleNameResolve): Update.
13615         * expression.cs (MemberAccess.ResolveNamespaceOrType):
13616         Don't use MemberLookupFinal.
13617         (New.DoResolve): Update.
13618         (BaseAccess.CommonResolve): Update.
13620 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13622         Fix #72732.
13623         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13624         occured previously, don't resolve again.
13626 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13628         Fix #69949
13629         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13630         argument. Call ResolveAttributeUsage for unresolved.
13631         when types doesn't match ctor arguments.
13632         
13633         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13634         for nested attribute classes.
13635         (Class.attribute_usage): Removed.
13636         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13637         for attribute class.
13638         
13639         * ecore.cs (IsAttribute): Removed.
13640         
13641         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13642         
13643         * rootcontext.cs (RegisterAttribute): Removed, attributes are
13644         now normal types.
13645         (attribute_types): Removed.
13646         (EmitCode): Global attributes are emited as the latest.
13648 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
13650         * class.cs (EmitFieldInitializers): Don't emit field initializer
13651         for default values when optimilization is on.
13652         
13653         * constant.cs (Constant.IsDefaultValue): New property.
13654         
13655         * driver.cs: Add /optimize handling.
13656         
13657         * constant.cs,
13658         * ecore.cs,
13659         * literal.cs: Implement new IsDefaultValue property.
13660         
13661         * rootcontext.cs (Optimize): New field, holds /optimize option.
13663 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13665         Fix crasher in re-opened #72347.
13666         * namespace.cs (Namespace.Lookup): Return null if
13667         DeclSpace.DefineType returns null.
13669         Fix #72678.
13670         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13672 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13674         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
13675         now returns null if it cannot resolve to an lvalue.
13676         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13677         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13678         returned null.  Remove check for SimpleName.
13679         (EventExpr.DoResolveLValue): New.
13680         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13681         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
13682         error from ...
13683         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
13684         avoid CS0131 error.
13685         (Unary.ResolveOperator): Move CS0211 check ...
13686         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
13687         CS0131 error.
13688         (Unary.DoResolveLValue): Simplify.
13689         (AddressOf.DoResolveLValue): New.
13690         (ArrayAccess.DoResolveLValue): New.
13692 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
13694         * attribute.cs (Attribute.Resolve): Add arguments casting for
13695         when types doesn't match ctor arguments.
13697 2005-02-16  Raja R Harinath  <rharinath@novell.com>
13699         Fix parts of #63202.
13700         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13701         lookup of operator in base type.  Ensure that all checks happen
13702         when the operator resolves to an "op_..." method.
13704 2005-02-15  Raja R Harinath  <rharinath@novell.com>
13706         Fix #71992.
13707         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13708         'ignore_cs0104' parameter.  Pass it to ...
13709         (NamespaceEntry.Lookup): ... this.
13710         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13711         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13712         (TypeLookupExpression.DoResolveAsTypeStep): Update.
13713         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13714         Update.  Request that cs0104 errors be ignored.
13715         (ComposedCast.ResolveAsTypeStep): Update.
13717 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13719         Fix #59209.
13720         * expression.cs (Invocation.BetterFunction): Remove support for
13721         comparing virtual functions and their overrides.
13722         (Invocation.IsOverride): New.
13723         (Invocation.OverloadResolve): Don't consider 'override' functions
13724         during candidate selection.  Store them in a lookaside list.
13725         If the selected method is a 'virtual' function, use the list to
13726         find any overrides that are closer to the LHS type.
13728 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
13730         * expression.cs (New.DoResolve): Add complex core type reduction.
13731         (New.Constantify): Converts complex core type syntax like 'new int ()'
13732         to simple constant.
13733         
13734 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13736         * decl.cs (EntryType.EntryType): New constructor to create an
13737         updated copy of a cache entry.
13738         (MemberCache.AddMethods): Use it.
13739         (MemberCache.ClearDeclaredOnly): Remove.
13740         (MemberCache.MemberCache): Update.
13742 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13744         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13745         variable.  This one is represents the actual low-level declaration
13746         of the method, as opposed to the semantic level `IsStatic'.   
13748         An anonymous method which is hosted into a static method might be
13749         actually an instance method.  IsStatic would reflect the
13750         container, while MethodIsStatic represents the actual code
13751         generated.
13753         * expression.cs (ParameterReference): Use the new MethodIsStatic
13754         instead of IsStatic.
13756         * anonymous.cs (AnonymousMethod.Compatible): Pass the
13757         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13758         set on the current EmitContext. 
13760         * expression.cs (Cast): Overload DoResolveLValue so we can pass
13761         resolve our casted expression as an LValue.  This triggers the
13762         proper LValue processing that is later required by Assign.
13764         This fixes 72347.
13766         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13768 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
13770         C# 2.0 Fixed buffer implementation
13772         * anonymous.cs: Update after RegisterHelperClass renaming.
13774         * attribute.cs (AttributeTester.fixed_buffer_cache):
13775         Cache of external fixed buffers.
13776         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13777         implementation if field is fixed buffer else null.
13779         * class.cs
13780         (TypeContainer.AddField): Accept FieldMember instead of Field.
13781         (FieldBase.IsFieldClsCompliant): Extracted code from
13782         VerifyClsCompliance descendant customization.
13783         (FixedField): New class handles fixed buffer fields.
13784         (FixedFieldExternal): Keeps information about imported fixed
13785         buffer.
13786         (IFixedField): Make access to internal or external fixed buffer
13787         same.
13789         * cs-parser.jay: Add fixed buffer parsing.
13791         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13792         buffer.
13794         * expression.cs (Indirection): Extended implementation to accept
13795         fixed buffer field.
13796         (PointerArithmetic.Emit): Get element from fixed buffer as well.
13797         (ElementAccess.MakePointerAccess): Get type as parameter.
13798         (DoResolve): Add fixed buffer field expression conversion.
13799         (DoResolveLValue): Ditto.
13800         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13801         (ArrayPtr): Derives from FixedBufferPtr.
13802         (ArrayPtr.Emit): Add extra emit for array elements.
13804         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13806         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13807         for compiler generated types.
13808         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13810         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13811         and consume less memory.
13812         (Fixed.Resolve): Add fixed buffer case.
13814         * typemanager.cs (compiler_generated_attr_ctor,
13815         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13816         (HasElementType): Add our own implementation to work on every
13817         runtime.
13819 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13821         * anonymous.cs (CaptureContext): Track whether `this' has been
13822         referenced.   
13824         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13825         only captured `this' if it was implicitly done (instance
13826         methods/variables were used). 
13828         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13829         `this' must be captured.
13831 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13833         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13834         is null it means that there has been no need to capture anything,
13835         so we just create a sibling.
13837         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13839         Just a partial fix.  The other half is fairly elusive.
13840         
13841 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13843         Fix #52586, cs0121-4.cs.
13844         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13845         and return a hashtable.
13846         (MemberCache.ClearDeclaredOnly): New.
13847         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13848         the method_hash of a base type too.
13849         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13850         type methods.  Overwrite entries with the same MethodHandle so
13851         that the ReflectedType is correct.  The process leaves in base
13852         virtual functions and their overrides as distinct entries.
13853         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13854         matters since it was boxed in a ArrayList before.
13855         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13856         modifier.
13857         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13858         case of a virtual function and its override (choose the overload
13859         as better).
13860         (Invocation.OverloadResolve): Avoid 'override' members during
13861         'applicable_type' calculation.
13863 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13865         Combine two near-redundant caches.
13866         * typemanager.cs (method_params): Rename from method_internal_params.
13867         (TypeManager.GetParameterData): New.  Replace
13868         Invocation.GetParameterData.
13869         (TypeManager.LookupParametersByBuilder): Remove.
13870         * expression.cs (Invocation.method_parameter_cache): Remove.
13871         (Invocation.GetParameterData): Remove.
13872         Update to changes.
13873         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13874         Update to changes.
13876 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13878         Fix #72015.
13879         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13880         TypeManager.multicast_delegate_type is null, resolve it by looking
13881         up "System.MulticastDelegate".
13882         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13884 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13885             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13886             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13888         Fix cs0164.cs.
13889         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13890         (LabeledStatement.AddReference): New.  Set 'referenced'.
13891         (Goto.Resolve): Use it.
13893 2005-02-05  John Luke  <john.luke@gmail.com>
13895         * driver.cs: remove duplicate -doc line in Usage ()
13897 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13899         * location.cs (Location.AddFile): Fix CS2002 error report.
13901 2005-02-02  Martin Baulig  <martin@ximian.com>
13903         * delegate.cs (Delegate.DefineType): Report an internal error if
13904         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13905         details.        
13907 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13909         Fix a crasher in a variant of #31984.
13910         * const.cs (Constant.CheckBase): New override that defers the
13911         new-or-override check in case the base type hasn't been populated
13912         yet.
13913         (Constant.Define): Ensure the new-or-override check is performed.
13915 2005-02-01  Duncan Mak  <duncan@ximian.com>
13917         * const.cs (LookupConstantValue): Check that `ce' is not null
13918         before calling GetValue ().
13920 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13922         Fix test-334.cs (#69519).
13923         * cs-parser.jay (using_alias_directive): Pass in an expression to
13924         NamespaceEntry.UsingAlias.
13925         (using_namespace_directive): Pass in an expression to
13926         NamespaceEntry.Using.
13927         (namespace_name): Don't flatten to a string.
13928         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13929         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13930         ResolveAsTypeStep.
13931         (NamespaceEntry.UsingEntry): Likewise.
13932         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13933         changes.
13934         (NamespaceEntry.LookupForUsing): Remove.
13935         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13936         names.
13937         (NamespaceEntry.Lookup): Remove support for dotted names.
13939 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13941         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13942         split into two.
13943         (NamespaceEntry.ImplicitParent): Compute on demand.
13944         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13945         parallels the current.
13946         (NamespaceEntry.LookupForUsing): Use it.
13947         (NamespaceEntry.Lookup): If the current namespace-entry is
13948         implicit, don't search aliases and using tables.
13950 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13952         Fix #31984.
13953         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13954         BaseCache here.
13955         (TypeContainer.BaseCache): Compute on demand.
13956         (TypeContainer.FindMembers): Define constants and types if they're
13957         not already created.
13958         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13959         check.
13960         * const.cs (Constant.Define): Make idempotent.
13962 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13964         * pending.cs: Produce better code (no nops produced by using Ldarg
13965         + value).
13966         
13967         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13968         i - 1' it should be arg + 1.
13970         Fixes bug #71819.
13972 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13974         * attribute.cs (Attribute.CheckAttributeType): Make private
13975         non-virtual.
13976         (Attribute.ResolveType): Make virtual.
13977         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13978         handling of RootContext.Tree.Types.
13980 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13982         Update attribute-handling to use the SimpleName/MemberAccess
13983         mechanisms.
13984         * cs-parser.jay (attribute): Pass in an expression to the
13985         constructors of Attribute and GlobalAttribute.
13986         * attribute.cs (Attribute): Take an expression for the name.
13987         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13988         passed in attribute name expression.
13989         (Attribute.CheckAttributeType): Use it.
13990         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13991         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13992         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13993         argument to prevent error messages if the lookup fails.
13995 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13997         * expression.cs (Indirection): Implemented IVariable interface
13998         to support indirection in AddressOf operator.
13999         (PointerArithmetic.Emit): Add optimalization for case where
14000         result can be precomputed.
14002 2005-01-26  Martin Baulig  <martin@ximian.com>
14004         * class.cs (TypeContainer.AttributeTargets): Return the correct
14005         AttributeTargets depending on our `Kind' instead of throwing an
14006         exception; fixes #71632.
14008 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
14010         Fix #71257
14011         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
14012         constant members.
14014 2005-01-25  Raja R Harinath  <rharinath@novell.com>
14016         Fix #71602.
14017         * expression.cs (MemberAccess.DoResolve): Don't complain with
14018         cs0572 when the LHS of a member access has identical name and type
14019         name.
14021 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
14023         Fix #71651, #71675
14024         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
14025         CreatePermission.
14026         Create custom PermissionSet only for PermissionSetAttribute.
14028 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
14030         Fix #71649
14031         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
14032         delegates in static class.
14034 2005-01-24  Martin Baulig  <martin@ximian.com>
14036         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14037         merging an implicit block, just use its reachability.
14039         * statement.cs (Block.Resolve): Make the unreachable code check
14040         work wrt. implicit blocks; see test-337 from #63842.
14042 2005-01-21  Alp Toker  <alp@atoker.com>
14044         * cs-parser.jay: destructor_declaration's container is PartialContainer
14045         not Class when partial types are used, so use Kind prop instead of
14046         'is'.
14047         
14048 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
14050         * cs-parser.jay: Improve error reporting when an interface
14051         declares new types.
14053 2005-01-20  Dick Porter  <dick@ximian.com>
14055         * support.cs: SeekableStreamReader fix from Sandor Dobos
14056         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
14057         chars are read.  Fixes bug 70369.
14059 2005-01-20  Raja R Harinath  <rharinath@novell.com>
14061         * cs-parser.jay (catch_clause): Simplify current_block handling
14062         somewhat.
14064 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
14066         * convert.cs (ImplicitStandardConversionExists): Synchronize the
14067         code with ImplicitStandardConversion to handle the implicit
14068         conversion of method groups into valid delegate invocations. 
14070         The problem is that in parameter handling we were using this code
14071         path.  Fixes bug #64698
14073 2005-01-19  Raja R Harinath  <rharinath@novell.com>
14075         * cs-parser.jay: Fix several infelicities.
14076         - Avoid assigning to the parser value stack.  Code like 
14077           '$3 = null' is unclean.  Synthesize a value for the code block
14078           instead. 
14079         - Avoid using oob_stack for storing location information.  Use ...
14080         (_mark_): ... this.  New (empty) rule.  Saves the current location
14081         in $$.
14082         (foreach_statement): Avoid using oob_stack for current_block
14083         handling.  Use technique used in for_statement and
14084         using_statement.  Synthesize a value for the code block to store
14085         additional intermediate information.
14087 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
14089         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
14090         of a different type is only allowed to private fields of a
14091         containing type, not on fields of a base class.
14093         See test-174.cs and error cs0122-9.cs
14095 2005-01-13  Raja R Harinath  <rharinath@novell.com>
14097         Fix test-335.cs (bug #58126).
14098         * cs-parser.jay (argument): Split out non-expression parts of the
14099         rule into 'non_simple_argument'.
14100         (invocation_expression): Support parenthesized invocations with
14101         multiple arguments, and with single non-simple arguments.
14103 2005-01-13  Raja R Harinath  <rharinath@novell.com>
14105         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
14106         places.
14108 2005-01-12  Raja R Harinath  <rharinath@novell.com>
14110         Fix cs0038-1.cs, cs1640-6.cs.
14111         * ecore.cs (Expression.Resolve): Remove special-case for
14112         SimpleName in error-handling.
14113         (Expression.almostMatchedMembers): Relax access permission to
14114         protected.
14115         (Expression.MemberLookupFailed): Handle duplicates in
14116         almostMatchedMembers list.
14117         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
14118         * expression.cs (New.DoResolve): Report CS1540 for more cases.
14119         * typemanager.cs (GetFullNameSignature): Use the MethodBase
14120         overload if the passed in MemberInfo is a MethodBase.
14122 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
14124         Fix #70749
14125         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
14126         for non-CAS & merge permission sets properly.
14128 2005-01-11  Raja R Harinath  <rharinath@novell.com>
14130         Improve standard-compliance of simple name and member access 
14131         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
14132         * ecore.cs (FullNamedExpression): New abstract base class 
14133         for Namespaces and TypeExpressions.
14134         (ResolveFlags.SimpleName): Remove.
14135         (SimpleName): Remove support for dotted names.
14136         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
14137         DeclSpace.FindType and DeclSpace.LookupType.
14138         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
14139         (Expression.ExprClassName): Make member function.
14140         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
14141         a namespace.  Remove creation of dotted "SimpleName"s.
14142         (MemberAccess.DoResolve): Likewise.
14143         * decl.cs (DeclSpace.Cache): Make private.
14144         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
14145         (DeclSpace.FindType): Update.
14146         (DeclSpace.LookupType): Move here from RootContext.  Return a 
14147         FullNamedExpression.
14148         * namespace.cs (Namespace): Derive from FullNamedExpression
14149         so that it can be part of expression resolution.
14150         (Namespace.Lookup): Return an FullNamedExpression.
14151         (NamespaceEntry.LookupAlias): Lookup aliases only in current
14152         namespace.
14153         * rootcontext.cs (NamespaceLookup): Remove.
14154         (LookupType): Move to DeclSpace.
14155         * attribute.cs (CheckAttributeType): Update.
14156         * doc.cs (FindDocumentedType): Remove allowAlias argument.
14157         (FindDocumentedTypeNonArray): Likewise.
14159 2005-01-11  Raja R Harinath  <rharinath@novell.com>
14161         Fix cs0509.cs, cs1632.cs.
14162         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
14163         is the same as IsInterface.
14164         (TypeContainer.GetClassBases): Likewise.
14165         * statement.cs (LabeledStatement.ig): New field.
14166         (LabeledStatement.LabelTarget): Save ILGenerator which created the
14167         label.
14168         (LabeledStatement.DoEmit): Check that the label was created with
14169         the same ILGenerator.
14171 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
14173         Fix #71058
14174         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
14175         accessors to its properties.
14177         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
14178         from accessors to property.
14179         
14180 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
14182         Fix #70722
14183         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
14184         only for overrides.
14185         
14186 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
14188         * attribute.cs: Check for null and empty strings.  
14190         I have lost another battle to Paolo.
14192 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
14194         Fix #70942
14195         * class.cs (PropertyMethod): Set Parent field in ctors.
14196         (SetMethod.InternalParameters): Add unsafe switch hack.
14197         Override MarkForDuplicationCheck where it is appropriate.
14199         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
14200         It says whether container allows members with the same name.
14201         Base default is no.
14202         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
14203         Removed is_method parameter.
14205 2005-01-06  Duncan Mak  <duncan@ximian.com>
14207         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
14208         because the previous change led to incorrect reporting of CS1032
14209         ("Cannot define/undefine preprocessor symbols after first token in
14210         file"). Instead of using `tokens_seen' as the only flag that
14211         triggers CS1040, introduce `comments_seen'. This new flag is used
14212         to signify having seen comments on the current line, so it is
14213         unset after a newline.
14215 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
14217         * doc.cs : When searching for a type, find nested type too.
14218           This fixes bug #71040.
14220 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
14222         * doc.cs :
14223           - Warn missing member comment on those classes which also does not
14224             have doc comments. Fixed bug #71041.
14225           - Don't warn missing doc comment on default constructor.
14226             Fixed bug #71042.
14228 2005-01-06  Duncan Mak  <duncan@ximian.com>
14230         * cs-tokenizer.cs (xtoken): After handling traditional C-style
14231         comments, set `tokens_seen' to true. This allows us to detect
14232         misplaced preprocessor directives (i.e. not at the beginning of
14233         the a line, nor after whitespaces). In that case, report error
14234         CS1040. This fixes bug #56460.
14236         * cs-parser.jay (interface_member_declaration): Add checks for
14237         IsExplicitImpl, and report CS0541 error if an interface member is
14238         defined as an explicit interface declaration.
14240 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
14242         Fix #70817
14243         * class.cs (PropertyMethod): Set Parent field in ctors.
14244         (SetMethod.InternalParameters): Add unsafe switch hack.
14245         
14246         * decl.cs (MemberCore.Parent): Cannot be readonly.
14248 2005-01-06  Raja R Harinath  <rharinath@novell.com>
14250         * decl.cs (DeclSpace.ResolveType): Remove.
14251         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14252         Merge in code from ...
14253         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
14254         * class.cs, enum.cs: Update to changes.
14256 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
14258         * anonymous.cs: Ensure that we init the scope of our parent if it
14259         has not been initialized yet.
14261 2004-12-30  Duncan Mak  <duncan@ximian.com>
14263         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14264         if field.FieldBuilder is null. Fixes #70758.
14266         * convert.cs: Fixed some typos and updated some of the comments.
14267         (ImplicitStandardConversionExists):
14268         (TryImplicitIntConversion): If `target_type' is an interface and
14269         the type of `ic' implements this interface, return true or a new
14270         BoxedCast instead of null. This fixes #70468.
14272 2004-12-29  Duncan Mak  <duncan@ximian.com>
14274         * expression.cs (Argument.Emit): Check that Expr is
14275         IMemoryLocation before casting to it, and report CS1510 otherwise.
14277         This fixes #70402.
14279 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
14281         * statement.cs (Block.ThisVariable): remove the recursion here, to
14282         make the --profile more sane.
14284 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
14286         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14287         assembly, by JB Evain.
14289 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14291         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
14292           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14293         "parent" refers to enclosing type/class.  "base" refers to superclass.
14295 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14297         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14298         Ensure that we only have GlobalAttributes.
14299         * attribute.cs (Attribute.Emit): Make non-virtual.
14300         (GlobalAttribute.Emit): Remove.
14301         (Attribute.Resolve): Make virtual.
14302         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
14303         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14304         the argument. Don't create one.
14305         (Attribute.GetObsoleteAttribute): Likewise.
14306         (Attribute.GetClsCompliantAttributeValue): Likewise.
14307         * class.cs, decl.cs: Update to changes.
14309 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
14311         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14312         
14313         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14314         
14315         * statement.cs (Foreach.Resolve): Add error 186 report.
14317 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
14319         * expression.cs (Conditional.DoResolve): Add warning 429.
14320         
14321         * statement.cs (If.Resolve): Add warning 665.
14323 2004-12-16  Raja R Harinath  <rharinath@novell.com>
14325         New invariant: RootContext.Tree.Types.NamespaceEntry == null
14326         except when in the parser, and in GlobalAttribute.
14327         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14328         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14329         RootContext.Tree.Types.NamespaceEntry once work is done.
14330         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
14331         and resets RootContext.Tree.Types.NamespaceEntry.
14333 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
14335         * cs-parser.jay: Don't create a block for every variable.
14337 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
14339         * location.cs: Provide extra information.
14341         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14342         variables from the captured environment, it is the ldarg_0.
14344 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14346         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14347         find a conclusion.
14348         
14349         * class.cs: Changed warning level for 169 to avoid developer
14350         displeasure from warning flooding. It will be changed back when they
14351         fix most of current BCL warnings.
14352         
14353         * RootContext.cs: Pushed default WarningLevel to 3.
14354         
14355         * statement.cs: Removed unused variable.
14357 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14359         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14360         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14361         Add error 502 report.
14362         (StaticClass.DefineType): Add error 441 report.
14363         (Class.AllowedModifiersProp): New virtual property as temporary
14364         extension to AllowedModifiers.
14365         (Class.DefineType): Add error 418 report. Moved ModFlags check here
14366         to share implementation with StaticClass and don't call virtual
14367         methods from ctor.
14368         
14369         * driver.cs (MainDriver): Add error 1558 test.
14371         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14372         report. Moved error 36 test here.
14374         * statement.cs (Throw.Resolve): Add error 724 report.
14376         * typemanager.cs: Add out_attribute_type core type.
14377         
14378 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
14380         * class.cs (TypeContainer.VerifyClsCompliance): Add error
14381         3018 report.
14382         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14384         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14385         3017 report.
14386         
14387         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14389         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
14390         Add error 3023 report.
14391         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14393         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14394         implementation.
14396 2004-12-12  John Luke  <john.luke@gmail.com>
14398         * driver.cs (AddArgs): take -- into account when
14399         adding arguments, fixes bug 65710 
14401 2004-12-12  Martin Baulig  <martin@ximian.com>
14403         * expression.cs (Unary.TryReduceNegative): Added support for
14404         SByteConstant and ByteConstant.
14405         (Unary.Reduce): Check error values from TryReduceNegative().
14407 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
14409         * attributes.cs (Attribute.Resolve): Avoid multiple error report
14410         and report exception as error 182.
14412 2004-12-10  Raja R Harinath  <rharinath@novell.com>
14414         * driver.cs (Main): Fix message when there are warnings.
14416 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
14418         * delegate.cs: Fixed my fix from yesterday, sorry about that.
14420 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
14422         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
14423         Reduced number of warnings.
14424         
14425         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14427 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
14429         * driver.cs: Removed message.
14431         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14433 2004-12-08    <vargaz@freemail.hu>
14435         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14437 2004-12-08  Martin Baulig  <martin@ximian.com>
14439         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14440         instead of a CS3002 for properties and indexer.
14442 2004-12-08  Martin Baulig  <martin@ximian.com>
14444         * decl.cs (MemberName.ToString): Make this work again.
14446 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
14448         * attribute.cs (Resolve): Add error 591 detection.
14450         * class.cs (FieldMember.Define): Add error 1547 detection.
14451         (Indexer.Define): Add error 620 detection.
14452         (Operator.Define): Add error 590 detection.
14454         * ecore.cs: Missing argument for error 79.
14456         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14457         detection.
14459 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
14461         Fix #70106
14462         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14463         only.
14465 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
14467         * cs-parser.jay : handle doc comments on implicit/explicit operators.
14468           Some operator comments were suppressed.
14469         * doc.cs : Implicit/explicit operator name in doc comments are like
14470           "op_Explicit(type)~returnType", so added suffix handling.
14472 2004-12-07  Martin Baulig  <martin@ximian.com>
14474         * decl.cs
14475         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14476         (MemberCore.GetClsCompliantAttributeValue): Likewise.
14477         (DeclSpace.ec): New protected field; store the EmitContext here.
14478         (DeclSpace.EmitContext): New public property; moved here from
14479         `TypeContainer'.
14480         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14481         EmitContext.
14483         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14484         (Enum.Emit): Don't create a new EmitContext.
14486         * delegate.cs (Delegate.DefineType): Always create the
14487         EmitContext.
14489         * iterators.cs (Iterators.DefineIterator): Create a new
14490         EmitContext and store it in `ec'.
14492 2004-08-24  Martin Baulig  <martin@ximian.com>
14494         * typemanager.cs
14495         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14496         this for accessibility checks.
14497         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14498         IsNestedFamilyAccessible.
14499         (TypeManager.IsSubclassOf): New method, do what the name actually
14500         says.   
14502 2004-12-06  Raja R Harinath  <rharinath@novell.com>
14504         Fix crash on cs0657-17.cs.
14505         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14506         Use RootContext.Tree.Types, not 'new RootTypes ()'.
14507         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14508         the case where the NamespaceEntry gets overwritten.
14510 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
14512         Fixed #69195, #56821
14513         * ecore.cs (ResolveBoolean): Tiny refactoring.
14515         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14516         of right expression resolving when left is false constant and
14517         operator is LogicalAnd OR true constant and operator is LogicalOr.
14519         * statement.cs (ResolveUnreachable): Always reports warning.
14521 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
14523         * class.cs: Distinguish between 1721 and 1722 (just a little help
14524         for the programmer).
14526 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
14528         * delegate.cs: Only allow this on new versions of the language. 
14530 2004-12-02  Duncan Mak  <duncan@ximian.com>
14532         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14533         Expression class.
14534         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14535         here as a static method. Take an additional bool out parameter
14536         `must_do_cs1540_check' for signaling to InstanceResolve.
14537         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14538         member field from PropertyExpr class and made it an argument of
14539         the method instead.
14540         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14541         check for MarshalByRefObject, and report CS0122 instead of CS1540.
14542         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14543         and `remove_accessor' as well as InstanceResolve: report CS0122
14544         where applicable.
14546         Fixes #70129.
14548 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14550         Fix test-327.cs, test-328.cs, and put in early infrastructure
14551         for eventually fixing #52697.
14552         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14553         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14554         from other methods.
14555         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14556         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14557         (VerifyUsing, error246): Update.
14558         * rootcontext.cs (RootContext.NamespaceLookup): Just use
14559         'NamespaceEntry.LookupNamespaceOrType'.
14561 2004-12-03  Martin Baulig  <martin@ximian.com>
14563         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14564         method as our child, call AnonymousMethod.Compatible() on it.
14566 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14568         Disable XML documentation support in 'basic' profile.
14569         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14570         Redirect XmlElement to System.Object.
14571         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14572         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14573         * mcs.exe.sources: Add doc-bootstrap.cs.
14574         * doc-bootstrap.cs: New file.  Contains empty stub implementation
14575         of doc.cs.
14577 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
14579         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14580           comments are allowed.
14582 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14584         * delegate.cs: Add checks for subtypes in paramaters and return values
14585         in VerifyMethod () to add support for Covariance/Contravariance
14586         in delegates.
14587         
14588 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
14590         * report.cs: Remove extra closing parenthesis.
14592         * convert.cs (Error_CannotImplicitConversion): If the name of the
14593         types are the same, provide some extra information.
14595         * class.cs (FieldBase): Use an unused bit field from the field to
14596         encode the `has_offset' property from the FieldMember.  This saves
14597         a couple of Ks on bootstrap compilation.
14599         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14600         method as our child, return the AnonymousMethod resolved
14601         expression.
14603         * expression.cs (New.DoResolve): Allow return values from
14604         NewDelegate to also include AnonymousMethods.
14606         Fixes #70150.
14608 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
14610         Fix bug #70102
14611         * attribute.cs (Resolve): Improved implementation of params
14612         attribute arguments.
14614         * support.cs (ParameterData): Add HasParams to be faster.
14616 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
14618         all things are for /doc support:
14620         * doc.cs: new file that supports XML documentation generation.
14621         * mcs.exe.sources: added doc.cs.
14622         * driver.cs:
14623           Handle /doc command line option.
14624           Report error 2006 instead of 5 for missing file name for /doc.
14625           Generate XML documentation when required, after type resolution.
14626         * cs-tokenizer.cs:
14627           Added support for picking up documentation (/// and /** ... */),
14628           including a new XmlCommentState enumeration.
14629         * cs-parser.jay:
14630           Added lines to fill Documentation element for field, constant,
14631           property, indexer, method, constructor, destructor, operator, event
14632           and class, struct, interface, delegate, enum.
14633           Added lines to warn incorrect comment.
14634         * rootcontext.cs :
14635           Added Documentation field (passed only when /doc was specified).
14636         * decl.cs:
14637           Added DocComment, DocCommentHeader, GenerateDocComment() and
14638           OnGenerateDocComment() and some supporting private members for
14639           /doc feature to MemberCore.
14640         * class.cs:
14641           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14642         * delegate.cs:
14643           Added overriden DocCommentHeader.
14644         * enum.cs:
14645           Added overriden DocCommentHeader and GenerateDocComment().
14647 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
14649         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14650         unwrapping the enumeration values, chain to
14651         DoConstantNumericPromotions again, so we can promote things to the
14652         fundamental types (takes care of enums that are bytes, sbytes).
14654         Fixes bug #62054.
14656 2004-12-01  Raja R Harinath  <rharinath@novell.com>
14658         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14659         Fix long-standing bug in type-lookup.  Use FindType instead of
14660         LookupType when ec.ResolvingTypeTree.
14661         (Attribute.ResolveType, Attribute.Resolve)
14662         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14663         Update to changes.
14664         (Attributes.Search): Remove internal version.  Update.
14665         (Attributes.SearchMulti): Update.
14666         (Attributes.GetClsCompliantAttribute): Remove.
14667         (Attributes.GetIndexerNameAttribute): Remove.
14668         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14669         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14670         * class.cs (Indexer.Define): Likewise.
14672 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
14674         Fix bug #68790
14675         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14676         MarshallByReference members access.
14678         * expression.cs: Use CheckMarshallByRefAccess;
14679         Better error CS0197 message.
14681         * report.cs: Print whole related error message.
14683 2004-11-30  Raja R Harinath  <rharinath@novell.com>
14685         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14686         the current directory to help debugging.
14688 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14690         * class (GetClassBases): Better error 60 report.
14691         (EventProperty): Disabled warning 67 detection.
14693 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14695         Fix bug #60324
14696         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14698         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14699         precise values.
14701 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14703         Fix bug #49488
14704         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14706         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14708 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
14710         * attribute.cs (Attribute.Resolve): Refine error reporting and
14711         report a cs0117 if the identifier does not exist, to distinguish
14712         from 0617 which is a miss-use of the actual identifier.
14714         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14715         between cs0070 and cs0079.
14717         * class.cs (MemberBase.DoDefine): When reporting a wrong
14718         accessibility level, we use MethodCore to compare instead of
14719         Method (this was a regression in some refactoring effort).
14721         So now we correctly report cs0056 again.
14723         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14724         testing the target_type (which was known to be object_type) and
14725         not the source type (which is anonymous_method).
14727         Fixed reporting of error cs1660.
14729         * expression.cs (UserCast.Source): Expose the underlying cast.
14731         * statement.cs (Switch.SwitchGoverningType): Sort the list of
14732         allowed types to find a match to int32 first (most common).
14734         In addition, it ignores any ImplicitUserConversions that did an
14735         internal implicit conversion (as the switch statement allows only
14736         one integral conversion to exist).
14738         * class.cs (PartialContainer.Create): rename `name' to
14739         `member_name' for clarity.  Then replace the string calls with a
14740         call to MemberName.GetPartialName, as now using
14741         MemberName.ToString is an error (this is due to the side effects
14742         it had, that were fixed in the past).
14744         This will restore the error reporting on a number of partial class
14745         errors that were missusing this (and getting an exception as a
14746         results, which is now just a plain textual warning, because
14747         yyparse debug output would crash otherwise).
14749 2004-11-26  Raja R Harinath  <rharinath@novell.com>
14751         * Makefile (PROGRAM_INSTALL_DIR): Remove.
14753 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14755         * rootcontext.cs (LookupType): Make sure to cache lookups that
14756         don't give us a negative result. This saves about 5% of corlib
14757         compilation time.
14759 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14761         * report.cs (AbstractMessage.Print): messages are sent to stderr
14763         * class.cs (TypeContainer.GetClassBases): It is an error to have a
14764         non-interface in the list of interfaces (at this point, either
14765         parent was properly set, or a base class is being listed in the
14766         interfaces section).
14768         This flags error 1722, and resolves the crash from bug 69259.
14770 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14772         * statement.cs (Using.EmitExpressionFinally): make this work right
14773         for valuetypes. Fixes 69926.
14775 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14777         * const.cs (Const.ChangeType): Cope with the "0 literal can be
14778         converted to an enum" here, before we try to change the underlying
14779         type.  This code exists, but it is a different code path than the
14780         one used while encoding constants.
14782         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14783         old bug: when converting from the null literal to a pointer,
14784         return an EmptyCast, not the NullLiteral.
14786         This fixes #69921, the recent null_type changes probably made this
14787         bug more prominent.
14789         (ImplicitReferenceConversionExists): In addition, resynchronized
14790         the code here, so it matches the same code in
14791         ImplicitReferenceConversionExists for the `from any class-type S
14792         to any interface-type T'.
14793         
14795 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
14797         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14799 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
14801         * cs-parser.jay: Use verbosity accordingly. 
14803 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14805         * expression.cs (Unary.ResolveOperator): Do not report warning;
14806         AddressOf reads from variable.
14807         
14808         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14810 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14812         Fix bug #69462
14814         * attribute.cs (Attributable): Removed CheckTargets.
14815         (Attributes.Emit): Explicit attribute targets are tested here.
14817         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14818         not enabled for interfaces.
14820         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14821         (GetAssemblyName): Ouch next bug there.
14823 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14825         * expression.cs: Error 275 added.
14826         
14827 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14829         Fix bug #69177 (Implemented decimal constant support)
14831         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14832         (BinaryFold): Add DecimalConstant.
14834         * const.cs (Define): Decimal constant 
14835         (is not constant.
14836         (ChangeType): Add decimal type handling.
14837         (LookupConstantValue): Don't set value for decimal type but
14838         emit DecimalConstantAttribute. Needed for constant optimization.
14840         * constant.cs (ToDecimal): New method.
14841         (ConvertToDecimal): New method.
14842         (IntConstant): Implemented ConvertToDecimal.
14843         (DecimalConstant.Emit): Emit optimized version for decimals in
14844         int range.
14846         * expression.cs (ResolveOperator): Changed order of constant
14847         reduction to work correctly with native types which have
14848         overloaded operators.
14849         (ResolveMemberAccess): Extract constant value from attribute
14850         for decimal type.
14852         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14854         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14855         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14856         (ChangeType): Decimal is special.
14857         (TypeToCoreType): Add decimal type.
14859 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14861         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14862         decimal types.
14864 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14866         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14867         test cs1667-5.cs.
14869 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14871         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14873         * pending.cs (PendingImplementation): Grab only interfaces.
14875 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14877         * statement.cs (ForeachHelperMethods): Add location member and
14878         error 202 detection.
14880 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14882         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14883         automatically handled by executable.make.
14884         (PROGRAM): Make profile-specific.
14886 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14888         * expression.cs (DoResolveBase): Fixed wrong warning for out
14889         variables.
14891 2004-11-18  Martin Baulig  <martin@ximian.com>
14893         Merged latest changes into gmcs.  Please keep this comment in
14894         here, it makes it easier for me to see what changed in MCS since
14895         the last time I merged.
14897 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14899         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14900         (TypeHandle.GetMemberCache): New.
14901         (TypeHandle.TypeHandle): Update.
14902         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14903         (TypeManager.LookupParentInterfacesCache):
14904         Rename from LookupInterfaceCache.  Optimize slightly.
14905         (TypeManager.MemberLookup_FindMembers): Update.
14906         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14907         multi-type variant.
14908         (AddCacheContents): Rename from AddHashtable.
14909         * class.cs (TypeContainer.parent_container): Remove.
14910         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14911         (TypeContainer.DoDefineMembers): Don't initialize it.
14912         Update to name changes.
14913         
14914 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14916         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14917         that factors the code to check access modifiers on override.  
14919         (PropertyBase): Use the code here.
14921         Patch from Lluis S'anchez, fixes bug #69361.
14923 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14925         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14926         routine that is used to report the use of a captured variable
14927         whose address has been taken.
14929         There are two checks: one when variables are being captured and
14930         the other check is when the address of a variable is taken. 
14931         
14932         (because an anonymous methods might be resolved before *or* after
14933         the address has been taken) and 
14935         * expression.cs (Conditional.DoResolve): Remove the special
14936         casing that Martin added to trueExpr and falseExpr being both
14937         NullLiteral.  We get the right behavior now just by introducing
14938         the null_type into the compiler. 
14940         * convert.cs (ExplicitConversion): Change the code to use
14941         null_type instead of testing `expr is NullLiteral'.
14942         (ImplicitConversionStandard): use null_type too.
14943         (ImplicitReferenceConversionExists): use null_type too.
14944         (ImplicitReferenceConversion): use null_type too.
14946         * literal.cs: The type of `NullLiteral' is now null_type instead
14947         of object_type. 
14948         (Resolve): Set the type here.
14950         * typemanager.cs: Introduce null_type.
14952 2004-11-17  Martin Baulig  <martin@ximian.com>
14954         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14955         direction, like FindMembers() does.  Fixes #69546, testcase is in
14956         test-315.cs.    
14958 2004-11-16  Martin Baulig  <martin@ximian.com>
14960         This is based on a patch from Marek Safar, see bug #69082.
14961         Fixes bugs #63705 and #67130.
14963         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14964         method; create a MemberCache for an interface type and cache the
14965         result.
14967         * decl.cs (IMemberContainer.ParentContainer): Removed.
14968         (IMemberContainer.ParentCache): New property.
14969         (MemberCache.SetupCacheForInterface): Removed.
14970         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14971         to create a cache for an interface's "parent".
14973         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14974         interfaces too.
14976 2004-11-16  Martin Baulig  <martin@ximian.com>
14978         Merged back from gmcs; these changes already went into gmcs a
14979         couple of weeks ago.
14981         * typemanager.cs
14982         (TypeManager.AddUserType): Removed the `ifaces' argument.
14983         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14984         `TypeExpr []'.
14985         (TypeManager.AddUserInterface): Removed.
14986         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14987         `TypeExpr []'.
14988         (TypeManager.GetInterfaces): Likewise.
14989         (TypeManager.GetExplicitInterfaces): Likewise.
14991         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14993         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14994         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14996 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14998         * statement.cs: Avoid adding bools to a hashtable.
15000 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
15002         * expression.cs (Invocation.OverloadResolve): Flag error if we are
15003         calling an unsafe method from a safe location.
15005 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
15007         Fix #69167
15008         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
15010 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
15012         * namespace.cs (VerifyUsing): use GetPartialName instead of
15013         ToString. 
15015 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
15017         * statement.cs (Return.Resolve): Fix regression in typo: if
15018         `in_exc', we have to request a NeedReturnLabel, this was a typo
15019         introduced in the anonymous method check-in.  Fixes #69131.
15021         * Indexers were using the ShortName when defining themselves,
15022         causing a regression in the compiler bootstrap when applying the
15023         patch from 2004-11-02 (first part), now they use their full name
15024         and the bug is gone.
15026 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
15028         * driver.cs: Strip the path from the names of embedded resources. Fixes
15029         #68519.
15031 2004-11-04  Raja R Harinath  <rharinath@novell.com>
15033         Fix error message regression: cs0104-2.cs.
15034         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
15035         (AliasEntry.Resolve): Update.
15036         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
15037         'silent' flag.
15038         (RootContext.LookupType): Update.
15040 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
15042         * cs-parser.jay: Add support for handling accessor modifiers
15043         * class: Add support port accessor modifiers and error checking,
15044         define PropertyMethod.Define as virtual (not abstract anymore)
15045         * ecore.cs: Add checking for proeprties access with access modifiers
15046         * iterators.cs: Modify Accessor constructor call based in the modified
15047         constructor
15048 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
15050         * expression.cs (StringConcat): Handle being called twice,
15051         as when we have a concat in a field init with more than two
15052         ctors in the class
15054 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
15056         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
15057         special case explicit implementations, we should always produce
15058         the .property or .event declaration.
15059         
15060         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
15061         since it will not return correct data if people use this
15062         unresolved in the presence of using statements (see test-313).
15064         * class.cs (MethodData.Define): If we are an explicit interface
15065         implementation, set the method name to the full name of the
15066         interface plus the name of the method.  
15068         Notice that using the method.MethodName.GetFullName() does not
15069         work, as it will only contain the name as declared on the source
15070         file (it can be a shorthand in the presence of using statements)
15071         and not the fully qualifed type name, for example:
15073         using System;
15075         class D : ICloneable {
15076                 object ICloneable.Clone ()  {
15077                 }
15078         }
15080         Would produce a method called `ICloneable.Clone' instead of
15081         `System.ICloneable.Clone'.
15083         * namespace.cs (Alias.Resolve): Use GetPartialName.
15084         
15085 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
15087         * cs-parser.jay: Add error 1055 report.
15089 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
15091         * assign.cs (Assign.DoResolve): Only do the transform of
15092         assignment into a New if the types are compatible, if not, fall
15093         through and let the implicit code deal with the errors and with
15094         the necessary conversions. 
15096 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
15098         * cs-parser.jay: Add error 1031 report.
15100         * cs-tokenizer.cs: Add location for error 1038.
15102 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15104         * cs-parser.jay: Add error 1016 report.
15106 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15108         * cs-parser.jay: Add errors 1575,1611 report.
15110 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15112         * cs-parser.jay: Add error 1001 report.
15114 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15116         Fix #68850
15117         * attribute.cs (GetMarshal): Add method argument for
15118         caller identification.
15120         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
15121         agument for GetMarshal and RuntimeMissingSupport.
15123 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15125         * attribute.cs (ExtractSecurityPermissionSet): Removed
15126         TypeManager.code_access_permission_type.
15128         * typemanager.cs: Removed TypeManager.code_access_permission_type.
15130 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
15132         * expression.cs (LocalVariableReference.DoResolveLValue): Check
15133         for obsolete use of a variable here.   Fixes regression on errors
15134         cs0619-25 and cs0619-26.
15136 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
15138         Fix #62358, implemented security attribute encoding.
15140         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
15141         Tests permitted SecurityAction for assembly or other types.
15142         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
15143         data from SecurityPermissionAttribute to PermisionSet class.
15145         * class.cs (ApplyAttributeBuilder): Added special handling
15146         for System.Security.Permissions.SecurityAttribute based types.
15148         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
15149         special handling for System.Security.Permissions.SecurityAttribute
15150         based types.
15152         * enum.cs (ApplyAttributeBuilder): Added special handling
15153         for System.Security.Permissions.SecurityAttribute based types.
15155         * parameter.cs (ApplyAttributeBuilder): Added special handling
15156         for System.Security.Permissions.SecurityAttribute based types.
15158         * rootcontext.cs: Next 2 core types.
15160         * typemanager.cs (TypeManager.security_permission_attr_type):
15161         Built in type for the SecurityPermission Attribute.
15162         (code_access_permission_type): Build in type.
15164 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
15166         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
15167         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
15168         all of this information into
15169         EmitContext.EmitCapturedVariableInstance.
15170         
15171         * codegen.cs (EmitCapturedVariableInstance): move here the
15172         funcionality of emitting an ldarg.0 in the presence of a
15173         remapping.   This centralizes the instance emit code.
15175         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
15176         then emit a load of this: it means that we have reached the
15177         topmost ScopeInfo: the one that contains the pointer to the
15178         instance of the class hosting the anonymous method.
15180         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
15181         captures to the topmost CaptureContext.
15183 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
15185         * expression.cs (LocalVariableReference): Move the knowledge about
15186         the iterators into codegen's EmitCapturedVariableInstance.
15188 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
15190         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
15191         all code paths return a value from an anonymous method (it is the
15192         same as the 161 error, but for anonymous methods).
15194 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
15196         The introduction of anonymous methods in the compiler changed
15197         various ways of doing things in the compiler.  The most
15198         significant one is the hard split between the resolution phase
15199         and the emission phases of the compiler.
15201         For instance, routines that referenced local variables no
15202         longer can safely create temporary variables during the
15203         resolution phase: they must do so from the emission phase,
15204         since the variable might have been "captured", hence access to
15205         it can not be done with the local-variable operations from the runtime.
15206         
15207         * statement.cs 
15209         (Block.Flags): New flag `IsTopLevel' to indicate that this block
15210         is a toplevel block.
15212         (ToplevelBlock): A new kind of Block, these are the blocks that
15213         are created by the parser for all toplevel method bodies.  These
15214         include methods, accessors and anonymous methods.
15216         These contain some extra information not found in regular blocks:
15217         A pointer to an optional CaptureContext (for tracking captured
15218         local variables and parameters).  A pointer to the parent
15219         ToplevelBlock.
15220         
15221         (Return.Resolve): Catch missmatches when returning a value from an
15222         anonymous method (error 1662).
15223         Invoke NeedReturnLabel from the Resolve phase instead of the emit
15224         phase.
15226         (Break.Resolve): ditto.
15228         (SwitchLabel): instead of defining the labels during the
15229         resolution phase, we now turned the public ILLabel and ILLabelCode
15230         labels into methods called GetILLabelCode() and GetILLabel() that
15231         only define the label during the Emit phase.
15233         (GotoCase): Track the SwitchLabel instead of the computed label
15234         (its contained therein).  Emit the code by using
15235         SwitchLabel.GetILLabelCode ().
15237         (LocalInfo.Flags.Captured): A new flag has been introduce to track
15238         whether the Local has been captured or not.
15240         (LocalInfo.IsCaptured): New property, used to tell whether the
15241         local has been captured.
15242         
15243         * anonymous.cs: Vastly updated to contain the anonymous method
15244         support.
15246         The main classes here are: CaptureContext which tracks any
15247         captured information for a toplevel block and ScopeInfo used to
15248         track the activation frames for various local variables.   
15250         Each toplevel block has an optional capture context associated
15251         with it.  When a method contains an anonymous method both the
15252         toplevel method and the anonymous method will create a capture
15253         context.   When variables or parameters are captured, they are
15254         recorded on the CaptureContext that owns them, for example:
15256         void Demo () {
15257              int a;
15258              MyDelegate d = delegate {
15259                  a = 1;
15260              }
15261         }
15263         Here `a' will be recorded as captured on the toplevel
15264         CapturedContext, the inner captured context will not have anything
15265         (it will only have data if local variables or parameters from it
15266         are captured in a nested anonymous method.
15268         The ScopeInfo is used to track the activation frames for local
15269         variables, for example:
15271         for (int i = 0; i < 10; i++)
15272                 for (int j = 0; j < 10; j++){
15273                    MyDelegate d = delegate {
15274                         call (i, j);
15275                    }
15276                 }
15278         At runtime this captures a single captured variable `i', but it
15279         captures 10 different versions of the variable `j'.  The variable
15280         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15281         recorded on a child.  
15283         The toplevel ScopeInfo will also track information like the `this'
15284         pointer if instance variables were referenced (this is necessary
15285         as the anonymous method lives inside a nested class in the host
15286         type of the method). 
15288         (AnonymousMethod): Expanded to track the Toplevel, implement
15289         `AnonymousMethod.Compatible' to tell whether an anonymous method
15290         can be converted to a target delegate type. 
15292         The routine now also produces the anonymous method content
15294         (AnonymousDelegate): A helper class that derives from
15295         DelegateCreation, this is used to generate the code necessary to
15296         produce the delegate for the anonymous method that was created. 
15298         * assign.cs: API adjustments for new changes in
15299         Convert.ImplicitStandardConversionExists.
15301         * class.cs: Adjustments to cope with the fact that now toplevel
15302         blocks are of type `ToplevelBlock'. 
15304         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15305         insteda of standard blocks.
15307         Flag errors if params arguments are passed to anonymous methods.
15309         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15310         `CurrentAnonymousMethod' which points to the current Anonymous
15311         Method.  The variable points to the AnonymousMethod class that
15312         holds the code being compiled.  It is set in the new EmitContext
15313         created for the anonymous method.
15315         (EmitContext.Phase): Introduce a variable and an enumeration to
15316         assist in enforcing some rules about when and where we are allowed
15317         to invoke certain methods (EmitContext.NeedsReturnLabel is the
15318         only one that enfonces this right now).
15320         (EmitContext.HaveCaptureInfo): new helper method that returns
15321         whether we have a CapturedContext initialized.
15323         (EmitContext.CaptureVariable): New method used to register that a
15324         LocalInfo must be flagged for capturing. 
15326         (EmitContext.CapturedParameter): New method used to register that a
15327         parameters must be flagged for capturing. 
15328         
15329         (EmitContext.CapturedField): New method used to register that a
15330         field must be flagged for capturing. 
15332         (EmitContext.HaveCapturedVariables,
15333         EmitContext.HaveCapturedFields): Return whether there are captured
15334         variables or fields. 
15336         (EmitContext.EmitMethodHostInstance): This is used to emit the
15337         instance for the anonymous method.  The instance might be null
15338         (static methods), this (for anonymous methods that capture nothing
15339         and happen to live side-by-side with the current method body) or a
15340         more complicated expression if the method has a CaptureContext.
15342         (EmitContext.EmitTopBlock): Routine that drives the emission of
15343         code: it will first resolve the top block, then emit any metadata
15344         and then emit the code.  The split is done so that we can extract
15345         any anonymous methods and flag any captured variables/parameters.
15346         
15347         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15348         during this phase, the ILGenerator should not be used as labels
15349         and local variables declared here might not be accessible to any
15350         code that is part of an anonymous method.  
15352         Exceptions to this include the temporary variables that are
15353         created by some statements internally for holding temporary
15354         variables. 
15355         
15356         (EmitContext.EmitMeta): New routine, in charge of emitting all the
15357         metadata for a cb
15359         (EmitContext.TemporaryReturn): This method is typically called
15360         from the Emit phase, and its the only place where we allow the
15361         ReturnLabel to be defined other than the EmitMeta.  The reason is
15362         that otherwise we would have to duplicate a lot of logic in the
15363         Resolve phases of various methods that today is on the Emit
15364         phase. 
15366         (EmitContext.NeedReturnLabel): This no longer creates the label,
15367         as the ILGenerator is not valid during the resolve phase.
15369         (EmitContext.EmitThis): Extended the knowledge in this class to
15370         work in anonymous methods in addition to iterators. 
15372         (EmitContext.EmitCapturedVariableInstance): This emits whatever
15373         code is necessary on the stack to access the instance to a local
15374         variable (the variable will be accessed as a field).
15376         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15377         EmitContext.EmitAddressOfParameter): Routines to support
15378         parameters (not completed at this point). 
15379         
15380         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
15381         will also remove the parameters.
15383         * convert.cs (Convert): Define a `ConstantEC' which points to a
15384         null.  This is just to prefity some code that uses
15385         ImplicitStandardConversion code and do not have an EmitContext
15386         handy.
15388         The idea is to flag explicitly that at that point in time, it is
15389         known that the conversion will not trigger the delegate checking
15390         code in implicit conversions (which requires a valid
15391         EmitContext). 
15393         Everywhere: pass new EmitContext parameter since
15394         ImplicitStandardConversionExists now requires it to check for
15395         anonymous method conversions. 
15397         (Convert.ImplicitStandardConversionExists): If the type of an
15398         expression is the anonymous_method_type, and the type is a
15399         delegate, we invoke the AnonymousMethod.Compatible method to check
15400         whether an implicit conversion is possible. 
15402         (Convert.ImplicitConversionStandard): Only do implicit method
15403         group conversions if the language level is not ISO_1.
15405         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15406         MethodInfo for the Invoke method.  used by Delegate and
15407         AnonymousDelegate.
15409         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15410         method conversions if the target type is a delegate.
15412         Removed extra debugging nops.
15414         (LocalVariableReference): Turn the `local_info' into a public
15415         field. 
15417         Add `prepared' field, the same hack used for FieldExprs to cope
15418         with composed assignments, as Local variables do not necessarily
15419         operate purely on the stack as they used to: they can be captured
15420         fields. 
15422         Add `temp' for a temporary result, like fields.
15424         Refactor DoResolve and DoResolveLValue into DoResolveBase.
15426         It now copes with Local variables that are captured and emits the
15427         proper instance variable to load it from a field in the captured
15428         case. 
15430         (ParameterReference.DoResolveBase): During the resolve phase,
15431         capture parameters if we are in an anonymous method.
15433         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15434         anonymous method, use the EmitContext helper routines to emit the
15435         parameter reference.
15437         * iterators.cs: Set RemapToProxy to true/false during the
15438         EmitDispose class.
15440         * parameters.cs (GetParameterByName): New helper method. 
15442         * typemanager.cs (anonymous_method_type) a new type that
15443         represents an anonyous method.  This is always an internal type,
15444         used as a fencepost to test against the anonymous-methodness of an
15445         expression. 
15446         
15447 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
15449         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15450         561 report.
15451         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15453 2004-10-18  Martin Baulig  <martin@ximian.com>
15455         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15456         `Type' directly, but call ResolveType() on it.
15457         (Catch.Resolve): Likewise.
15458         (Foreach.Resolve): Likewise.
15460 2004-10-18  Martin Baulig  <martin@ximian.com>
15462         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15463         `Type' directly, but call ResolveType() on it.
15464         (Probe.DoResolve): Likewise.
15465         (ArrayCreation.LookupType): Likewise.
15466         (TypeOf.DoResolve): Likewise.
15467         (SizeOf.DoResolve): Likewise.
15469 2004-10-18  Martin Baulig  <martin@ximian.com>
15471         * expression.cs (Invocation.BetterFunction): Put back
15472         TypeManager.TypeToCoreType().
15474 2004-10-18  Raja R Harinath  <rharinath@novell.com>
15476         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15477         the ResolveType.
15479 2004-10-18  Martin Baulig  <martin@ximian.com>
15481         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
15482         `Type' directly, but call ResolveType() on it.
15484 2004-10-18  Martin Baulig  <martin@ximian.com>
15486         * class.cs (FieldMember.Define): Don't access the TypeExpr's
15487         `Type' directly, but call ResolveType() on it.
15488         (MemberBase.DoDefine): Likewise.
15490         * expression.cs (New.DoResolve): Don't access the TypeExpr's
15491         `Type' directly, but call ResolveType() on it.
15492         (ComposedCast.DoResolveAsTypeStep): Likewise.
15494         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15495         `Type' directly, but call ResolveType() on it.
15497 2004-10-17  John Luke  <john.luke@gmail.com>
15499         * class.cs (Operator.GetSignatureForError): use CSharpName
15501         * parameter.cs (Parameter.GetSignatureForError): Returns
15502         correct name even if was not defined.
15504 2004-10-13  Raja R Harinath  <rharinath@novell.com>
15506         Fix #65816.
15507         * class.cs (TypeContainer.EmitContext): New property.
15508         (DefineNestedTypes): Create an emitcontext for each part.
15509         (MethodCore.DoDefineParameters): Use container's emitcontext.
15510         Pass type array to InternalParameters.
15511         (MemberBase.DoDefine): Use container's emitcontext.
15512         (FieldMember.Define): Likewise.
15513         (Event.Define): Likewise.
15514         (SetMethod.GetParameterInfo): Change argument to EmitContext.
15515         Pass type array to InternalParameters.
15516         (SetIndexerMethod.GetParameterInfo): Likewise.
15517         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15518         * delegate.cs (Define): Pass emitcontext to
15519         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
15520         array to InternalParameters.
15521         * expression.cs (ParameterReference.DoResolveBase): Pass
15522         emitcontext to GetParameterInfo.
15523         (ComposedCast.DoResolveAsTypeStep): Remove check on
15524         ec.ResolvingTypeTree.
15525         * parameter.cs (Parameter.Resolve): Change argument to
15526         EmitContext.  Use ResolveAsTypeTerminal.
15527         (Parameter.GetSignature): Change argument to EmitContext.
15528         (Parameters.ComputeSignature): Likewise.
15529         (Parameters.ComputeParameterTypes): Likewise.
15530         (Parameters.GetParameterInfo): Likewise.
15531         (Parameters.ComputeAndDefineParameterTypes): Likewise.
15532         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
15533         * support.cs (InternalParameters..ctor): Remove variant that takes
15534         a DeclSpace.
15535         * typemanager.cs (system_intptr_expr): New.
15536         (InitExpressionTypes): Initialize it.
15538 2004-10-12  Chris Toshok  <toshok@ximian.com>
15540         * cs-parser.jay: fix location for try_statement and catch_clause.
15542 2004-10-11  Martin Baulig  <martin@ximian.com>
15544         * report.cs: Don't make --fatal abort on warnings, we have
15545         -warnaserror for that.
15547 2004-10-07  Raja R Harinath  <rharinath@novell.com>
15549         More DeclSpace.ResolveType avoidance.
15550         * decl.cs (MemberCore.InUnsafe): New property.
15551         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
15552         with newly created EmitContext.
15553         (FieldMember.Define): Likewise.
15554         * delegate.cs (Delegate.Define): Likewise.
15555         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15556         only if normal name-lookup fails.
15557         (TypeExpr.DoResolve): Enable error-checking.
15558         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15559         (SizeOf.DoResolve): Likewise.
15560         (ComposedCast.DoResolveAsTypeStep): Likewise.
15561         (StackAlloc.DoResolve): Likewise.
15562         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15563         (Block.Unsafe): New property.
15564         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15565         (Unsafe): Set 'unsafe' flag of contained block.
15566         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15567         (Fixed.Resolve): Likewise.
15568         (Catch.Resolve): Likewise.
15569         (Using.ResolveLocalVariableDecls): Likewise.
15570         (Foreach.Resolve): Likewise.
15572 2004-10-05  John Luke <john.luke@gmail.com>
15574         * cs-parser.jay: add location to error CS0175
15576 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
15578         * ecore.cs (Expression.Constantity): Add support for turning null
15579         into a constant.
15581         * const.cs (Const.Define): Allow constants to be reference types
15582         as long as the value is Null.
15584 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
15586         * namespace.cs (NamespaceEntry.Using): No matter which warning
15587         level is set, check if this namespace name has already been added.
15589 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
15591         * expression.cs: reftype [!=]= null should always use br[true,false].
15592         # 67410
15594 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
15596         Fix #67108
15597         * attribute.cs: Enum conversion moved to 
15598         GetAttributeArgumentExpression to be applied to the all
15599         expressions.
15601 2004-10-01  Raja R Harinath  <rharinath@novell.com>
15603         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15604         * class.c (TypeContainer.DefineType): Flag error if
15605         base types aren't accessible due to access permissions.
15606         * decl.cs (DeclSpace.ResolveType): Move logic to
15607         Expression.ResolveAsTypeTerminal.
15608         (DeclSpace.ResolveTypeExpr): Thin layer over
15609         Expression.ResolveAsTypeTerminal.
15610         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15611         Refactor code into NestedAccess.  Use it.
15612         (DeclSpace.NestedAccess): New.
15613         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15614         argument to silence errors.  Check access permissions.
15615         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15616         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15617         (Cast.DoResolve): Likewise.
15618         (New.DoResolve): Likewise.
15619         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15620         (TypeOf.DoResolve): Likewise.
15622         * expression.cs (Invocation.BetterConversion): Return the Type of
15623         the better conversion.  Implement section 14.4.2.3 more faithfully.
15624         (Invocation.BetterFunction): Make boolean.  Make correspondence to
15625         section 14.4.2.2 explicit.
15626         (Invocation.OverloadResolve): Update.
15627         (Invocation): Remove is_base field.
15628         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
15629         (Invocation.Emit): Likewise.
15631 2004-09-27  Raja R Harinath  <rharinath@novell.com>
15633         * README: Update to changes.
15635 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
15637         * cs-parser.jay: Reverted 642 warning fix.
15639 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15641         Fix bug #66615
15642         * decl.cs (FindMemberWithSameName): Indexer can have more than
15643         1 argument.
15645 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15647         * expression.cs (LocalVariableReference.DoResolveLValue):
15648         Do not report warning 219 for out values.
15649         (EmptyExpression.Null): New member to avoid extra allocations.
15651 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15653         * cs-parser.jay: Fix wrong warning 642 report.
15655         * cs-tokenizer.cs (CheckNextToken): New helper;
15656         Inspect next character if is same as expected.
15658 2004-09-23  Martin Baulig  <martin@ximian.com>
15660         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15661         (Convert.ImplicitReferenceConversionExists): Likewise.
15663 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15665         * class.cs (Operator.Define): Add error 448 and 559 report.
15667 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15669         * class.cs (MemberBase.IsTypePermitted): New protected
15670         method for checking error CS0610.
15672 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15674         * class.cs (TypeContainer.HasExplicitLayout): New property
15675         Returns whether container has StructLayout attribute set Explicit.
15676         (FieldMember): New abstract class for consts and fields.
15677         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15678         (Field): Reuse FieldMember.
15680         * const.cs (Const): Reuse FieldMember.
15682         * rootcontext.cs: EmitConstants call moved to class.
15684 2004-09-22  Martin Baulig  <martin@ximian.com>
15686         Thanks to Peter Sestoft for this bug report.
15688         * expression.cs (Conditional): If both the `trueExpr' and the
15689         `falseExpr' is a NullLiteral, return a NullLiteral.
15691 2004-09-22  Martin Baulig  <martin@ximian.com>
15693         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15694         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15695         for the "get_Current" call.
15697 2004-09-22  Martin Baulig  <martin@ximian.com>
15699         Marek and me just fixed one of our oldest bugs: #28562 :-)
15701         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15703         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15704         we're an EnumConstant, just return that.
15705         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15706         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
15707         to get the value which'll actually be written into the attribute.
15708         However, we have to use GetValue() to access the attribute's value
15709         in the compiler.        
15711 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15713         * constant.cs (Constant.IsNegative): New abstract property
15714         IsNegative.
15716         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15717         (StackAlloc.DoResolve): Reused IsNegative.
15719 2004-09-21  Martin Baulig  <martin@ximian.com>
15721         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15722         if we're used in an iterator, we may be called from different
15723         methods.
15725         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15726         we actually have an exception block.
15728 2004-09-20  John Luke <jluke@cfl.rr.com>
15730         * class.cs, cs-parser.jay: Improve the error report for 1520:
15731         report the actual line where the error happens, not where the
15732         class was declared.
15734         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15735         Pass location information that was available elsewhere.
15737 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
15739         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15740         runtime to delay sign assemblies.
15742 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15744         * cs-parser.jay: Do not report the stack trace, this is barely
15745         used nowadays.
15747 2004-08-22  John Luke  <john.luke@gmail.com>
15749         * driver.cs : check that a resource id is not already used
15750         before adding it, report CS1508 if it is, bug #63637
15752 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15754         * ecore.cs: Removed dead code.
15756 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
15758         * class.cs: Do not report warning CS0067 on the interfaces.
15760 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15762         * cs-parser.jay: Add error 504 report.
15764 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15766         * rootcontext.cs: WarningLevel is 4 by default now.
15768         * statement.cs (Fixed.Resolve): Do not null
15769         VariableInfo.
15771 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15773         Fixed bug #55780
15774         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15775         deep search when property is not virtual.
15776         (PropertyExpr.ResolveAccessors): Make one call for both
15777         accessors.
15779 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15781         Fixed bug #65766
15782         * statement.cs: Error 152 report constains also location.
15784 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15786         Fixed bug #65766
15787         * const.cs: Explicitly set constant as static.
15789 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15791         Fixed bug #64226
15792         * cs-parser.jay: Add error 1017 report.
15794 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15796         Fixed bug #59980, #64224
15797         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15799         * typemanager.cs (IsSpecialMethod): Simplified
15801 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15803         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15804         condition with better params.
15806 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15808         Fixed bug #65238
15809         * attribute.cs (Resolve): Property has to have both
15810         accessors.
15812 2004-09-14  Martin Baulig  <martin@ximian.com>
15814         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15816 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15818         Fixed bug #61902
15819         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15820         called and is obsolete then this member suppress message
15821         when call is inside next [Obsolete] method or type.
15823         * expression.cs: Use TestObsoleteMethodUsage member.
15825 2004-09-14  Martin Baulig  <martin@ximian.com>
15827         * cs-parser.jay: Sync a bit with the GMCS version.
15829 2004-09-14  Martin Baulig  <martin@ximian.com>
15831         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15832         (CSharpParser.yacc_verbose_flag): New public field.
15834         * genericparser.cs: Removed.
15836 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15838         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15840 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15842         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15844 2004-09-10  Martin Baulig  <martin@ximian.com>
15846         Backported my MemberName changes from GMCS into MCS.
15848         - we are now using a special `MemberName' class instead of using
15849         strings; in GMCS, the `MemberName' also contains the type
15850         arguments.
15852         - changed the grammar rules a bit:
15853           * the old `member_name' is now a `namespace_or_type_name':
15854             The rule is that we use `namespace_or_type_name' everywhere
15855             where we expect either a "member name" (GetEnumerator) or a
15856             "member name" with an explicit interface name
15857             (IEnumerable.GetEnumerator).
15858             In GMCS, the explicit interface name may include type arguments
15859             (IEnumerable<T>.GetEnumerator).
15860           * we use `member_name' instead of just `IDENTIFIER' for
15861             "member names":
15862             The rule is that we use `member_name' wherever a member may
15863             have type parameters in GMCS.       
15865         * decl.cs (MemberName): New public class.
15866         (MemberCore.MemberName): New public readonly field.
15867         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15868         (DeclSpace): Likewise.
15870         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15871         * enum.cs (Enum.ctor): Likewise.
15873         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15874         MemberName.     
15875         (AliasEntry.ctor): Take a MemberName, not an Expression.
15876         (AliasEntry.UsingAlias): Likewise.
15878         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15879         (IMethodData.MemberName): Changed type from string to MemberName.
15880         (MemberBase.ExplicitInterfaceName): Likewise.
15881         (AbstractPropertyEventMethod.SetupName): Make this private.
15882         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15883         argument; compute the member name here.
15884         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15885         on the `member.MemberName' and the `prefix'.
15887         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15888         not `type_name'.
15889         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15890         thus, we get a `MemberName' instead of a `string'.  These
15891         declarations may have type parameters in GMCS.
15892         (interface_method_declaration, delegate_declaration): Likewise.
15893         (class_declaration, interface_declaration): Likewise.
15894         (method_header): Use `namespace_or_type_name' instead of
15895         `member_name'.  We may be an explicit interface implementation.
15896         (property_declaration, event_declaration): Likewise.
15897         (member_name): This is now just an `IDENTIFIER', not a
15898         `namespace_or_type_name'.
15899         (type_name, interface_type): Removed.
15900         (namespace_or_type_name): Return a MemberName, not an Expression.
15901         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15902         call GetTypeExpression() on the MemberName to get an expression.
15903         (IndexerDeclaration.interface_type): Changed type from string to
15904         MemberName.
15905         (MakeName): Operate on MemberName's instead of string's.
15907 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15909         Fix bug #55770.
15910         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15911         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15912         lookup to avoid symbols introduced by 'using'.
15913         * rootcontext.cs (NamespaceLookup): Update.
15915 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15917         * class.cs (TypeContainer.DoDefineMembers): Do not call
15918         DefineDefaultConstructor for static classes.
15920 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15922         * attribute.cs (Attribute.Resolve): Add error 653 report.
15924         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15925         report.
15926         (Method.ApplyAttributeBuilder): Add error 685 report.
15927         (Operator.Define): Add error 564 report.
15929         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15931         * expression.cs (Invocation.DoResolve): Add error
15932         245 and 250 report.
15934         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15935         error 674 report.
15937 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15939         * class.cs (ConstructorInitializer.Resolve):
15940         Wrong error number (515->516).
15942 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15944         * class.cs (Indexer.Define): Add error 631 report.
15946 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15948         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15950 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15952         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15954 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15956         * cs-parser.jay: Added error CS0241 report.
15958 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15960         * cs-parser.jay (fixed_statement): Introduce a scope for the
15961         declaration in the 'fixed' statement.
15963 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15965         * cs-parser.jay: Added CS0230 error report.
15967 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15969         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15971 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15973         * expression.cs (Argument.Resolve): Added error CS0192 and
15974         CS0199 report.
15976 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15978         C# 2.0 #pragma warning feature
15980         * cs-tokenizer.cs (PreProcessPragma): New method; 
15981         Handles #pragma directive.
15983         * report.cs (WarningRegions): New class; Support
15984         class for #pragma warning directive. It tests whether
15985         warning is enabled for a given line.
15987 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15989         * const.cs: Add more descriptive error report, tahnks to
15990         Sebastien. 
15992 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15994         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15996 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15998         * expression.cs: Apply patch from Ben: Remove dead code from
15999         ArrayCreation, and remove the TurnintoConstant call in const.cs,
16000         as that code just threw an exception anwyays.
16002         * const.cs: Remove the call to the turnintoconstant, for details
16003         see bug: #63144
16004         
16005         * literal.cs: The type of the null-literal is the null type;  So
16006         we use a placeholder type (literal.cs:System.Null, defined here)
16007         for it.
16009         * expression.cs (Conditional.DoResolve): Remove some old code that
16010         is no longer needed, conversions have been fixed.
16012         (ArrayCreationExpression.DoResolve): Return false if we fail to
16013         resolve the inner expression.
16015 2004-09-07  Raja R Harinath  <rharinath@novell.com>
16017         Fix test-290.cs.
16018         * cs-parser.jay (delegate_declaration): Record a delegate
16019         declaration as a type declaration.
16020         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
16022 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
16024         * parameter.cs: Do not crash if the type can not be resolved. 
16026         * expression.cs: Report errors with unsafe pointers, fixes #64896
16028 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16030         * expression.cs: Pointer arith always needs to do a conv.i
16031         if the operand is a long. fix 65320
16033 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
16035         Fixed cs0619-37.cs, cs0619-38.cs
16037         * enum.cs (GetObsoleteAttribute): Removed.
16039         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
16040         on Enum member is double staged. The first is tested member
16041         and then enum.
16043 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
16045         Fixed #56986, #63631, #65231
16047         * class.cs: (TypeContainer.AddToMemberContainer): New method,
16048         adds member to name container.
16049         (TypeContainer.AddToTypeContainer): New method, adds type to
16050         name container.
16051         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
16052         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
16053         AddOperator): Simplified by reusing AddToMemberContainer.
16054         (TypeContainer.UserDefinedStaticConstructor): Changed to property
16055         instead of field.
16056         (Method.CheckForDuplications): Fixed implementation to test all
16057         possibilities.
16058         (MemberBase): Detection whether member is explicit interface
16059         implementation is now in constructor.
16060         (MemberBase.UpdateMemberName): Handles IndexerName.
16061         (Accessor): Changed to keep also location information.
16062         (AbstractPropertyEventMethod): Is derived from MemberCore.
16063         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
16064         will be emited or not.
16065         (PropertyBase.AreAccessorsDuplicateImplementation):
16066         Tests whether accessors are not in collision with some method.
16067         (Operator): Is derived from MethodCore to simplify common
16068         operations.
16070         * decl.cs (Flags.TestMethodDuplication): Test for duplication
16071         must be performed.
16072         (DeclSpace.AddToContainer): Adds the member to defined_names
16073         table. It tests for duplications and enclosing name conflicts.
16075         * enum.cs (EnumMember): Clean up to reuse the base structures
16077 2004-09-03  Martin Baulig  <martin@ximian.com>
16079         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
16080         into TypeContainer, to make partial classes work again.
16082 2004-09-03  Martin Baulig  <martin@ximian.com>
16084         * rootcontext.cs (RootContext.V2): Removed.
16086 2004-03-23  Martin Baulig  <martin@ximian.com>
16088         * expression.cs (Invocation.OverloadResolve): Added `bool
16089         may_fail' argument and use it instead of the Location.IsNull() hack.
16091 2004-09-03  Martin Baulig  <martin@ximian.com>
16093         Merged latest changes into gmcs.  Please keep this comment in
16094         here, it makes it easier for me to see what changed in MCS since
16095         the last time I merged.
16097 2004-09-03  Raja R Harinath  <rharinath@novell.com>
16099         Fix #61128.
16100         * expression.cs (BetterConversion): Don't allow either conversion 
16101         to be null.  Remove redundant implicit conversion test when 'q ==
16102         null' -- when this function is invoked, we already know that the
16103         implicit conversion exists.
16104         (BetterFunction): Assume that 'best' is non-null.  Remove
16105         redundant reimplementation of IsApplicable when 'best' is null.
16106         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
16107         number of arguments.
16108         (IsAncestralType): Extract from OverloadResolve.
16109         (OverloadResolve): Make robust to the MethodGroupExpr being
16110         unsorted.  Implement all the logic of Section 14.5.5.1, and
16111         support overloading of methods from multiple applicable types.
16112         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
16114         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
16115         (RealError, Warning): Append type of report to related symbol.
16117 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
16119         * enum.cs: Fixed CLS-Compliance checks for enum members.
16120         Error tests cs3008-8.cs, cs3014-8.cs
16122 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
16124         Fixed bug #62342, #63102
16125         * class.cs: ImplementIndexer uses member.IsExplicitImpl
16126         like ImplementMethod.
16128 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
16130         * attribute.cs (Attribute.GetAttributeArgumentExpression):
16131         Fixed bug #65170.
16133 2004-09-02  Martin Baulig  <martin@ximian.com>
16135         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
16136         TypeManager.GetArgumentTypes() rather than calling GetParameters()
16137         on the MethodBase.
16139 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
16141         C# 2.0 Static classes implemented
16143         * class.cs (TypeContainer): instance_constructors,
16144         initialized_fields, initialized_static_fields,
16145         default_constructor, base_inteface_types are protected to be
16146         accessible from StaticClass.
16147         (TypeContainer.DefineDefaultConstructor): New virtual method
16148         for custom default constructor generating
16149         (StaticClass): New class to handle "Static classes" feature.
16151         * cs-parser.jay: Handle static keyword on class like instance
16152         of StaticClass.
16154         * driver.cs: Added "/langversion" command line switch with two
16155         options (iso-1, default).
16157 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
16159         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
16161 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
16163         * delegate.cs: Style.
16165 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16167         * delegate.cs: Add seperate instance expr field for miguel.
16169 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16171         * PointerArithmetic (Resolve): make sure we are not doing
16172         pointer arith on void*. Also, make sure we are resolved
16173         by not setting eclass until resolve.
16175         All callers: Make sure that PointerArithmetic gets resolved.
16177 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16179         * ArrayCreation (LookupType): If the type does not resolve 
16180         to an array, give an error.
16182 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
16184         * statement.cs (Try.Resolve): Fixed bug #64222
16186 2004-08-27  Martin Baulig  <martin@ximian.com>
16188         * class.cs
16189         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
16190         crash here.     
16192 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
16194         * ecore.cs (Constantify): Get underlying type via
16195         System.Enum.GetUnderlyingType to avoid StackOverflow on the
16196         Windows in special cases.
16198 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
16200         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
16201         for obtaining also private methods.
16202         (GetRemoveMethod): Used GetRemoveMethod (true)
16203         for obtaining also private methods.
16205 2004-08-24  Martin Baulig  <martin@ximian.com>
16207         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
16208         MethodAttributes.HideBySig for operators.
16210 2004-08-23  Martin Baulig  <martin@ximian.com>
16212         Back to the old error reporting system :-)
16214         * report.cs (Message): Removed.
16215         (Report.MessageData, ErrorData, WarningData): Removed.
16216         (Report.Error, Warning): Back to the old system.
16218 2004-08-23  Martin Baulig  <martin@ximian.com>
16220         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
16222         * class.cs (TypeContainer.ParentContainer): New public virtual
16223         method; replaces the explicit interface implementation.
16224         (ClassPart.ParentContainer): Override.
16226 2004-08-23  Martin Baulig  <martin@ximian.com>
16228         * statement.cs (Switch): Added support for constant switches; see
16229         #59428 or test-285.cs.
16231 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
16233         Fixed bug #62740.
16234         * statement.cs (GetEnumeratorFilter): Removed useless
16235         logic because C# specs is strict. GetEnumerator must be
16236         public.
16238 2004-08-22  Martin Baulig  <martin@ximian.com>
16240         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16241         a switch and may break, reset the barrier.  Fixes #59867.
16243 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
16245         CLS-Compliance speed up (~5% for corlib)
16247         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16248         New method. Tests container for CLS-Compliant names
16250         * class.cs (TypeContainer.VerifyClsName): New method.
16251         Checks whether container name is CLS Compliant.
16252         (Constructor): Implements IMethodData.
16254         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16255         low-case table for CLS Compliance test.
16256         (MemberCache.VerifyClsParameterConflict): New method.
16257         Checks method parameters for CS3006 error.
16259         * enum.cs (EnumMember): Is derived from MemberCore.
16260         (Enum.VerifyClsName): Optimized for better performance.
16262 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
16264         * report.cs: Renamed Error_T to Error and changed all
16265         references.
16267 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
16269         * class.cs (TypeContainer.IndexerArrayList): New inner class
16270         container for indexers.
16271         (TypeContainer.DefaultIndexerName): New constant for default
16272         indexer name. Replaced all "Item" with this constant.
16273         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16275         * typemanager.cs (TypeManager.default_member_ctor): Cache here
16276         DefaultMemberAttribute constructor.
16278 2004-08-05  Martin Baulig  <martin@ximian.com>
16280         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16281         Fix bug #59429.
16283 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
16285         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16286         multi platforms problem.
16288         * compiler.csproj: Included shared files.
16290 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16292         Fix bug 60333, 55971 in the more general way
16293         * attribute.cs (Attribute.GetAttributeArgumentExpression):
16294         Added arg_type argument for constant conversion.
16295         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16297 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16299         Fix bug #59760
16300         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
16301         OperatorArrayList, MethodCoreArrayList for typecontainer
16302         containers. Changed class member types to these new types.
16303         (MethodArrayList.DefineMembers): Added test for CS0659.
16305 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
16307         * cfold.cs: Synchronize the folding with the code in expression.cs
16308         Binary.DoNumericPromotions for uint operands.
16310         * attribute.cs: Revert patch from Raja, it introduced a regression
16311         while building Blam-1.2.1 (hard to isolate a test case).
16313 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16315         Fix for #55382
16316         * class.cs:
16317         (TypeContainer.Define): Renamed to DefineContainerMembers because of
16318         name collision.
16319         (MethodCore.parent_method): New member. The method we're overriding
16320         if this is an override method.
16321         (MethodCore.CheckBase): Moved from Method class and made common.
16322         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16323         private.
16324         (MethodCore.CheckForDuplications): New abstract method. For custom
16325         member duplication search in a container
16326         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16327         method and its return type.
16328         (Event.conflict_symbol): New member. Symbol with same name in the
16329         parent class.
16331         * decl.cs:
16332         (MemberCache.FindMemberWithSameName): New method. The method
16333         is looking for conflict with inherited symbols.
16335 2004-08-04  Martin Baulig  <martin@ximian.com>
16337         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16339         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16341 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16343         * report.cs (Message): New enum for better error, warning reference in
16344         the code.
16345         (MessageData): New inner abstract class. It generally handles printing of
16346         error and warning messages.
16347         Removed unused Error, Warning, Message methods.
16349 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16351         Fix for cs0592-8.cs test
16352         * attribute.cs
16353         (Attributable.ValidAttributeTargets): Made public.
16354         (Attribute.ExplicitTarget): New member for explicit target value.
16355         (Attribute.CheckTargets): Now we translate explicit attribute
16356         target to Target here.
16358 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
16360         * ecore.cs (MethodGroupExpr): new IsBase property.
16362         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16364         * delegate.cs (DelegateCreation): store a MethodGroupExpr
16365         rather than an instance expr.
16367         (DelegateCreation.Emit): Use the method group rather than
16368         the instance expression. Also, if you have base.Foo as the
16369         method for a delegate, make sure to emit ldftn, not ldftnvirt.
16371         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
16373         (NewDelegate.DoResolve): Only check for the existance of Invoke
16374         if the method is going to be needed. Use MethodGroupExpr.
16376         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
16378         * expression.cs: For pointer arith., make sure to use
16379         the size of the type, not the size of the pointer to
16380         the type.
16382 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16384         Fix for #60722
16385         * class.cs (Class): Added error CS0502 test.
16387 2004-08-03  John Luke  <jluke@cfl.rr.com>
16388             Raja R Harinath  <rharinath@novell.com>
16390         Fix for #60997.
16391         * attribute.cs (Attribute.complained_before): New flag.
16392         (Attribute.ResolveType, Attribute.Resolve),
16393         (Attribute.DefinePInvokeMethod): Set it.
16394         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16395         
16396 2004-08-03  Martin Baulig  <martin@ximian.com>
16398         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16399         use a user-defined operator; we still need to do numeric
16400         promotions in case one argument is a builtin type and the other
16401         one has an implicit conversion to that type.  Fixes #62322.
16403 2004-08-02  Martin Baulig  <martin@ximian.com>
16405         * statement.cs (LocalInfo.Flags): Added `IsThis'.
16406         (LocalInfo.IsThis): New public property.
16407         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16409 2004-08-01  Martin Baulig  <martin@ximian.com>
16411         * class.cs (TypeContainer.GetClassBases): Don't set the default
16412         here since we may get called from GetPartialBases().
16413         (TypeContainer.DefineType): If GetClassBases() didn't return a
16414         parent, use the default one.
16416 2004-07-30  Duncan Mak  <duncan@ximian.com>
16418         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16420 2004-07-30  Martin Baulig  <martin@ximian.com>
16422         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16424         * class.cs (SourceMethod): New public class, derive from the
16425         symbol writer's ISourceMethod.
16426         (Method): Use the new symbol writer API.
16428         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16429         as argument and use the new symbol writer.
16431         * location.cs
16432         (SourceFile): Implement the symbol writer's ISourceFile.
16433         (Location.SymbolDocument): Removed.
16434         (Location.SourceFile): New public property.
16436         * symbolwriter.cs: Use the new symbol writer API.
16438 2004-07-30  Raja R Harinath  <rharinath@novell.com>
16440         * Makefile (install-local): Remove.  Functionality moved to
16441         executable.make.
16443 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
16445         * Makefile: Install mcs.exe.config file together with mcs.exe.
16446         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16447         correct runtime version.
16448         
16449 2004-07-25  Martin Baulig  <martin@ximian.com>
16451         * class.cs
16452         (TypeContainer.RegisterOrder): Removed, this was unused.
16453         (TypeContainer, interface_order): Removed.
16454         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16455         TypeContainer as argument since we can also be called with a
16456         `PartialContainer' for a partial class/struct/interface.
16457         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16458         of checking whether we're an `Interface' - we could be a
16459         `PartialContainer'.
16460         (PartialContainer.Register): Override; call
16461         AddClass()/AddStruct()/AddInterface() on our parent.
16463         * cs-parser.jay (interface_member_declaration): Add things to the
16464         `current_container', not the `current_class'.
16466         * rootcontext.cs (RegisterOrder): The overloaded version which
16467         takes an `Interface' was unused, removed.
16469         * typemanager.cs (TypeManager.LookupInterface): Return a
16470         `TypeContainer', not an `Interface'.
16471         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16472         contain a `PartialContainer' for an interface, so check it's
16473         `Kind' to figure out what it is.
16475 2004-07-25  Martin Baulig  <martin@ximian.com>
16477         * class.cs (Class.DefaultTypeAttributes): New public constant.
16478         (Struct.DefaultTypeAttributes): Likewise.
16479         (Interface.DefaultTypeAttributes): Likewise.
16480         (PartialContainer.TypeAttr): Override this and add the
16481         DefaultTypeAttributes.
16483 2004-07-25  Martin Baulig  <martin@ximian.com>
16485         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16486         we can just use the `Parent' field instead.
16488 2004-07-25  Martin Baulig  <martin@ximian.com>
16490         * class.cs (TypeContainer.Emit): Renamed to EmitType().
16492 2004-07-25  Martin Baulig  <martin@ximian.com>
16494         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16495         our parts before defining any methods.
16496         (TypeContainer.VerifyImplements): Make this virtual.
16497         (ClassPart.VerifyImplements): Override and call VerifyImplements()
16498         on our PartialContainer.
16500 2004-07-25  Martin Baulig  <martin@ximian.com>
16502         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16504         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16505         argument, we can just use the `Parent' field instead.
16507         * class.cs
16508         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
16509         (MemberBase.DoDefine): Likewise.
16511 2004-07-24  Martin Baulig  <martin@ximian.com>
16513         * decl.cs (MemberCore.Parent): New public field.
16514         (DeclSpace.Parent): Moved to MemberCore.
16516         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16517         (MemberBase.ctor): Added TypeContainer argument, pass it to our
16518         parent's .ctor.
16519         (FieldBase, Field, Operator): Likewise.
16520         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16521         (EventField, Event): Likewise.
16523 2004-07-23  Martin Baulig  <martin@ximian.com>
16525         * class.cs (PartialContainer): New public class.
16526         (ClassPart): New public class.
16527         (TypeContainer): Added support for partial classes.
16528         (TypeContainer.GetClassBases): Splitted some of the functionality
16529         out into GetNormalBases() and GetPartialBases().
16531         * cs-tokenizer.cs (Token.PARTIAL): New token.
16532         (Tokenizer.consume_identifier): Added some hacks to recognize
16533         `partial', but only if it's immediately followed by `class',
16534         `struct' or `interface'.
16536         * cs-parser.jay: Added support for partial clases.
16538 2004-07-23  Martin Baulig  <martin@ximian.com>
16540         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16541         a `DeclSpace' and also made it readonly.
16542         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16543         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16544         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16546         * cs-parser.jay: Pass the `current_class', not the
16547         `current_container' (at the moment, this is still the same thing)
16548         to a new Method, Property, Event, Indexer or Constructor.
16550 2004-07-23  Martin Baulig  <martin@ximian.com>
16552         * cs-parser.jay (CSharpParser): Added a new `current_class' field
16553         and removed the `current_interface' one.
16554         (struct_declaration, class_declaration, interface_declaration):
16555         Set `current_class' to the newly created class/struct/interface;
16556         set their `Bases' and call Register() before parsing their body.
16558 2004-07-23  Martin Baulig  <martin@ximian.com>
16560         * class.cs (Kind): New public enum.
16561         (TypeContainer): Made this class abstract.
16562         (TypeContainer.Kind): New public readonly field.
16563         (TypeContainer.CheckDef): New public method; moved here from
16564         cs-parser.jay.
16565         (TypeContainer.Register): New public abstract method.
16566         (TypeContainer.GetPendingImplementations): New public abstract
16567         method.
16568         (TypeContainer.GetClassBases): Removed the `is_class' and
16569         `is_iface' parameters.
16570         (TypeContainer.DefineNestedTypes): Formerly known as
16571         DoDefineType().
16572         (ClassOrStruct): Made this class abstract.
16574         * tree.cs (RootTypes): New public type. 
16576 2004-07-20  Martin Baulig  <martin@ximian.com>
16578         * tree.cs (Tree.RecordNamespace): Removed.
16579         (Tree.Namespaces): Removed.
16581         * rootcontext.cs (RootContext.IsNamespace): Removed.
16583         * cs-parser.jay (namespace_declaration): Just create a new
16584         NamespaceEntry here.
16586 2004-07-20  Martin Baulig  <martin@ximian.com>
16588         * statement.cs (ExceptionStatement): New abstract class.  This is
16589         now used as a base class for everyone who's using `finally'.
16590         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16591         our local variables before using them.
16593         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16594         virtual method.  This is used by Yield.Resolve() to "steal" an
16595         outer block's `finally' clauses.
16596         (FlowBranchingException): The .ctor now takes an ExceptionStatement
16597         argument.
16599         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16600         version which takes an ExceptionStatement.  This version must be
16601         used to create exception branchings.
16603         * iterator.cs
16604         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16605         (Iterator.EmitMoveNext): Added exception support; protect the
16606         block with a `fault' clause, properly handle 'finally' clauses.
16607         (Iterator.EmitDispose): Run all the `finally' clauses here.
16609 2004-07-20  Martin Baulig  <martin@ximian.com>
16611         * iterator.cs: This is the first of a set of changes in the
16612         iterator code.  Match the spec more closely: if we're an
16613         IEnumerable, then GetEnumerator() must be called.  The first time
16614         GetEnumerator() is called, it returns the current instance; all
16615         subsequent invocations (if any) must create a copy.
16617 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
16619         * expression.cs: Resolve the constant expression before returning
16620         it. 
16622 2004-07-19  Martin Baulig  <martin@ximian.com>
16624         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16625         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16626         the return type of the new EmitContext.
16628 2004-07-18  Martin Baulig  <martin@ximian.com>
16630         * class.cs (Property.Define): Fix iterators.
16632         * iterators.cs (Iterator.Define): Moved the
16633         `container.AddInterator (this)' call here from the .ctor; only do
16634         it if we resolved successfully.
16636 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
16638         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16639         `true' for preprocessing directives that we parse.  The return
16640         value indicates whether we should return to regular tokenizing or
16641         not, not whether it was parsed successfully.
16643         In the past if we were in: #if false ... #line #endif, we would
16644         resume parsing after `#line'.  See bug 61604.
16646         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16647         building: IsEnumType should return true only for enums, not for
16648         enums or System.Enum itself.  This fixes #61593.
16650         Likely what happened is that corlib was wrong: mcs depended on
16651         this bug in some places.  The bug got fixed, we had to add the
16652         hack, which caused bug 61593.
16654         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16655         that was a workaround for the older conditions.
16657 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
16659         * assign.cs: IAssignMethod has a new interface, as documented
16660         inline. All assignment code now uses this new api.
16662         * ecore.cs, expression.cs: All classes which implement
16663         IAssignMethod now use the new interface.
16665         * expression.cs (Invocation): add a hack to EmitCall so that
16666         IndexerAccess can be the target of a compound assignment without
16667         evaluating its arguments twice.
16669         * statement.cs: Handle changes in Invocation api.
16671 2004-07-16  Martin Baulig  <martin@ximian.com>
16673         * iterators.cs: Rewrote this.  We're now using one single Proxy
16674         class for both the IEnumerable and the IEnumerator interface and
16675         `Iterator' derives from Class so we can use the high-level API.
16677         * class.cs (TypeContainer.AddIterator): New method.
16678         (TypeContainer.DoDefineType): New protected virtual method, which
16679         is called from DefineType().
16680         (TypeContainer.DoDefineMembers): Call DefineType() and
16681         DefineMembers() on all our iterators.
16682         (TypeContainer.Emit): Call Emit() on all our iterators.
16683         (TypeContainer.CloseType): Call CloseType() on all our iterators.
16685         * codegen.cs (EmitContext.CurrentIterator): New public field.
16687 2004-07-15  Martin Baulig  <martin@ximian.com>
16689         * typemanager.cs
16690         (TypeManager.not_supported_exception_type): New type.   
16692 2004-07-14  Martin Baulig  <martin@ximian.com>
16694         * iterators.cs: Use real error numbers.
16696 2004-07-14  Martin Baulig  <martin@ximian.com>
16698         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16699         requires this to be a System.Collection.IEnumerable and not a
16700         class implementing that interface.
16701         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
16703 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
16705         * class.cs: Fixed previous fix, it broke some error tests.
16707 2004-07-12  Martin Baulig  <martin@ximian.com>
16709         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16710         Fixes #61293.
16712 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
16714         * assign.cs (LocalTemporary): Add new argument: is_address,If
16715         `is_address' is true, then the value that we store is the address
16716         to the real value, and not the value itself.
16717         
16718         * ecore.cs (PropertyExpr): use the new local temporary
16719         stuff to allow us to handle X.Y += z (where X is a struct)
16721 2004-07-08  Martin Baulig  <martin@ximian.com>
16723         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16724         not always return, just like we're doing in Using.Resolve().
16726 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
16728         * cs-parser.jay (fixed_statement): flag this as Pinned.
16730 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
16732         * typemanager.cs (TypeManager): Removed MakePinned method, this
16733         mechanism is replaced with the .NET 2.x compatible mechanism of
16734         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16736         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
16737         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16738         `IsFixed' property which has a different meaning.
16740 2004-07-02  Raja R Harinath  <rharinath@novell.com>
16742         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16743         visible from inside a nested class, not just the names of the
16744         immediately enclosing class.
16745         Fix for bug #60730.
16747 2004-06-24  Raja R Harinath  <rharinath@novell.com>
16749         * expression.cs (BetterConversion): Remove buggy special-case
16750         handling of "implicit constant expression conversions".  At this
16751         point, we already know that the conversion is possible -- we're
16752         only checking to see which is better.
16754 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16756         * cs-parser.jay: Added error CS0210 test.
16758 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16760         * cs-parser.jay: Added error CS0134 test.
16762 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16764         Fix bug #52507
16765         * cs-parser.jay: Added error CS0145 test.
16767 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16769         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16771 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
16772         
16773         * expression.cs (StackAlloc.Resolve): The argument may not
16774         be a constant; deal with this case.
16775         
16776 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
16778         * attribute.cs (IndexerName_GetIndexerName): Renamed to
16779         GetIndexerAttributeValue.
16780         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16782         * class.cs (Indexer.Define): Added error tests for CS0415,
16783         CS0609.
16785 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
16787         * attribute.cs (Attribute.Resolve): Keep field code in sync with
16788         property code.
16790 2004-06-23  Martin Baulig  <martin@ximian.com>
16792         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16793         neither return nor throw, reset the barrier as well.  Fixes #60457.
16795 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
16797         * class.cs : EventAttributes is now set to None by default.
16798           This fixes bug #60459.
16800 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16802         Fix bug #60219
16803         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16804         Don't throw exception but return null (it's sufficient now).
16806 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16808         * typemanager.cs (GetArgumentTypes): Faster implementation.
16810 2004-06-18  Martin Baulig  <martin@ximian.com>
16812         * attribute.cs (Attribute.Resolve): Check whether we're an
16813         EmptyCast which a Constant child.  Fixes #60333.
16815 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16817         * statement.cs (EmitCollectionForeach): Account for the fact that
16818         not all valuetypes are in areas which we can take the address of.
16819         For these variables, we store to a temporary variable. Also, make
16820         sure that we dont emit a `callvirt' on a valuetype method.
16822 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16824         * expression.cs (StackAlloc.DoReSolve): Added test for
16825         negative parameter (CS0247).
16827 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16829         Fix bug #59792
16830         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16832 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16834         Fix bug #59781
16835         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16836         ulong.
16838 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16840         Fix bug #58254 & cs1555.cs, cs1556.cs
16841         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16843 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16845         * cs-parser.jay: Added error CS1669 test for indexers.
16847 2004-06-11  Martin Baulig  <martin@ximian.com>
16849         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16850         call this twice: for params and varargs methods.
16852 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16854         * class.cs:
16855         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16857 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16859         * attribute.cs (Attribute.GetValidTargets): Made public.
16861         * class.cs: 
16862         (AbstractPropertyEventMethod): New class for better code sharing.
16863         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16864         CS1667 report.
16865         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16867 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16869         Fix bug #59477.
16870         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16871         that the call to Resolve is part of a MemberAccess.
16872         (Expression.Resolve): Use it for SimpleName resolution.
16873         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16874         Add 'intermediate' boolean argument.
16875         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16876         error message when the SimpleName can be resolved ambiguously
16877         between an expression and a type.
16878         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16879         public.
16880         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16881         call on the left-side.
16883 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16885         * class.cs:
16886         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16888 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16890         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16892 2004-06-11  Martin Baulig  <martin@ximian.com>
16894         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16895         varargs methods if applicable.
16897 2004-06-11  Martin Baulig  <martin@ximian.com>
16899         * expression.cs (Invocation.EmitCall): Don't use
16900         `method.CallingConvention == CallingConventions.VarArgs' since the
16901         method could also have `CallingConventions.HasThis'.
16903 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16905         * class.cs (Event.GetSignatureForError): Implemented.
16906         Fixed crash in error test cs3010.cs
16908 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16910         * cs-tokenizer.cs: Change the way we track __arglist to be
16911         consistent with the other keywords.
16913 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16915         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16916         tomorrow.
16918 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16920         * codegen.cs: Check that all referenced assemblies have a strongname
16921         before strongnaming the compiled assembly. If not report error CS1577.
16922         Fix bug #56563. Patch by Jackson Harper.
16923         * typemanager.cs: Added a method to return all referenced assemblies.
16924         Fix bug #56563. Patch by Jackson Harper.
16926 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16928         * class.cs:
16929         (Method.ApplyAttributeBuilder): Moved and added conditional
16930         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16932         * delegate.cs:
16933         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16935 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16937         Fixed #59640
16938         * class.cs: (EventField.attribute_targets): Changed default target.
16940 2004-06-08  Martin Baulig  <martin@ximian.com>
16942         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16944 2004-06-08  Martin Baulig  <martin@ximian.com>
16946         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16948 2004-06-07  Martin Baulig  <martin@ximian.com>
16950         Added support for varargs methods.
16952         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16953         keyword.
16955         * cs-parser.jay: Added support for `__arglist'.
16957         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16959         * expression.cs (Argument.AType): Added `ArgList'.
16960         (Invocation): Added support for varargs methods.
16961         (ArglistAccess): New public class.
16962         (Arglist): New public class.
16964         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16966         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16967         a method's top-level block if the method has varargs.
16969         * support.cs (ReflectionParameters, InternalParameters): Added
16970         support for varargs methods.    
16972 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16974         * class.cs: Provide location in indexer error report.
16976         * driver.cs: Use standard names.
16978         * namespace.cs: Catch the use of using after a namespace has been
16979         declared also on using aliases.
16981 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16983         Bug #50820.
16984         * typemanager.cs (closure_private_ok, closure_invocation_type)
16985         (closure_qualifier_type, closure_invocation_assembly)
16986         (FilterWithClosure): Move to ...
16987         (Closure): New internal nested class.
16988         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16989         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16990         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16991         (MemberLookup, MemberLookupFailed): Use it.
16992         * expression.cs (New.DoResolve): Treat the lookup for the
16993         constructor as being qualified by the 'new'ed type.
16994         (Indexers.GetIndexersForTypeOrInterface): Update.
16996 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16998         * attribute.cs
16999         (GetConditionalAttributeValue): New method. Returns
17000         condition of ConditionalAttribute.
17001         (SearchMulti): New method.  Returns all attributes of type 't'.
17002         Use it when attribute is AllowMultiple = true.
17003         (IsConditionalMethodExcluded): New method.
17005         * class.cs
17006         (Method.IsExcluded): Implemented. Returns true if method has conditional
17007         attribute and the conditions is not defined (method is excluded).
17008         (IMethodData): Extended interface for ConditionalAttribute support.
17009         (PropertyMethod.IsExcluded): Implemented.
17011         * decl.cs
17012         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
17014         * expression.cs
17015         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
17016         on the method.
17018 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17020         * expression.cs (ArrayCreationExpression): Make this just an
17021         `expression'. It can't be a statement, so the code here was
17022         dead.
17024 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
17026         Fixed #59072
17027         * typemanager.cs (GetFullNameSignature): New method for
17028         MethodBase types.
17030 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
17032         Fixed #56452
17033         * class.cs (MemberBase.GetSignatureForError): New virtual method.
17034         Use this method when MethodBuilder is null.
17035         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
17036         Added test for error CS0626 (MONO reports error for this situation).
17037         (IMethodData.GetSignatureForError): Extended interface.
17039 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
17041         * attribute.cs
17042         (AttributeTester.GetObsoleteAttribute): Returns instance of
17043         ObsoleteAttribute when type is obsolete.
17045         * class.cs
17046         (TypeContainer.VerifyObsoleteAttribute): Override.
17047         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
17048         (MethodCode.VerifyObsoleteAttribute): Override.
17049         (MemberBase.VerifyObsoleteAttribute): Override.
17051         * decl.cs
17052         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
17053         and report proper error.
17055         *delegate.cs
17056         Delegate.VerifyObsoleteAttribute): Override.
17058         * ecore.cs
17059         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
17060         and report proper error.
17061         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
17063         * enum.cs
17064         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
17065         and enum member.
17067         * expression.cs
17068         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
17069         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
17070         Added test for ObsoleteAttribute.
17072         * statement.cs
17073         (Catch): Derived from Statement.
17075 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
17077         Fixed bug #59071 & cs0160.cs
17079         * statement.cs (Try.Resolve): Check here whether order of catch
17080         clauses matches their dependencies.
17082 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
17084         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
17085         caused a regression: #59343.  Referencing nested classes from an
17086         assembly stopped working.
17088 2004-05-31  Martin Baulig  <martin@ximian.com>
17090         MCS is now frozen for beta 2.
17092 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17094         * convert.cs: add a trivial cache for overload operator resolution.
17096 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17098         * decl.cs: If possible, use lookuptypedirect here. We can only do
17099         this if there is no `.' after the namespace. Avoids using
17100         LookupType, which does lots of slow processing.
17101         (FindNestedType) New method, does what it says :-).
17102         * namespace.cs: use LookupTypeDirect.
17103         * rootcontext.cs: use membercache, if possible.
17104         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
17106 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17108         * expression.cs:
17109         According to the spec, 
17111         In a member access of the form E.I, if E is a single identifier,
17112         and if the meaning of E as a simple-name (§7.5.2) is a constant,
17113         field, property, localvariable, or parameter with the same type as
17114         the meaning of E as a type-name (§3.8), then both possible
17115         meanings of E are permitted.
17117         We did not check that E as a simple-name had the same type as E as
17118         a type name.
17120         This trivial check gives us 5-7% on bootstrap time.
17122 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17124         * expression.cs (Invocation.OverloadResolve): Avoid the
17125         use of hashtables and boxing here by allocating on demand.
17127 2004-05-30  Martin Baulig  <martin@ximian.com>
17129         * rootcontext.cs (RootContext.LookupType): Don't cache things if
17130         we're doing a silent lookup.  Don't try to lookup nested types in
17131         TypeManager.object_type (thanks to Ben Maurer).
17133 2004-05-30  Martin Baulig  <martin@ximian.com>
17135         Committing a patch from Ben Maurer.
17137         * rootcontext.cs (RootContext.LookupType): Cache negative results.
17139 2004-05-29  Martin Baulig  <martin@ximian.com>
17141         * class.cs (IMethodData.ShouldIgnore): New method.
17143         * typemanager.cs (TypeManager.MethodFlags): Don't take a
17144         `Location' argument, we don't need it anywhere.  Use
17145         `IMethodData.ShouldIgnore ()' instead of
17146         `MethodData.GetMethodFlags ()'.
17147         (TypeManager.AddMethod): Removed.
17148         (TypeManager.AddMethod2): Renamed to AddMethod.
17150 2004-05-29  Martin Baulig  <martin@ximian.com>
17152         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
17154         * convert.cs (Convert.ImplicitReferenceConversion): If we're
17155         converting from a class type S to an interface type and we already
17156         have an object on the stack, don't box it again.  Fixes #52578.
17158 2004-05-29  Martin Baulig  <martin@ximian.com>
17160         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17161         Added support for `params' parameters.  Fixes #59267.
17163 2004-05-29  Martin Baulig  <martin@ximian.com>
17165         * literal.cs (NullPointer): Provide a private .ctor which sets
17166         `type' to TypeManager.object_type.  Fixes #59048.
17168 2004-05-29  Martin Baulig  <martin@ximian.com>
17170         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
17171         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
17173         * ecore.cs (EventExpr.instance_expr): Make the field private.
17175 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
17177         Fixed bug #50080 & cs0214-2.cs
17178         * expression.cs (Cast.DoResolve): Check unsafe context here.
17179         
17180         * statement.cs (Resolve.DoResolve): Likewise.
17182 2004-05-26  Martin Baulig  <martin@ximian.com>
17184         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
17186         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
17187         (RootContext.LookupType): Pass down the `silent' flag.
17189 2004-05-25  Martin Baulig  <martin@ximian.com>
17191         * expression.cs
17192         (MethodGroupExpr.IdenticalTypeName): New public property.
17193         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
17194         expression actually refers to a type.
17196 2004-05-25  Martin Baulig  <martin@ximian.com>
17198         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
17199         for #56176 and made it actually work.
17201 2004-05-25  Martin Baulig  <martin@ximian.com>
17203         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
17204         (FieldExpr, PropertyExpr): Override and implement
17205         CacheTemporaries.  Fixes #52279.
17207 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
17209         * location.cs: In the new compiler listing a file twice is a
17210         warning, not an error.
17212 2004-05-24  Martin Baulig  <martin@ximian.com>
17214         * enum.cs (Enum.DefineType): For the `BaseType' to be a
17215         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
17217 2004-05-24  Martin Baulig  <martin@ximian.com>
17219         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
17220         walking the `using' list.  Fixes #53921.
17222 2004-05-24  Martin Baulig  <martin@ximian.com>
17224         * const.cs (Const.LookupConstantValue): Added support for
17225         EmptyCast's; fixes #55251.
17227 2004-05-24  Martin Baulig  <martin@ximian.com>
17229         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17230         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17231         which does the CS0135 check.  The reason is that we first need to
17232         check whether the variable actually exists.
17234 2004-05-24  Martin Baulig  <martin@ximian.com>
17236         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17237         than RootContext.LookupType() to find the explicit interface
17238         type.  Fixes #58584.
17240 2004-05-24  Raja R Harinath  <rharinath@novell.com>
17242         * Makefile: Simplify.  Use executable.make.
17243         * mcs.exe.sources: New file.  List of sources of mcs.exe.
17245 2004-05-24  Anders Carlsson  <andersca@gnome.org>
17247         * decl.cs:
17248         * enum.cs:
17249         Use the invariant culture when doing String.Compare for CLS case
17250         sensitivity.
17251         
17252 2004-05-23  Martin Baulig  <martin@ximian.com>
17254         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17255         don't have any dots.  Fixes #52622, added cs0246-8.cs.
17257         * namespace.cs (NamespaceEntry.Lookup): Likewise.
17258         
17259 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17261         * class.cs (MemberBase.Define): Reuse MemberType member for 
17262         resolved type. Other methods can use it too.
17264 2004-05-23  Martin Baulig  <martin@ximian.com>
17266         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17267         the variable also exists in the current block (otherwise, we need
17268         to report a CS0103).  Fixes #58670.
17270 2004-05-23  Martin Baulig  <martin@ximian.com>
17272         * flowanalysis.cs (Reachability.Reachable): Compute this
17273         on-the-fly rather than storing it as a field.
17275 2004-05-23  Martin Baulig  <martin@ximian.com>
17277         * flowanalysis.cs (Reachability.And): Manually compute the
17278         resulting `barrier' from the reachability.      
17279        
17280 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17282         Fix bug #57835
17283         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17284         instance of ObsoleteAttribute when symbol is obsolete.
17286         * class.cs
17287         (IMethodData): Extended interface for ObsoleteAttribute support.
17289 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17291         * attribute.cs: Fix bug #55970
17293 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17295         Fix bug #52705
17296         * attribute.cs
17297         (GetObsoleteAttribute): New method. Creates the instance of
17298         ObsoleteAttribute.
17299         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17300         ObsoleteAttribute when member is obsolete.
17301         (AttributeTester.Report_ObsoleteMessage): Common method for
17302         Obsolete error/warning reporting.
17304         * class.cs
17305         (TypeContainer.base_classs_type): New member for storing parent type.
17307         * decl.cs
17308         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17309         for this MemberCore.
17311 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17313         * attribute.cs, const.cs: Fix bug #58590
17315 2004-05-21  Martin Baulig  <martin@ximian.com>
17317         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17318         out parameters if the end of the method is unreachable.  Fixes
17319         #58098. 
17321 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17323         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17324         Hari was right, why extra method.
17326 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17328         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17330 2004-05-20  Martin Baulig  <martin@ximian.com>
17332         Merged this back from gmcs to keep the differences to a minumum.
17334         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17335         instead of a Declspace.
17336         (Attribute.ResolveType): Likewise.
17337         (Attributes.Search): Likewise.
17338         (Attributes.Contains): Likewise.
17339         (Attributes.GetClsCompliantAttribute): Likewise.
17341         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17342         argument.
17343         (MethodData.ApplyAttributes): Take an EmitContext instead of a
17344         DeclSpace.
17346 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
17348         Fix bug #58688 (MCS does not report error when the same attribute
17349         is assigned twice)
17351         * attribute.cs (Attribute.Emit): Distinction between null and default.
17353 2004-05-19  Raja R Harinath  <rharinath@novell.com>
17355         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17356         of a top-level attribute without an attribute target.
17357         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
17358         Make non-static.
17359         (Attribute.Conditional_GetConditionName), 
17360         (Attribute.Obsolete_GetObsoleteMessage): Update.
17361         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
17362         part of ScanForIndexerName.
17363         (Attribute.CanIgnoreInvalidAttribute): New function.
17364         (Attribute.ScanForIndexerName): Move to ...
17365         (Attributes.ScanForIndexerName): ... here.
17366         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17367         (Attributes.Search): New internal variant that can choose not to
17368         complain if types aren't resolved.  The original signature now
17369         complains.
17370         (Attributes.GetClsCompliantAttribute): Use internal variant, with
17371         complaints suppressed.
17372         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17373         only if it not useful.
17374         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17375         top-level for attributes that are shared between the assembly
17376         and a top-level class.
17377         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17378         * class.cs: Update to reflect changes.
17379         (DefineIndexers): Fuse loops.
17380         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
17381         a couple more variants of attribute names.
17383 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
17385         Fix bug #52585 (Implemented explicit attribute declaration)
17387         * attribute.cs:
17388         (Attributable.ValidAttributeTargets): New abstract method. It gets
17389         list of valid attribute targets for explicit target declaration.
17390         (Attribute.Target): It holds target itself.
17391         (AttributeSection): Removed.
17392         (Attribute.CheckTargets): New method. It checks whether attribute
17393         target is valid for the current element.
17395         * class.cs:
17396         (EventProperty): New class. For events that are declared like
17397         property (with add and remove accessors).
17398         (EventField): New class. For events that are declared like field.
17399         class.cs
17401         * cs-parser.jay: Implemented explicit attribute target declaration.
17403         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
17404         Override ValidAttributeTargets.
17406         * parameter.cs:
17407         (ReturnParameter): Class for applying custom attributes on 
17408         the return type.
17409         (ParameterAtribute): New class. Class for applying custom
17410         attributes on the parameter type.
17412 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
17414         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17415         definitions. 
17417         (Method): Allow UNSAFE here.
17419         * modifiers.cs: Support unsafe reporting.
17421 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
17423         * decl.cs: Fix bug #58478.
17425 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17427         * statement.cs: When checking for unreachable code on an EmptyStatement,
17428         set the location. Fixes bug #58488.
17430 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
17432         * driver.cs: Add -pkg handling.
17434         From Gonzalo: UseShelLExecute=false
17436 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
17438         * attribute.cs:
17439         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17440         for attribute.
17441         (Attribute.IsClsCompliaceRequired): Moved to base for better
17442         accesibility.
17443         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17444         when attribute is AttributeUsageAttribute.
17445         (Attribute.GetValidTargets): Simplified.
17446         (Attribute.GetAttributeUsage): New method returns AttributeUsage
17447         attribute for this type.
17448         (Attribute.ApplyAttributes): Method renamed to Emit and make
17449         non-static.
17450         (GlobalAttributeSection): New class for special handling of global
17451         attributes (assembly, module).
17452         (AttributeSection.Emit): New method.
17454         * class.cs: Implemented Attributable abstract methods.
17455         (MethodCore.LabelParameters): Moved to Parameter class.
17456         (Accessor): Is back simple class.
17457         (PropertyMethod): Implemented Attributable abstract class.
17458         (DelegateMethod): Implemented Attributable abstract class.
17459         (Event): New constructor for disctintion between normal Event
17460         and Event with accessors.
17462         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17464         * codegen.cs, const.cs, decl.cs, delegate.cs:
17465         (CommonAssemblyModulClass): Implemented Attributable abstract class
17466         and simplified.
17468         * enum.cs: Implement IAttributeSupport interface.
17469         (EnumMember): New class for emum members. Implemented Attributable
17470         abstract class
17472         * parameter.cs:
17473         (ParameterBase): Is abstract.
17474         (ReturnParameter): New class for easier [return:] attribute handling.
17476         * typemanager.cs: Removed builder_to_attr.
17478 2004-05-11  Raja R Harinath  <rharinath@novell.com>
17480         Fix bug #57151.
17481         * attribute.cs (Attribute.GetPositionalValue): New function.
17482         * class.cs (TypeContainer.VerifyMembers): New function.
17483         (TypeContainer.Emit): Use it.
17484         (ClassOrStruct): New base class for Class and Struct.
17485         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
17486         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17487         class.
17488         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17489         then each non-static field should have a FieldOffset attribute.
17490         Otherwise, none of the fields should have a FieldOffset attribute.
17491         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
17492         and FieldOffset attributes.
17493         * typemanager.cs (TypeManager.struct_layout_attribute_type)
17494         (TypeManager.field_offset_attribute_type): New core types.
17495         (TypeManager.InitCoreTypes): Initialize them.
17497 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
17499         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17500         Return correct type.
17501         From bug #58270.
17503 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
17505         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17506         be implicitly converted to ulong.
17507         
17508         * expression.cs: The logic for allowing operator &, | and ^ worked
17509         was wrong, it worked before because we did not report an error in
17510         an else branch.  Fixes 57895.
17512         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17513         allow volatile fields to be reference types.
17515 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
17517         * driver.cs: Add support for /debug-
17519 2004-05-07  Raja R Harinath  <rharinath@novell.com>
17521         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
17522         Add a 'complain' parameter to silence errors.
17523         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
17524         silently overlooked type-resolutions.
17525         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17526         to reflect changes.
17527         (Attributes.Search): New function.
17528         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17529         (Attributes.GetAttributeFullName): Remove hack.
17530         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
17531         Update to reflect changes.
17532         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17533         Use Attributes.Search instead of nested loops.
17535 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
17537         * decl.cs:
17538         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17539         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17540         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17542         * report.cs: (Report.Warning): Renamed to Warning_T because of
17543         parameter collision.
17545 2004-05-05  Raja R Harinath  <rharinath@novell.com>
17547         * expression.cs (MemberAccess.ResolveMemberAccess):
17548         Exit with non-zero status after Report.Error.
17549         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17550         Likewise.
17551         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17553 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17555         * support.cs: Don't hang when the file is empty.
17557 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17559         * support.cs: In SeekableStreamReader, compute the preamble size of the
17560           underlying stream. Position changes should take into account that initial
17561           count of bytes.
17563 2004-05-03  Todd Berman  <tberman@sevenl.net>
17565         * driver.cs: remove unused GetSysVersion function.
17567 2004-05-03  Todd Berman  <tberman@sevenl.net>
17569         * driver.cs: Remove the hack from saturday, as well as the hack
17570         from jackson (LoadAssemblyFromGac), also adds the CWD to the
17571         link_paths to get that bit proper.
17573 2004-05-01  Todd Berman  <tberman@sevenl.net>
17575         * driver.cs: Try a LoadFrom before a Load, this checks the current
17576         path. This is currently a bug in mono that is be fixed, however, this
17577         provides a workaround for now. This will be removed when the bug
17578         is fixed.
17580 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
17582         * CryptoConvert.cs: Updated to latest version. Fix issue with 
17583         incomplete key pairs (#57941).
17585 2004-05-01  Todd Berman  <tberman@sevenl.net>
17587         * driver.cs: Remove '.' from path_chars, now System.* loads properly
17588         from the GAC
17590 2004-04-30  Jackson Harper  <jackson@ximian.com>
17592         * codegen.cs: Open keys readonly.
17593         
17594 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17596         * typemanager.cs: don't report cyclic struct layout when a struct
17597         contains 2 or more fields of the same type. Failed for Pango.AttrShape
17598         which has 2 Pango.Rectangle fields.
17600 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17602         * expression.cs: Handle IntPtr comparisons with IL code
17603         rather than a method call.
17605 2004-04-29  Martin Baulig  <martin@ximian.com>
17607         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
17608         the list of PropertyInfo's in class hierarchy and find the
17609         accessor.  Fixes #56013.
17611 2004-04-29  Martin Baulig  <martin@ximian.com>
17613         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17615 2004-04-29  Martin Baulig  <martin@ximian.com>
17617         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17619         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17621 2004-04-29  Martin Baulig  <martin@ximian.com>
17623         * class.cs (ConstructorInitializer.Resolve): Check whether the
17624         parent .ctor is accessible.  Fixes #52146.
17626 2004-04-29  Martin Baulig  <martin@ximian.com>
17628         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17630         * statement.cs (Using.EmitLocalVariableDecls): Use
17631         TypeManager.idisposable_type, not typeof (IDisposable).
17632         (Foreach.EmitCollectionForeach): Added support for valuetypes.
17634 2004-04-29  Martin Baulig  <martin@ximian.com>
17636         * class.cs (Event.Define): Don't emit the field and don't set
17637         RTSpecialName and SpecialName for events on interfaces.  Fixes
17638         #57703. 
17640 2004-04-29  Raja R Harinath  <rharinath@novell.com>
17642         Refactor Attribute.ApplyAttributes.
17643         * attribute.cs (Attributable): New base class for objects that can
17644         have Attributes applied on them.
17645         (Attribute): Make AttributeUsage fields public.
17646         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17647         (Attribute.IsInternalCall): New property.
17648         (Attribute.UsageAttr): Convert to a public read-only property.
17649         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17650         (Attribute.ResolveType, Attribute.Resolve)
17651         (Attribute.ScanForIndexerName): Update to reflect changes.
17652         (Attribute.CheckAttributeTarget): Re-format.
17653         (Attribute.ApplyAttributes): Refactor, to various
17654         Attributable.ApplyAttributeBuilder methods.
17655         * decl.cs (MemberCore): Make Attributable.
17656         * class.cs (Accessor): Make Attributable.
17657         (MethodData.ApplyAttributes): Use proper attribute types, not
17658         attribute names.
17659         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17660         (TypeContainer.ApplyAttributeBuilder)
17661         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17662         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
17663         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17664         (Operator.ApplyAttributeBuilder): New factored-out methods.
17665         * const.cs (Const.ApplyAttributeBuilder): Likewise.
17666         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17667         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17668         * parameter.cs (ParameterBase): New Attributable base class
17669         that can also represent Return types.
17670         (Parameter): Update to the changes.
17672 2004-04-29  Jackson Harper  <jackson@ximian.com>
17674         * driver.cs: Prefer the corlib system version when looking for
17675         assemblies in the GAC. This is still a hack, but its a better hack
17676         now.
17677         
17678 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
17680         * decl.cs, enum.cs: Improved error 3005 reporting.
17681   
17682         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17683         (related_symbols): New private member for list of symbols
17684         related to reported error/warning.
17685         
17686         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17688 2004-04-29  Martin Baulig  <martin@ximian.com>
17690         * ecore.cs (Expression.Constantify): If we're an enum and
17691         TypeManager.TypeToCoreType() doesn't give us another type, use
17692         t.UnderlyingSystemType.  Fixes #56178.  
17694 2004-04-29  Martin Baulig  <martin@ximian.com>
17696         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17697         interfaces and for each interface, only add members directly
17698         declared in that interface.  Fixes #53255.
17700 2004-04-28  Martin Baulig  <martin@ximian.com>
17702         * expression.cs (ConditionalLogicalOperator): Use a temporary
17703         variable for `left' to avoid that we evaluate it more than once;
17704         bug #52588.
17706 2004-04-28  Martin Baulig  <martin@ximian.com>
17708         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17709         `void[]' (CS1547).
17711 2004-04-28  Martin Baulig  <martin@ximian.com>
17713         * statement.cs (LocalInfo.Resolve): Check whether the type is not
17714         void (CS1547).
17716         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17717         whether the type is not void (CS1547).
17719 2004-04-28  Martin Baulig  <martin@ximian.com>
17721         * expression.cs (Unary.DoResolveLValue): Override this and report
17722         CS0131 for anything but Operator.Indirection.
17724 2004-04-28  Martin Baulig  <martin@ximian.com>
17726         Committing a patch from Ben Maurer; see bug #50820.
17728         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17729         check for classes.
17731         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17732         classes.        
17734 2004-04-28  Martin Baulig  <martin@ximian.com>
17736         Committing a patch from Ben Maurer; see bug #50820.
17738         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17739         check for classes.
17741         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17742         classes.        
17744 2004-04-28  Martin Baulig  <martin@ximian.com>
17746         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17747         (Block.AddLabel): Call DoLookupLabel() to only search in the
17748         current block.
17750 2004-04-28  Martin Baulig  <martin@ximian.com>
17752         * cfold.cs (ConstantFold.BinaryFold): Added special support for
17753         comparing StringConstants and NullLiterals in Equality and Inequality.
17755 2004-04-28  Jackson Harper  <jackson@ximian.com>
17757         * driver.cs: Attempt to load referenced assemblies from the
17758         GAC. This is the quick and dirty version of this method that
17759         doesnt take into account versions and just takes the first
17760         canidate found. Will be good enough for now as we will not have more
17761         then one version installed into the GAC until I update this method.
17763 2004-04-28  Martin Baulig  <martin@ximian.com>
17765         * typemanager.cs (TypeManager.CheckStructCycles): New public
17766         static method to check for cycles in the struct layout.
17768         * rootcontext.cs (RootContext.PopulateTypes): Call
17769         TypeManager.CheckStructCycles() for each TypeContainer.
17770         [Note: We only need to visit each type once.]
17772 2004-04-28  Martin Baulig  <martin@ximian.com>
17774         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17776         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17777         success and added `out object value'.  Use a `bool resolved' field
17778         to check whether we've already been called rather than
17779         `ConstantValue != null' since this breaks for NullLiterals.
17781 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17783         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17784         setting of this flag, since the 'set' method may be non-public.
17786 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17788         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17789         check on current_vector.Block.
17791 2004-04-27  Martin Baulig  <martin@ximian.com>
17793         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17794         a field initializer.  Fixes #56459.
17796 2004-04-27  Martin Baulig  <martin@ximian.com>
17798         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17799         we're not attempting to use an indexer.  Fixes #52154.
17801 2004-04-27  Martin Baulig  <martin@ximian.com>
17803         * statement.cs (Return): Don't create a return label if we don't
17804         need it; reverts my change from January 20th.  Thanks to Ben
17805         Maurer for this.
17807 2004-04-27  Martin Baulig  <martin@ximian.com>
17809         According to the spec, `goto' can only leave a nested scope, but
17810         never enter it.
17812         * statement.cs (Block.LookupLabel): Only lookup in the current
17813         block, don't recurse into parent or child blocks.
17814         (Block.AddLabel): Check in parent and child blocks, report
17815         CS0140/CS0158 if we find a duplicate.
17816         (Block): Removed this indexer for label lookups.
17817         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17818         this already does the error reporting for us.
17820         * flowanalysis.cs
17821         (FlowBranching.UsageVector.Block): New public variable; may be null.
17822         (FlowBranching.CreateSibling): Added `Block' argument.
17823         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17824         label for the target of a `goto' and check whether we're not
17825         leaving a `finally'.
17827 2004-04-27  Martin Baulig  <martin@ximian.com>
17829         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17830         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17831         just for returns).
17833 2004-04-27  Martin Baulig  <martin@ximian.com>
17835         * statement.cs (Block.AddLabel): Also check for implicit blocks
17836         and added a CS0158 check.
17838 2004-04-27  Martin Baulig  <martin@ximian.com>
17840         * flowanalysis.cs (FlowBranchingLoop): New class.
17841         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17842         UsageVector's instead of an ArrayList.
17843         (FlowBranching.Label): Likewise.
17844         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17845         (FlowBranching.AddBreakVector): New method.
17847 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17849         * attribute.cs: Small regression fix: only convert the type if we
17850         the type is different, fixes System.Drawing build.
17852 2004-04-27  Martin Baulig  <martin@ximian.com>
17854         * attribute.cs (Attribute.Resolve): If we have a constant value
17855         for a named field or property, implicity convert it to the correct
17856         type.
17858 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17860         * statement.cs (Block.Block): Implicit blocks share
17861         'child_variable_names' fields with parent blocks.
17862         (Block.AddChildVariableNames): Remove.
17863         (Block.AddVariable): Mark variable as "used by a child block" in
17864         every surrounding block.
17865         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17866         been used in a child block, complain about violation of "Invariant
17867         meaning in blocks" rule.
17868         * cs-parser.jay (declare_local_variables): Don't use
17869         AddChildVariableNames.
17870         (foreach_statement): Don't create an implicit block: 'foreach'
17871         introduces a scope.
17873 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17875         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17876         converting from 0L to ulong.  Fixes 57522.
17878 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17880         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17881         derived class hides via 'new' keyword field from base class (test-242.cs).
17882         TODO: Handle this in the more general way.
17883         
17884         * class.cs (CheckBase): Ditto.
17886 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17888         * decl.cs (caching_flags): New member for storing cached values
17889         as bit flags.
17890         (MemberCore.Flags): New enum where bit flags for caching_flags
17891         are defined.
17892         (MemberCore.cls_compliance): Moved to caching_flags.
17893         (DeclSpace.Created): Moved to caching_flags.
17895         * class.cs: Use caching_flags instead of DeclSpace.Created
17896         
17897 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17899         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17900         if we are only a derived class, not a nested class.
17902         * typemanager.cs: Same as above, but do this at the MemberLookup
17903         level (used by field and methods, properties are handled in
17904         PropertyExpr).   Allow for the qualified access if we are a nested
17905         method. 
17907 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17909         * class.cs: Refactoring.
17910         (IMethodData): New inteface; Holds links to parent members
17911         to avoid member duplication (reduced memory allocation).
17912         (Method): Implemented IMethodData interface.
17913         (PropertyBase): New inner classes for get/set methods.
17914         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17915         (Event): New inner classes for add/remove methods.
17916         (Event.DelegateMethod): Implemented IMethodData interface.
17918         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17919         EmitContext (related to class.cs refactoring).
17921 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17923         * delegate.cs (Delegate.VerifyApplicability): If the number of
17924         arguments are the same as the number of parameters, first try to
17925         verify applicability ignoring  any 'params' modifier on the last
17926         parameter.
17927         Fixes #56442.
17929 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17931         * class.cs (TypeContainer.AddIndexer): Use
17932         'ExplicitInterfaceName' to determine if interface name was
17933         explicitly specified.  'InterfaceType' is not initialized at this time.
17934         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17935         Indexers array is already in the required order.  Initialize
17936         'IndexerName' only if there are normal indexers.
17937         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17938         (TypeContainer.Emit): Emit DefaultMember attribute only if
17939         IndexerName is initialized.
17940         Fixes #56300.
17942 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17944         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17945         Fixes #57007
17947 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17949         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17950         attributes.
17951         Fix for #56456.
17953         * attribute.cs (Attribute.Resolve): Check for duplicate named
17954         attributes.
17955         Fix for #56463.
17957 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17959         * iterators.cs (MarkYield): track whether we are in an exception,
17960         and generate code accordingly.  Use a temporary value to store the
17961         result for our state.
17963         I had ignored a bit the interaction of try/catch with iterators
17964         since their behavior was not entirely obvious, but now it is
17965         possible to verify that our behavior is the same as MS .NET 2.0
17967         Fixes 54814
17969 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17971         * iterators.cs: Avoid creating temporaries if there is no work to
17972         do. 
17974         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17975         Enumerations, use TypeManager.EnumToUnderlying and call
17976         recursively. 
17978         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17979         bug #57013
17981         (This.Emit): Use EmitContext.EmitThis to emit our
17982         instance variable.
17984         (This.EmitAssign): Ditto.
17986         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17987         codepaths, we will move all the functionality into
17988         Mono.CSharp.This 
17990         (FieldExpr.EmitAssign): Ditto.
17992         This fixes several hidden bugs that I uncovered while doing a code
17993         review of this today.
17995         * codegen.cs (EmitThis): reworked so the semantics are more clear
17996         and also support value types "this" instances.
17998         * iterators.cs: Changed so that for iterators in value types, we
17999         do not pass the value type as a parameter.  
18001         Initialization of the enumerator helpers is now done in the caller
18002         instead of passing the parameters to the constructors and having
18003         the constructor set the fields.
18005         The fields have now `assembly' visibility instead of private.
18007 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
18009         * expression.cs (Argument.Resolve): Check if fields passed as ref
18010         or out are contained in a MarshalByRefObject.
18012         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
18013         another compiler type.
18015 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
18017         * class.cs (Indexer.Define): use the new name checking method.
18018         Also, return false on an error.
18019         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
18020         (is_identifier_[start/part]_character): make static.
18022 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
18024         * expression.cs (Binary.ResolveOperator): Do no append strings
18025         twice: since we can be invoked more than once (array evaluation)
18026         on the same concatenation, take care of this here.  Based on a fix
18027         from Ben (bug #56454)
18029 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
18031         * codegen.cs: Fix another case where CS1548 must be reported (when 
18032         delay-sign isn't specified and no private is available #56564). Fix
18033         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
18034         error when MCS is used on the MS runtime and we need to delay-sign 
18035         (which seems unsupported by AssemblyBuilder - see #56621).
18037 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
18039         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
18040         (TypeManager.ComputeNamespaces): Faster implementation for
18041         Microsoft runtime.
18043         * compiler.csproj: Updated AssemblyName to mcs.
18045 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
18047         * rootcontext.cs: Add new types to the boot resolution.
18049         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
18050         MulticastDelegate is not allowed.
18052         * typemanager.cs: Add new types to lookup: System.TypedReference
18053         and ArgIterator.
18055         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
18056         check for TypedReference or ArgIterator, they are not allowed. 
18058         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
18059         makes us properly catch 1510 in some conditions (see bug 56016 for
18060         details). 
18062 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
18064         * CryptoConvert.cs: update from corlib version
18065         with endian fixes.
18067 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
18069         * class.cs (Indexer.Define): Check indexername declaration
18071 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
18073         * attribute.cs (IsClsCompliant): Fixed problem with handling
18074         all three states (compliant, not-compliant, undetected).
18076 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
18078         * attribute.cs (Attribute): Location is now public.
18079         (Resolve): Store resolved arguments (pos_values) in attribute class.
18080         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
18081         (GetClsCompliantAttributeValue): New method that gets
18082         CLSCompliantAttribute value.
18083         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
18084         if exists else null.
18085         (AttributeTester): New class for CLS-Compliant verification routines.
18087         * class.cs (Emit): Add CLS-Compliant verification.
18088         (Method.GetSignatureForError): Implemented.
18089         (Constructor.GetSignatureForError): Implemented
18090         (Constructor.HasCompliantArgs): Returns if constructor has
18091         CLS-Compliant arguments.
18092         (Constructor.Emit): Override.
18093         (Construcor.IsIdentifierClsCompliant): New method; For constructors
18094         is needed to test only parameters.
18095         (FieldBase.GetSignatureForError): Implemented.
18096         (TypeContainer): New member for storing base interfaces.
18097         (TypeContainer.FindMembers): Search in base interfaces too.
18099         * codegen.cs (GetClsComplianceAttribute): New method that gets
18100         assembly or module CLSCompliantAttribute value.
18101         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
18102         for assembly.
18103         (ModuleClass.Emit): Add error 3012 test.
18105         * const.cs (Emit): Override and call base for CLS-Compliant tests.
18107         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
18108         state for all decl types.
18109         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
18110         if CLS-Compliant tests are required.
18111         (IsClsCompliaceRequired): New method. Analyze whether code
18112         must be CLS-Compliant.
18113         (IsExposedFromAssembly): New method. Returns true when MemberCore
18114         is exposed from assembly.
18115         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
18116         value or gets cached value.
18117         (HasClsCompliantAttribute): New method. Returns true if MemberCore
18118         is explicitly marked with CLSCompliantAttribute.
18119         (IsIdentifierClsCompliant): New abstract method. This method is
18120         used to testing error 3005.
18121         (IsIdentifierAndParamClsCompliant): New method. Common helper method
18122         for identifier and parameters CLS-Compliant testing.
18123         (VerifyClsCompliance): New method. The main virtual method for
18124         CLS-Compliant verifications.
18125         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
18126         null. I don't know why is null (too many public members !).
18127         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
18128         and get value of first CLSCompliantAttribute that found.
18130         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
18131         (VerifyClsCompliance): Override and add extra tests.
18133         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
18134         clscheck- disable CLS-Compliant verification event if assembly is has
18135         CLSCompliantAttribute(true).
18137         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
18138         ApllyAttribute is now called in emit section as in the other cases.
18139         Possible future Emit integration.
18140         (IsIdentifierClsCompliant): New override.
18141         (VerifyClsCompliance): New override.
18142         (GetEnumeratorName): Returns full enum name.
18144         * parameter.cs (GetSignatureForError): Implemented.
18146         * report.cs (WarningData): New struct for Warning message information.
18147         (LocationOfPreviousError): New method.
18148         (Warning): New method. Reports warning based on the warning table.
18149         (Error_T): New method. Reports error based on the error table.
18151         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
18152         verifications are done here.
18154         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
18156         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
18157         CLSCompliantAttribute.
18158         (all_imported_types): New member holds all imported types from other
18159         assemblies.
18160         (LoadAllImportedTypes): New method fills static table with exported types
18161         from all referenced assemblies.
18162         (Modules): New property returns all assembly modules.
18164 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
18166         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
18167         throwing a parser error.
18169         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
18170         which removes the hardcoded get_/set_ prefixes for properties, as
18171         IL allows for the properties to be named something else.  
18173         Bug #56013
18175         * expression.cs: Do not override operand before we know if it is
18176         non-null.  Fix 56207
18178 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18180         * typemanager.cs: support for pinned variables.
18182 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18184         * decl.cs, typemanager.cs: Avoid using an arraylist
18185         as a buffer if there is only one result set.
18187 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18189         * expression.cs: Make sure you cant call a static method
18190         with an instance expression, bug #56174.
18192 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
18194         * class.cs (IsDuplicateImplementation): Improve error reporting to
18195         flag 663 (method only differs in parameter modifier).
18197         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
18198         in preprocessor directives.
18200         * location.cs (LookupFile): Allow for the empty path.
18202         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
18203         better approach for some of that patch, but its failing with the
18204         CharSet enumeration.  For now try/catch will do.
18206         * typemanager.cs: Do not crash if a struct does not have fields.
18207         Fixes 56150.
18209 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18211         * expression.cs: cs0213, cant fix a fixed expression.
18212         fixes 50231.
18214 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18216         * cs-parser.jay: detect invalid embeded statements gracefully.
18217         bug #51113.
18219 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18221         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
18222         As a regex:
18223         s/
18224         the invocation type may not be a subclass of the tye of the item/
18225         The type of the item must be a subclass of the invocation item.
18226         /g
18228         Fixes bug #50820.
18230 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
18232         * attribute.cs: Added methods to get a string and a bool from an
18233         attribute. Required to information from AssemblyKeyFileAttribute,
18234         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18235         * codegen.cs: Modified AssemblyName creation to include support for
18236         strongnames. Catch additional exceptions to report them as CS1548.
18237         * compiler.csproj: Updated include CryptoConvert.cs.
18238         * compiler.csproj.user: Removed file - user specific configuration.
18239         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
18240         Mono.Security assembly. The original class is maintained and tested in
18241         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18242         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18243         like CSC 8.0 (C# v2) supports.
18244         * Makefile: Added CryptoConvert.cs to mcs sources.
18245         * rootcontext.cs: Added new options for strongnames.
18247 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
18249         * driver.cs: For --expect-error, report error code `2'
18250         if the program compiled with no errors, error code `1' if
18251         it compiled with an error other than the one expected.
18253 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
18255         * compiler.csproj: Updated for Visual Studio .NET 2003.
18256         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18257         * compiler.sln: Updated for Visual Studio .NET 2003.
18259 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
18261         * expression.cs: Fix bug #47234. We basically need to apply the
18262         rule that we prefer the conversion of null to a reference type
18263         when faced with a conversion to 'object' (csc behaviour).
18265 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18267         * statement.cs: Shorter form for foreach, eliminates
18268         a local variable. r=Martin.
18270 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18272         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18273         checks if we can use brtrue/brfalse to test for 0.
18274         * expression.cs: use the above in the test for using brtrue/brfalse.
18275         cleanup code a bit.
18277 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18279         * expression.cs: Rewrite string concat stuff. Benefits:
18281         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18282         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18283         rather than a concat chain.
18285         * typemanager.cs: Add lookups for more concat overloads.
18287 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18289         * expression.cs: Emit shorter il code for array init.
18291         newarr
18292         dup
18293         // set 1
18295         // set 2
18297         newarr
18298         stloc.x
18300         ldloc.x
18301         // set 1
18303         ldloc.x
18304         // set 2
18306 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
18308         * statement.cs: Before, two switch blocks would be merged if the
18309         total size of the blocks (end_item - begin_item + 1) was less than
18310         two times the combined sizes of the blocks.
18312         Now, it will only merge if after the merge at least half of the
18313         slots are filled.
18315         fixes 55885.
18317 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
18319         * class.cs : csc build fix for GetMethods(). See bug #52503.
18321 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
18323         * expression.cs: Make sure fp comparisons work with NaN.
18324         This fixes bug #54303. Mig approved this patch a long
18325         time ago, but we were not able to test b/c the runtime
18326         had a related bug.
18328 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
18330         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
18332 2004-03-19  Martin Baulig  <martin@ximian.com>
18334         * class.cs (MemberCore.IsDuplicateImplementation): Report the
18335         error here and not in our caller.
18337 2004-03-19  Martin Baulig  <martin@ximian.com>
18339         * interface.cs: Completely killed this file.
18340         (Interface): We're now a TypeContainer and live in class.cs.
18342         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18343         argument; we're now also called for interfaces.
18344         (TypeContainer.DefineMembers): Allow this method being called
18345         multiple times.
18346         (TypeContainer.GetMethods): New public method; formerly known as
18347         Interface.GetMethod().  This is used by PendingImplementation.
18348         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18349         it's now private and non-static.
18350         (Interface): Moved this here; it's now implemented similar to
18351         Class and Struct.
18352         (Method, Property, Event, Indexer): Added `bool is_interface'
18353         argument to their .ctor's.
18354         (MemberBase.IsInterface): New public field.
18356         * cs-parser.jay: Create normal Method, Property, Event, Indexer
18357         instances instead of InterfaceMethod, InterfaceProperty, etc.
18358         (opt_interface_base): Removed; we now use `opt_class_base' instead.
18359         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18361 2004-03-19  Martin Baulig  <martin@ximian.com>
18363         * class.cs (MethodCore.IsDuplicateImplementation): New private
18364         method which does the CS0111 checking.
18365         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18366         Use IsDuplicateImplementation().
18368 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
18370         * decl.cs (FindMemberToOverride): New method to find the correct
18371         method or property to override in the base class.
18372         * class.cs
18373             - Make Method/Property use the above method to find the
18374               version in the base class.
18375             - Remove the InheritableMemberSignatureCompare as it is now
18376               dead code.
18378         This patch makes large code bases much faster to compile, as it is
18379         O(n) rather than O(n^2) to do this validation.
18381         Also, it fixes bug 52458 which is that nested classes are not
18382         taken into account when finding the base class member.
18384         Reviewed/Approved by Martin.
18386 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
18388         * interface.cs: In all interface classes removed redundant
18389         member initialization.
18391 2004-03-16  Martin Baulig  <martin@ximian.com>
18393         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18395 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
18397         * decl.cs (DefineTypeAndParents): New helper method to define a
18398         type's containers before the type itself is defined;  This is a
18399         bug exposed by the recent changes to Windows.Forms when an
18400         implemented interface was defined inside a class that had not been
18401         built yet.   
18403         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18405         (Check): Loop correctly to report errors modifiers
18406         (UNSAFE was not in the loop, since it was the same as TOP).
18408         * interface.cs: Every interface member now takes a ModFlags,
18409         instead of a "is_new" bool, which we set on the base MemberCore. 
18411         Every place where we called "UnsafeOk" in the interface, now we
18412         call the proper member (InterfaceMethod.UnsafeOK) instead to get
18413         the unsafe settings from the member declaration instead of the
18414         container interface. 
18416         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
18418         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18419         `set_indexer_name' to the pending bits (one per type).
18421         We fixed a bug today that was picking the wrong method to
18422         override, since for properties the existing InterfaceMethod code
18423         basically ignored the method name.  Now we make sure that the
18424         method name is one of the valid indexer names.
18426 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
18428         * support.cs (SeekableStreamReader): Keep track of stream byte
18429         positions and don't mix them with character offsets to the buffer.
18431         Patch from Gustavo Giráldez
18433 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
18435         * interface.cs (InterfaceSetGetBase): Removed double member
18436         initialization, base class does it as well.
18438 2004-03-13  Martin Baulig  <martin@ximian.com>
18440         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18441         when compiling corlib.
18443 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
18445         * convert.cs (ExplicitConversion): We were reporting an error on
18446         certain conversions (object_type source to a value type, when the
18447         expression was `null') before we had a chance to pass it through
18448         the user defined conversions.
18450         * driver.cs: Replace / and \ in resource specifications to dots.
18451         Fixes 50752
18453         * class.cs: Add check for duplicate operators.  Fixes 52477
18455 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
18457         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18458         that are in the middle of the statements, not only at the end.
18459         Fixes #54987
18461         * class.cs (TypeContainer.AddField): No longer set the
18462         `HaveStaticConstructor' flag, now we call it
18463         `UserDefineStaticConstructor' to diferentiate the slightly
18464         semantic difference.
18466         The situation is that we were not adding BeforeFieldInit (from
18467         Modifiers.TypeAttr) to classes that could have it.
18468         BeforeFieldInit should be set to classes that have no static
18469         constructor. 
18471         See:
18473         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18475         And most importantly Zoltan's comment:
18477         http://bugzilla.ximian.com/show_bug.cgi?id=44229
18479         "I think beforefieldinit means 'it's ok to initialize the type sometime 
18480          before its static fields are used', i.e. initialization does not need
18481          to be triggered by the first access to the type. Setting this flag
18482          helps the JIT to compile better code, since it can run the static
18483          constructor at JIT time, and does not need to generate code to call it
18484          (possibly lots of times) at runtime. Unfortunately, mcs does not set
18485          this flag for lots of classes like String. 
18486          
18487          csc sets this flag if the type does not have an explicit static 
18488          constructor. The reasoning seems to be that if there are only static
18489          initalizers for a type, and no static constructor, then the programmer
18490          does not care when this initialization happens, so beforefieldinit
18491          can be used.
18492          
18493          This bug prevents the AOT compiler from being usable, since it 
18494          generates so many calls to mono_runtime_class_init that the AOT code
18495          is much slower than the JITted code. The JITted code is faster, 
18496          because it does not generate these calls if the vtable is type is
18497          already initialized, which is true in the majority of cases. But the
18498          AOT compiler can't do this."
18500 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
18502         * class.cs (MethodData.Emit): Refactor the code so symbolic
18503         information is generated for destructors;  For some reasons we
18504         were taking a code path that did not generate symbolic information
18505         before. 
18507 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18509         * class.cs: Create a Constructor.CheckBase method that
18510         takes care of all validation type code. The method
18511         contains some code that was moved from Define.
18513         It also includes new code that checks for duplicate ctors.
18514         This fixes bug #55148.
18516 2004-03-09  Joshua Tauberer <tauberer@for.net>
18518         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18519         a { ... }-style array creation invokes EmitStaticInitializers
18520         which is not good for reference-type arrays.  String, decimal
18521         and now null constants (NullCast) are not counted toward
18522         static initializers.
18524 2004-03-05  Martin Baulig  <martin@ximian.com>
18526         * location.cs (SourceFile.HasLineDirective): New public field;
18527         specifies whether the file contains or is referenced by a "#line"
18528         directive.
18529         (Location.DefineSymbolDocuments): Ignore source files which
18530         either contain or are referenced by a "#line" directive.        
18532 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
18534         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18535         direct access to our parent, so check the method inline there.
18537 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18539         * expression.cs (Invocation.EmitCall): Miguel's last commit
18540         caused a regression. If you had:
18542             T t = null;
18543             t.Foo ();
18545         In Foo the implict this would be null.
18547 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
18549         * expression.cs (Invocation.EmitCall): If the method is not
18550         virtual, do not emit a CallVirt to it, use Call.
18552         * typemanager.cs (GetFullNameSignature): Improve the method to
18553         cope with ".ctor" and replace it with the type name.
18555         * class.cs (ConstructorInitializer.Resolve): Now the method takes
18556         as an argument the ConstructorBuilder where it is being defined,
18557         to catch the recursive constructor invocations.
18559 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
18561         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18562         routines to check if a type is an enumerable/enumerator allow
18563         classes that implement the IEnumerable or IEnumerator interfaces.
18565         * class.cs (Property, Operator): Implement IIteratorContainer, and
18566         implement SetYields.
18568         (Property.Define): Do the block swapping for get_methods in the
18569         context of iterators.   We need to check if Properties also
18570         include indexers or not.
18572         (Operator): Assign the Block before invoking the
18573         OperatorMethod.Define, so we can trigger the Iterator code
18574         replacement. 
18576         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
18577         Property and Operator classes are not created when we parse the
18578         declarator but until we have the block completed, so we use a
18579         singleton SimpleIteratorContainer.Simple to flag whether the
18580         SetYields has been invoked.
18582         We propagate this setting then to the Property or the Operator to
18583         allow the `yield' to function.
18585 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
18587         * codegen.cs: Implemented attribute support for modules.
18588         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18589         Assembly/Module functionality.
18591         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18592         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18593         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18595 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
18597         * interface.cs (FindMembers): The operation is performed on all base
18598         interfaces and not only on the first. It is required for future CLS Compliance patch.
18600 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18602         * statement.cs, codegen.cs:
18603         This patch deals with patterns such as:
18605         public class List : IEnumerable {
18607                 public MyEnumerator GetEnumerator () {
18608                         return new MyEnumerator(this);
18609                 }
18611                 IEnumerator IEnumerable.GetEnumerator () {
18612                         ...
18613                 }
18614                 
18615                 public struct MyEnumerator : IEnumerator {
18616                         ...
18617                 }
18618         }
18620         Before, there were a few things we did wrong:
18621         1) we would emit callvirt on a struct, which is illegal
18622         2) we emited ldarg when we needed to emit ldarga
18623         3) we would mistakenly call the interface methods on an enumerator
18624         type that derived from IEnumerator and was in another assembly. For example:
18626         public class MyEnumerator : IEnumerator
18628         Would have the interface methods called, even if there were public impls of the
18629         method. In a struct, this lead to invalid IL code.
18631 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
18633         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18634           renamed to Emit.
18636         * delegate.cs (Define): Fixed crash when delegate type is undefined.
18638 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
18640         * cs-parser.jay: Fix small regression: we were not testing V2
18641         compiler features correctly.
18643         * interface.cs: If the emit context is null, then create one
18645 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
18647         * decl.cs (GetSignatureForError): New virtual method to get full name
18648           for error messages.
18650         * attribute.cs (IAttributeSupport): New interface for attribute setting.
18651           Now it is possible to rewrite ApplyAttributes method to be less if/else.
18653         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18654           Duplicated members and code in these classes has been removed.
18655           Better encapsulation in these classes.
18657 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
18659         * assign.cs (Assign.DoResolve): When dealing with compound
18660         assignments, there is a new rule in ECMA C# 2.4 (might have been
18661         there before, but it is documented here) that states that in:
18663         a op= b;
18665         If b is of type int, and the `op' is a shift-operator, then the
18666         above is evaluated as:
18668         a = (int) a op b 
18670         * expression.cs (Binary.ResolveOperator): Instead of testing for
18671         int/uint/long/ulong, try to implicitly convert to any of those
18672         types and use that in pointer arithmetic.
18674         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18675         method to print information for from the type, not from the
18676         null-method we were given.
18678 2004-02-01  Duncan Mak  <duncan@ximian.com>
18680         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18681         parsing for cmd, fixes bug #53694.
18683 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
18685         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18686         in the member name duplication tests. Property and operator name duplication
18687         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18689 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
18691         * interface.cs (PopulateMethod): Fixed crash when interface method
18692         returns not existing type (error test cs0246-3.cs).
18694 2004-02-02  Ravi Pratap M <ravi@ximian.com>
18696         * cs-parser.jay (interface_accessors): Re-write actions to also
18697         store attributes attached to get and set methods. Fix spelling
18698         while at it.
18700         (inteface_property_declaration): Modify accordingly.
18702         (InterfaceAccessorInfo): New helper class to store information to pass
18703         around between rules that use interface_accessors.
18705         * interface.cs (Emit): Apply attributes on the get and set
18706         accessors of properties and indexers too.
18708         * attribute.cs (ApplyAttributes): Modify accordingly to use the
18709         right MethodBuilder when applying attributes to the get and set accessors.
18711 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
18713         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18715 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
18717         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18719 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
18721         * cs-parser.jay: Remove YIELD token, instead use the new grammar
18722         changes that treat `yield' specially when present before `break'
18723         or `return' tokens.
18725         * cs-tokenizer.cs: yield is no longer a keyword.
18727 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
18729         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18730         setting for default constructors.
18731         For default constructors are almost every time set wrong Modifier. The
18732         generated IL code has been alright. But inside mcs this values was
18733         wrong and this was reason why several of my CLS Compliance tests
18734         failed.
18736 2004-01-22  Martin Baulig  <martin@ximian.com>
18738         * cs-parser.jay (namespace_or_type_name): Return an Expression,
18739         not a QualifiedIdentifier.  This is what `type_name_expression'
18740         was previously doing.
18741         (type_name_expression): Removed; the code is now in
18742         `namespace_or_type_name'.
18743         (qualified_identifier): Removed, use `namespace_or_type_name'
18744         instead.
18745         (QualifiedIdentifier): Removed this class.      
18747 2004-01-22  Martin Baulig  <martin@ximian.com>
18749         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18750         not a string as alias name.
18752 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
18754         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18755         #52730 bug, and instead compute correctly the need to use a
18756         temporary variable when requesting an address based on the
18757         static/instace modified of the field and the constructor.
18759 2004-01-21  Martin Baulig  <martin@ximian.com>
18761         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18762         class and namespace before looking up aliases.  Fixes #52517.
18764 2004-01-21  Martin Baulig  <martin@ximian.com>
18766         * flowanalysis.cs (UsageVector.Merge): Allow variables being
18767         assinged in a 'try'; fixes exception4.cs.
18769 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18770         * class.cs : Implemented parameter-less constructor for TypeContainer
18772         * decl.cs: Attributes are now stored here. New property OptAttributes
18774         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18776         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18778 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18780         * typemanager.cs (CSharpSignature): Now reports also inner class name.
18781           (CSharpSignature): New method for indexer and property signature.
18783 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18785         * pending.cs (IsVirtualFilter): Faster implementation.
18787 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18789         * typemanager.cs: Avoid inclusion of same assembly more than once.
18791 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18793         * cs-parser.jay: Fixed problem where the last assembly attribute
18794           has been applied also to following declaration (class, struct, etc.)
18795           
18796 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18798         * class.cs: Added error CS0538, CS0539 reporting.
18799         Fixed crash on Microsoft runtime when field type is void.
18801         * cs-parser.jay: Added error CS0537 reporting.
18803         * pending.cs: Added error CS0535 reporting.
18804         Improved error report for errors CS0536, CS0534.
18806 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18808         Merge a few bits from the Anonymous Method MCS tree.
18810         * statement.cs (ToplevelBlock): New class for toplevel methods,
18811         will hold anonymous methods, lifted variables.
18813         * cs-parser.jay: Create toplevel blocks for delegates and for
18814         regular blocks of code. 
18816 2004-01-20  Martin Baulig  <martin@ximian.com>
18818         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18819         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18820         and `NeedExplicitReturn'; added `IsLastStatement'.
18821         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18822         have a `ReturnLabel' or we're not unreachable.
18824         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18825         child's reachability; don't just override ours with it.  Fixes
18826         #58058 (lluis's example).
18827         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18828         InFinally(), InLoop(), InSwitch() and
18829         BreakCrossesTryCatchBoundary() methods.
18831         * statement.cs (Return): Do all error checking in Resolve().
18832         Unless we are the last statement in a top-level block, always
18833         create a return label and jump to it.
18834         (Break, Continue): Do all error checking in Resolve(); also make
18835         sure we aren't leaving a `finally'.
18836         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18837         statement in a top-level block.
18838         (Block.Flags): Added `IsDestructor'.
18839         (Block.IsDestructor): New public property.
18841 2004-01-20  Martin Baulig  <martin@ximian.com>
18843         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18845 2004-01-20  Martin Baulig  <martin@ximian.com>
18847         * statement.cs (Statement.ResolveUnreachable): New public method.
18848         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18849         (Block.Resolve): Resolve unreachable statements.
18851 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18853         * expression.cs: We need to fix the case where we do
18854         not have a temp variable here.
18856         * assign.cs: Only expression compound assignments need
18857         temporary variables.
18859 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18861         * flowanalysis.cs: Reduce memory allocation in a few ways:
18862           - A block with no variables should not allocate a bit
18863             vector for itself.
18864           - A method with no out parameters does not need any tracking
18865             for assignment of the parameters, so we need not allocate
18866             any data for it.
18867           - The arrays:
18868                 public readonly Type[] VariableTypes;
18869                 public readonly string[] VariableNames;
18870             Are redundant. The data is already stored in the variable
18871             map, so we need not allocate another array for it.
18872           - We need to add alot of checks for if (params | locals) == null
18873             due to the first two changes.
18875 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18877         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18878         implement IMemoryLocation, we store a copy on a local variable and
18879         take the address of it.  Patch from Benjamin Jemlich
18881         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18882         to use a special "type_name_expression" rule which reduces the
18883         number of "QualifiedIdentifier" classes created, and instead
18884         directly creates MemberAccess expressions.
18886 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18888         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18889         that fixes #52853.  Null literal assignment to ValueType
18891         * class.cs (MethodData.Emit): Instead of checking the name of the
18892         method to determine if its a destructor, create a new derived
18893         class from Method called Destructor, and test for that.  
18895         * cs-parser.jay: Create a Destructor object instead of a Method.  
18897         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18899         Fixes: 52933
18901 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18903         * expression.cs (Binary.ResolveOperator): Perform an implicit
18904         conversion from MethodGroups to their delegate types on the
18905         Addition operation.
18907         * delegate.cs: Introduce a new class DelegateCreation that is the
18908         base class for `NewDelegate' and `ImplicitDelegateCreation',
18909         factor some code in here.
18911         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18912         conversion from MethodGroups to compatible delegate types. 
18914         * ecore.cs (Expression.Resolve): Do not flag error 654
18915         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18916         we allow conversions from MethodGroups to delegate types now.
18918         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18919         assignments in v2 either.
18921 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18923         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18924         static read-only fields in ctors.
18926         Applied patch from Benjamin Jemlich 
18928         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18930 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18932         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18933         here to return true, as they can be used like this:
18935                 (XXX) int.MEMBER ()
18937         Fixed 49836 and all the other dups
18939 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18941         * driver.cs: Implement /win32res and /win32icon.
18943 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18945         * cs-parser.jay: Add a rule to improve error handling for the
18946         common mistake of placing modifiers after the type.
18948 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18950         * cs-parser.jay (interface_event_declaration): Catch
18951         initialization of events on interfaces, and report cs0068
18953         * cs-parser.jay (interface_event_declaration): Catch
18954         initialization of events. 
18956         * ecore.cs: Better report missing constructors.
18958         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18959         the error reporting done in the wrong place.  Fix.
18961         * expression.cs (Binary.ResolveOperator): Catch the 
18962         operator + (E x, E y) error earlier, and later allow for implicit
18963         conversions in operator +/- (E e, U x) from U to the underlying
18964         type of E.
18966         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18967         52596, if the container class is abstract, the default constructor
18968         is protected otherwise its public (before, we were always public).
18970         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18971         fixed statement.
18973         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18974         Jemlich that fixes bug #52597, MCS was generating invalid code for
18975         idisposable structs.   Thanks to Ben for following up with this
18976         bug as well.
18978 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18980         * driver.cs: Allow assemblies without code to be generated, fixes
18981         52230.
18983 2004-01-07  Nick Drochak <ndrochak@gol.com>
18985         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18987 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18989         * cs-parser.jay: Add rules to improve error reporting if fields or
18990         methods are declared at the namespace level (error 116)
18992         * Add rules to catch event add/remove
18994 2004-01-04  David Sheldon <dave-mono@earth.li>
18996   * expression.cs: Added matching ")" to error message for 
18997   CS0077
18999 2004-01-03 Todd Berman <tberman@gentoo.org>
19001         * ecore.cs, attribute.cs:
19002         Applying fix from #52429.
19004 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19006         * ecore.cs, expression.cs, statement.cs:
19007         Total rewrite of how we handle branching. We
19008         now handle complex boolean expressions with fewer
19009         jumps. As well if (x == 0) no longer emits a ceq.
19011         if (x is Foo) is much faster now, because we generate
19012         better code.
19014         Overall, we get a pretty big improvement on our benchmark
19015         tests. The code we generate is smaller and more readable.
19017         I did a full two-stage bootstrap. The patch was reviewed
19018         by Martin and Miguel.
19020 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19022         * cs-parser.jay: Make primary_expression not take a QI.
19023         we dont need this because the member_access rule covers
19024         us here. So we replace the rule with just IDENTIFIER.
19026         This has two good effects. First, we remove a s/r conflict.
19027         Second, we allocate many fewer QualifiedIdentifier objects.
19029 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19031         * attribute.cs: Handle MarshalAs attributes as pseudo, and
19032         set the correct information via SRE. This prevents
19033         hanging on the MS runtime. Fixes #29374.
19035 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19037         * convert.cs: correctly handle conversions to value types
19038         from Enum and ValueType as unboxing conversions.
19040         Fixes bug #52569. Patch by Benjamin Jemlich.
19042 2004-01-02  Ravi Pratap  <ravi@ximian.com>
19044         * expression.cs (BetterConversion): Prefer int -> uint
19045         over int -> ulong (csc's behaviour). This fixed bug #52046.
19047 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
19049         * decl.cs (MemberCache.FindMembers): now returns a
19050         MemberInfo [].
19052         * typemanager.cs: In general, go with with ^^.
19053         (CopyNewMethods): take an IList.
19054         (RealMemberLookup): Only allocate an arraylist
19055         if we copy from two sets of methods.
19057         This change basically does two things:
19058         1) Fewer array lists allocated due to CopyNewMethods.
19059         2) the explicit cast in MemberList costed ALOT.
19061 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
19063         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
19064         a hashtable to avoid needless string allocations when an identifier is
19065         used more than once (the common case).
19067 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
19069         * pending.cs: MS's TypeBuilder.GetInterfaces ()
19070         is broken, it will not return anything. So, we
19071         have to use the information we have in mcs to
19072         do the task.
19074         * typemanager.cs: Add a cache for GetInterfaces,
19075         since this will now be used more often (due to ^^)
19077         (GetExplicitInterfaces) New method that gets the
19078         declared, not effective, interfaces on a type
19079         builder (eg, if you have interface IFoo, interface
19080         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
19081         { IBar }.
19083         This patch makes MCS able to bootstrap itself on
19084         Windows again.
19086 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
19088         * expression.cs: Remove the Nop's that Miguel put
19089         in by mistake.
19091 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
19093         * report.cs, codegen.cs: Give the real stack trace to
19094         the error when an exception is thrown.
19096 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
19098         * decl.cs: only allocate hashtables for ifaces if 
19099         it is an iface!
19101 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
19103         * expression.cs: fix the error from cs0121-2.cs
19104         (a parent interface has two child interfaces that
19105         have a function with the same name and 0 params
19106         and the function is called through the parent).
19108 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
19110         * class.cs, rootcontext.cs, typmanager.cs: do not
19111         leak pointers.
19113 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
19115         * codegen.cs: remove stack for the ec flow branching.
19116         It is already a linked list, so no need.
19118 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
19120         * Makefile: Allow custom profiler here.
19122 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
19124         * typemanager.cs (LookupType):
19125           - Use a static char [], because split takes
19126             a param array for args, so it was allocating
19127             every time.
19128           - Do not store true in a hashtable, it boxes.
19130 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
19132         * flowanalysis.cs: bytify common enums.
19134 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19136         * modifiers.cs: Add a new set of flags for the
19137         flags allowed on explicit interface impls.
19138         * cs-parser.jay: catch the use of modifiers in
19139         interfaces correctly.
19140         * class.cs: catch private void IFoo.Blah ().
19142         All related to bug #50572.
19144 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19146         * decl.cs: Rewrite the consistant accessability checking.
19147         Accessability is not linear, it must be implemented in
19148         a tableish way. Fixes #49704.
19150 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19152         * expression.cs: Handle negation in a checked context.
19153         We must use subtraction from zero. Fixes #38674.
19155 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
19157         * class.cs: Ignore static void main in DLLs.
19158         * rootcontext.cs: Handle the target type here,
19159         since we are have to access it from class.cs
19160         * driver.cs: account for the above.
19162 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
19164         * report.cs: Give line numbers and files if available.
19166 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
19168         * driver.cs: Implement /addmodule.
19170         * typemanager.cs:  Change 'modules' field so it now contains Modules not
19171         ModuleBuilders.
19173 2003-12-20  Martin Baulig  <martin@ximian.com>
19175         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
19176         (FieldBase.IsAssigned): Removed this field.
19177         (FieldBase.SetAssigned): New public method.
19178         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
19180 2003-12-20  Martin Baulig  <martin@ximian.com>
19182         * expression.cs (LocalVariableReference.DoResolve): Don't set
19183         `vi.Used' if we're called from DoResolveLValue().
19185         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
19186         returns the usage vector it just merged into the current one -
19187         pass this one to UsageWarning().
19188         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
19189         of the `EmitContext', don't call this recursively on our children.
19191 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
19193         * driver.cs: Implement /target:module.
19195 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
19197         * support.cs (CharArrayHashtable): New helper class.
19199         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
19200         char arrays, not strings, so we can avoid creating a string in
19201         consume_identifier if the identifier is a keyword.
19203 2003-12-16  Martin Baulig  <martin@ximian.com>
19205         * statement.cs (LocalInfo.Assigned): Removed this property.
19206         (LocalInfo.Flags): Removed `Assigned'.
19207         (LocalInfo.IsAssigned): New public method; takes the EmitContext
19208         and uses flow analysis.
19209         (Block.UsageWarning): Made this method private.
19210         (Block.Resolve): Call UsageWarning() if appropriate.
19212         * expression.cs (LocalVariableReference.DoResolve): Always set
19213         LocalInfo.Used here.
19215 2003-12-13  Martin Baulig  <martin@ximian.com>
19217         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
19218         any value here; we're now using flow analysis to figure out
19219         whether a statement/block returns a value.
19221 2003-12-13  Martin Baulig  <martin@ximian.com>
19223         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
19224         working again.
19225         (FlowBranching.MergeFinally): Don't call
19226         `branching.CheckOutParameters()' here, this is called in
19227         MergeTopBlock().
19228         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19229         when adding the `finally' vector.       
19231 2003-12-13  Martin Baulig  <martin@ximian.com>
19233         * flowanalysis.cs
19234         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19235         actually work and also fix #48962.
19237 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
19239         * decl.cs: Do not check System.Object for nested types,
19240         since we know it does not have any. Big bang for buck:
19242         BEFORE:
19243            Run 1:   8.35 seconds
19244            Run 2:   8.32 seconds
19245            corlib:  17.99 seconds
19246         AFTER:
19247            Run 1:   8.17 seconds
19248            Run 2:   8.17 seconds
19249            corlib:  17.39 seconds
19251 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
19253         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19254         time we are returning 0 members, so we save alot here.
19256 2003-12-11  Martin Baulig  <martin@ximian.com>
19258         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19259         `MergeChild()', also just take the `FlowBranching' as argument;
19260         call Merge() on it and return the result.
19261         (FlowBranching.Merge): We don't need to do anything if we just
19262         have one sibling.
19264 2003-12-11  Martin Baulig  <martin@ximian.com>
19266         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19267         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
19268         Maurer for this idea.
19270 2003-12-11  Martin Baulig  <martin@ximian.com>
19272         * flowanalysis.cs (MergeResult): This class is now gone; we now
19273         use the `UsageVector' for this.  The reason for this is that if a
19274         branching just has one sibling, we don't need to "merge" them at
19275         all - that's the next step to do.
19276         (FlowBranching.Merge): We now return a `UsageVector' instead of a
19277         `MergeResult'.
19279 2003-12-11  Martin Baulig  <martin@ximian.com>
19281         Reworked flow analyis and made it more precise and bug-free.  The
19282         most important change is that we're now using a special `Reachability'
19283         class instead of having "magic" meanings of `FlowReturns'.  I'll
19284         do some more cleanups and optimizations and also add some more
19285         documentation this week.
19287         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19288         largely reworked this class.
19289         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19290         the new `Reachability' class instead of having "magic" values here.
19291         (FlowBranching): We're now using an instance of `Reachability'
19292         instead of having separate `Returns', `Breaks' etc. fields.
19294         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19295         based on flow analysis; ignore the return value of block.Emit ().
19297 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
19299         * driver.cs typemanager.cs: Find the mono extensions to corlib even
19300         if they are private.
19302 2003-12-09  Martin Baulig  <martin@ximian.com>
19304         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19305         call them directly on the UsageVector.
19307 2003-12-09  Martin Baulig  <martin@ximian.com>
19309         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19310         Changed return type from `FlowReturns' to `Reachability'.
19312 2003-12-09  Martin Baulig  <martin@ximian.com>
19314         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19315         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19316         `Reachable' fields with a single `Reachability' one.
19318 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19320         * class.cs (FindMembers): Remove foreach's.
19322         Bootstrap times:
19324         BEFORE
19325                 Run 1:   8.74 seconds
19326                 Run 2:   8.71 seconds
19328         AFTER
19329                 Run 1:   8.64 seconds
19330                 Run 2:   8.58 seconds
19333 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19335         * cs-parser.jay:
19336         * gen-treedump.cs:
19337         * statement.cs:
19338         This patch does a few things:
19339                 1. EmptyStatement is now a singleton, so it is never reallocated.
19340                 2. All blah is EmptyStatement constructs have been changed to
19341                    blah == EmptyStatement.Value, which is much faster and valid
19342                    now that EmptyStatement is a singleton.
19343                 3. When resolving a block, rather than allocating a new array for
19344                    the non-empty statements, empty statements are replaced with
19345                    EmptyStatement.Value
19346                 4. Some recursive functions have been made non-recursive.
19347         Mainly the performance impact is from (3), however (1) and (2) are needed for
19348         this to work. (4) does not make a big difference in normal situations, however
19349         it makes the profile look saner.
19351         Bootstrap times:
19353         BEFORE
19354         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19355         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19356         Total memory allocated: 56397 KB
19358         AFTER
19359         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19360         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19361         Total memory allocated: 55666 KB
19363 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19365         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19366         than the hashtable in a hashtable version
19368         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19369         we always end up concating a string. This results in a huge perf
19370         loss, because many strings have to be tracked by the GC. In this
19371         patch, we first use a hashtable that works with two keys, so that
19372         the strings do not need to be concat'ed.
19374         Bootstrap times:
19375         BEFORE
19376                 Run 1:   8.74 seconds
19377                 Run 2:   8.71 seconds
19379         AFTER
19380                 Run 1:   8.65 seconds
19381                 Run 2:   8.56 seconds
19383 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19385         * Makefile: Add a new target `do-time' that does a quick and simple
19386         profile, leaving easy to parse output.
19388 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
19390         * codegen.cs (Init): Create the dynamic assembly with 
19391         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19393 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
19395         * support.cs: Make the PtrHashtable use only one
19396         instance of its comparer.
19398 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
19400         * typemanager.cs: Fix lookup of GetNamespaces.
19402 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
19404         * expression.cs: Removed redundant line.
19406         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19407         ArrayLists, use for loops with bounds.  
19409         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19410         arraylist.
19412         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19413         arraylists, use for loop with bounds.
19415         The above three changes give us a 0.071 second performance
19416         improvement out of 3.294 seconds down to 3.223.  On my machine
19417         the above changes reduced the memory usage by 1,387 KB during
19418         compiler bootstrap.
19420         * cs-parser.jay (QualifiedIdentifier): New class used to represent
19421         QualifiedIdentifiers.  Before we created a new string through
19422         concatenation, and mostly later on, the result would be
19423         manipulated by DecomposeQI through string manipulation.
19425         This reduced the compiler memory usage for bootstrapping from
19426         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19427         compile times in 0.05 seconds.
19429 2003-11-28  Dick Porter  <dick@ximian.com>
19431         * support.cs: Do string compares with the Invariant culture.
19433         * rootcontext.cs: 
19434         * gen-treedump.cs: 
19435         * expression.cs: 
19436         * driver.cs: 
19437         * decl.cs: 
19438         * codegen.cs: 
19439         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19440         the comparison is done with the Invariant culture.
19442 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
19444         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19445         GetEnumerator method.
19447         (ProbeCollectionType): Iterate starting at the most specific type
19448         upwards looking for a GetEnumerator
19450         * expression.cs: Shift count can be up to 31 for int/uint and 63
19451         for long/ulong.
19453 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
19455         * statement.cs (Block.LookupLabel): Also look for the label on the
19456         children blocks.  Use a hash table to keep track of visited
19457         nodes. 
19459         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19460         we actually did transform the other operand, otherwise fall back
19461         to the common codepath that casts to long.
19463         * cs-tokenizer.cs: Use the same code pattern as the int case.
19464         Maybe I should do the parsing myself, and avoid depending on the
19465         Parse routines to get this done.
19467 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
19469         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19470         which fixes bug 51347.  This time test it.
19472         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19473         attributes for example can not tell the difference between these.
19474         The difference was only a syntax feature of the language. 
19476         * attribute.cs: Apply attributes to delegates.
19478         * delegate.cs: Call the apply attributes method.
19480 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
19482         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19483         comparing 0 vs Byte.MinValue, not the value
19485         (ImplicitConversionRequired): When reporting a conversion error,
19486         use error 31 to print out the constant error instead of the
19487         simpler 29.
19489         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19490         which fixes bug 51347.
19492 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
19494         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
19495         which fixes the -warnaserror command line option.
19497 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
19499         * cfold.cs (DoNumericPromotions): During constant folding of
19500         additions on UIntConstant, special case intconstants with
19501         IntConstants like we do on the expression binary operator. 
19503 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
19505         * convert.cs (ImplicitReferenceConversion): We were missing a case
19506         (System.Enum are not value types or class types, so we need to
19507         classify them separatedly).
19509         * driver.cs: We do not support error 2007.
19511 2003-11-12 Jackson Harper <jackson@ximian.com>
19513         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19514         system directory. Also use the full file name so users can
19515         libraries names mscorlib-o-tron.dll in a non system dir.
19517 2003-11-10  Martin Baulig  <martin@ximian.com>
19519         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19520         (TypeManager.InitCoreTypes): Initialize them here, but instead of
19521         calling `ResolveType()' on them, directly assign their `Type'.
19523 2003-11-08  Martin Baulig  <martin@ximian.com>
19525         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19526         return value and the `out parent' parameter.
19527         (TypeContainer.DefineType): Moved the CS0644 check into
19528         GetClassBases().  Don't pass the interface types to the
19529         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19530         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19532         * ecore.cs (TypeExpr.IsAttribute): New property.
19533         (TypeExpr.GetInterfaces): New method.
19535         * interface.cs (Interface.GetInterfaceTypeByName): Return a
19536         TypeExpr instead of a Type.
19537         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19538         (Interface.DefineType): Don't pass the interface types to the
19539         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19540         them later and then call `TypeBulider.AddInterfaceImplementation()'.
19542         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19543         instead of a `Type[]'.
19544         (TypeManager.RegisterBuilder): Likewise.
19545         (TypeManager.AddUserInterface): Likewise.
19546         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19547         `Type[]' and also return a `TypeExpr[]'.
19548         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19550 2003-11-08  Martin Baulig  <martin@ximian.com>
19552         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19553         Expression.     
19555 2003-11-08  Martin Baulig  <martin@ximian.com>
19557         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19558         TypeManager.ResolveExpressionTypes().
19560         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19561         instead of an Expression.
19562         (TypeExpr): This is now an abstract base class for `TypeExpression'.
19563         (TypeExpression): New public class; formerly known as `TypeExpr'.
19565         * expression.cs (ComposedCast): Derive from TypeExpr.
19567         * typemanager.cs (TypeManager.system_*_expr): These are now
19568         TypExpr's instead of Expression's.
19569         (TypeManager.ResolveExpressionTypes): New public static function;
19570         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19571         of them.        
19573 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
19575         * expression.cs (New.DoResolve): Do not dereference value that
19576         might be a null return.
19578         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19579         sure that the constant value has the right type.  Fixes an
19580         unreported bug, similar to 50425.
19582         * const.cs (Const.LookupConstantValue): Call
19583         ImplicitStandardConversionExists before doing a conversion to
19584         avoid havng the TypeManager.ChangeType do conversions.
19586         Reduced the number of casts used
19588         (Const.ChangeType): New routine to enable reuse of the constant
19589         type changing code from statement.
19591         * typemanager.cs (ChangeType): Move common initialization to
19592         static global variables.
19594         Fixes #50425.
19596         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19597         every value type to go through, even if it was void.  Fix that. 
19599         * cs-tokenizer.cs: Use is_identifier_start_character on the start
19600         character of the define, and the is_identifier_part_character for
19601         the rest of the string.
19603 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
19605         * expression.cs (UnaryMutator.EmitCode): When I updated
19606         LocalVariableReference.DoResolve, I overdid it, and dropped an
19607         optimization done on local variable references.
19609 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
19611         * ecore.cs: Convert the return from Ldlen into an int.
19613 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
19615         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19616         the accessibility, this is a special case for toplevel non-public
19617         classes (internal for instance).
19619 2003-10-20  Nick Drochak <ndrochak@gol.com>
19621         * ecore.cs: Fix typo and build.  Needed another right paren.
19623 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
19625         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
19626         `internal' case regular and protected, but not allowing protected
19627         to be evaluated later.  Bug 49840
19629 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
19631         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19632         to kb.Nlast, and not the kb.nFirst to isolate the switch
19633         statement.
19635         Extract the underlying type, so enumerations of long/ulong are
19636         treated like long/ulong.
19638 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
19640         * expression.cs (New): Overload the meaning of RequestedType to
19641         track the possible creation of the NewDelegate type, since
19642         DoResolve is invoked more than once for new constructors on field
19643         initialization.
19645         See bugs: #48800 and #37014
19647         * cs-parser.jay (declare_local_constants): Take an arraylist
19648         instead of a single constant.
19650         (local_constant_declaration): It should take a
19651         constant_declarators, not a constant_declarator.  Fixes 49487
19653         * convert.cs: Fix error report.
19655 2003-10-13 Jackson Harper <jackson@ximian.com>
19657         * typemanager.cs (TypeToCoreType): Add float and double this fixes
19658         bug #49611
19660 2003-10-09  Martin Baulig  <martin@ximian.com>
19662         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19663         to the .ctor.
19664         (MethodCore.DoDefineParameters): Removed the TypeContainer
19665         argument; use the DeclSpace which was passed to the .ctor instead.
19666         (MethodCore.CheckParameter): Take a DeclSpace instead of a
19667         TypeContainer; we only need a DeclSpace here.
19669 2003-10-09  Martin Baulig  <martin@ximian.com>
19671         * class.cs (MethodData): Added additional `DeclSpace ds' argument
19672         to the .ctor.
19673         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19674         EmitContext's .ctor.    
19676 2003-10-09  Martin Baulig  <martin@ximian.com>
19678         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19679         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19680         AsAccessible(), moved them as well.
19682         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19684 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19686         * cs-parser.jay : Renamed yyName to yyNames related to jay.
19688 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
19690         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19691         generation for >=, as spotted by Paolo, bug 48679.  
19692         Patch from David Waite.
19694         * cs-tokenizer.cs: Add handling for #pragma.
19696         * cs-parser.jay: Allow for both yield and yield return in the
19697         syntax.  The anti-cobolization of C# fight will go on!
19699         * class.cs (TypeBuilder.DefineType): Catch error condition here
19700         (Parent.DefineType erroring out and returning null).
19702         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19703         coping with enumerations variables, we were mistakenly processing
19704         them as a regular value type instead of built-in types.  Fixes the
19705         bug #48063
19707         * typemanager.cs (IsBuiltinOrEnum): New method.
19709 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
19711         * cs-parser.jay: Upgrade: yield now needs the return clause.
19713 2003-09-19  Martin Baulig  <martin@ximian.com>
19715         * decl.cs (MemberCache.SetupCacheForInterface): Take a
19716         `MemberCache parent' argument.  Normally, an interface doesn't
19717         have a parent type except System.Object, but we use this in gmcs
19718         for generic type parameters.
19720 2003-09-18  Martin Baulig  <martin@ximian.com>
19722         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19723         on `type.IsInterface'; don't check whether the type has a parent
19724         to determine whether it's an interface.
19726 2003-09-15  Martin Baulig  <martin@ximian.com>
19728         * class.cs (TypeContainer.DefineType): Added an error flag to
19729         avoid reporting duplicate CS0146's ("class definition is
19730         circular.").
19732         * driver.cs (Driver.MainDriver): Abort if
19733         RootContext.ResolveTree() reported any errors.
19735 2003-09-07  Martin Baulig  <martin@ximian.com>
19737         * report.cs (Error, Warning): Added overloaded versions which take
19738         a `params object[] args' and call String.Format().
19740 2003-09-07  Martin Baulig  <martin@ximian.com>
19742         * decl.cs (DeclSpace..ctor): Don't call
19743         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19744         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
19745         (DeclSpace.RecordDecl): New method.
19747         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19749 2003-09-02  Ravi Pratap  <ravi@ximian.com>
19751         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19752         value attributes to be applied to ParameterBuilders.
19754         * class.cs (MethodCore.LabelParameters): Make static and more
19755         generic so that it can be used from other places - like interface
19756         methods, for instance.
19758         * interface.cs (Interface.Emit): Call LabelParameters before
19759         emitting attributes on the InterfaceMethod.
19761 2003-08-26  Martin Baulig  <martin@ximian.com>
19763         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19764         resolving aliases; fixes #47927.
19766 2003-08-26  Martin Baulig  <martin@ximian.com>
19768         * statement.cs (Using.DoResolve): This is internally emitting a
19769         try/finally clause, so we need to set ec.NeedExplicitReturn if we
19770         do not always return.  Fixes #47681.
19772 2003-08-26  Martin Baulig  <martin@ximian.com>
19774         * decl.cs (MemberCore): Moved WarningNotHiding(),
19775         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19776         into MemberBase.
19777         (AdditionResult): Make this nested in DeclSpace.
19778         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19779         argument; call NamespaceEntry.Define() unless we're nested in a
19780         class or struct.
19782         * namespace.cs (Namespace.DefineName): New public function.  This
19783         is called from DeclSpace's .ctor to add 
19784         (Namespace.Lookup): Include DeclSpaces in the lookup.
19786         * class.cs (Operator): Derive from MemberBase, not MemberCore.
19788         * const.cs (Const): Derive from MemberBase, not MemberCore.     
19790 2003-08-25  Martin Baulig  <martin@ximian.com>
19792         * convert.cs (Convert.ExplicitReferenceConversion): When
19793         converting from an interface type to a class, unbox if the target
19794         type is a struct type.  Fixes #47822.
19796 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19798         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19799         #47854.
19801 2003-08-22  Martin Baulig  <martin@ximian.com>
19803         * class.cs (TypeManager.DefineType): When defining a nested type,
19804         call DefineType() on our parent; fixes #47801.
19806 2003-08-22  Martin Baulig  <martin@ximian.com>
19808         * class.cs (MethodData.Define): While checking if a method is an
19809         interface implementation, improve the test a bit more to fix #47654.
19811 2003-08-22  Martin Baulig  <martin@ximian.com>
19813         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19814         correctly; fixes #47722.
19816 2003-08-22  Martin Baulig  <martin@ximian.com>
19818         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19819         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19821         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19823 2003-08-22  Martin Baulig  <martin@ximian.com>
19825         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19826         can only be assigned in static constructors.  Fixes #47161.
19828 2003-08-22  Martin Baulig  <martin@ximian.com>
19830         Rewrote and improved the flow analysis code.
19832         * flowbranching.cs (FlowBranching): Make this class abstract.
19833         (FlowBranching.CreateBranching): New static function to create a
19834         new flow branching.
19835         (FlowBranchingBlock, FlowBranchingException): New classes.
19836         (FlowBranching.UsageVector.Type): New public readonly field.
19837         (FlowBranching.UsageVector.Breaks): Removed the setter.
19838         (FlowBranching.UsageVector.Returns): Removed the setter.
19839         (FlowBranching.UsageVector): Added Break(), Return(),
19840         NeverReachable() and Throw() methods to modify the reachability.
19841         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19842         done by FlowBranching.Merge().
19843         (FlowBranching.UsageVector.MergeChild): New method; merges the
19844         merge result into the current vector.
19845         (FlowBranching.Merge): New abstract method to merge a branching.
19847 2003-08-12  Martin Baulig  <martin@ximian.com>
19849         * expression.cs (Indirection.CacheTemporaries): Create the
19850         LocalTemporary with the pointer type, not its element type.
19852 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19854         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19855         token was a keyword or not.
19857         Add `error' options where an IDENTIFIER was expected;  Provide
19858         CheckToken and CheckIdentifierToken convenience error reporting
19859         functions. 
19861         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19863         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19864         NameSpaceEntry NameSpaceEntry.
19866         (LookupInterfaceOrClass): Avoid creating a full qualified name
19867         from namespace and name: avoid doing lookups when we know the
19868         namespace is non-existant.   Use new Tree.LookupByNamespace which
19869         looks up DeclSpaces based on their namespace, name pair.
19871         * driver.cs: Provide a new `parser verbose' to display the
19872         exception thrown during parsing.  This is turned off by default
19873         now, so the output of a failure from mcs is more graceful.
19875         * namespace.cs: Track all the namespaces defined in a hashtable
19876         for quick lookup.
19878         (IsNamespace): New method
19880 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19882         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19883         we know that we need to concatenate (full typename can never be
19884         null). 
19886         * class.cs: ditto.
19888         * statement.cs: Use a bitfield;  Do not initialize to null things
19889         which are done by the constructor by default.
19891         * cs-parser.jay: bug fix, parameter was 4, not 3.
19893         * expression.cs: Just use the property;
19895         * statement.cs: No need for GetVariableInfo method.
19897 2003-08-08  Martin Baulig  <martin@ximian.com>
19899         * flowanalysis.cs (FlowReturns): This is now nested in the
19900         `FlowBranching' class.
19901         (MyBitVector): Moved this here from statement.cs.
19902         (FlowBranching.SiblingType): New enum type.
19903         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19905 2003-08-07  Martin Baulig  <martin@ximian.com>
19907         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19908         `FlowBranching' class and called `BranchingType'.
19910 2003-08-07  Martin Baulig  <martin@ximian.com>
19912         * flowanalysis.cs: Moved all the control flow analysis code into
19913         its own file.
19915 2003-08-07  Martin Baulig  <martin@ximian.com>
19917         * assign.cs (Assign.DoResolve): `target' must either be an
19918         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19919         #37319.
19921 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19923         * expression.cs (BinaryMethod): This kind of expression is created by the
19924         Binary class if it determines that the operator has to be handled
19925         by a method.
19927         (BinaryDelegate): This kind of expression is created if we are
19928         dealing with a + or - operator on delegates.
19930         (Binary): remove method, argumetns, and DelegateOperator: when
19931         dealing with methods, 
19933         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19935         * statement.cs (Block): use bitfields for the three extra booleans
19936         we had in use.   Remove unused topblock parameter.
19938         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19940         * assign.cs: Drop extra unneeded tests.
19942 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19944         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19946         * statement.cs (Foreach): Use VariableStorage instead of
19947         LocalBuilders.   
19949         * codegen.cs (VariableStorage): New class used by clients that
19950         require a variable stored: locals or fields for variables that
19951         need to live across yield.
19953         Maybe provide a convenience api for EmitThis+EmitLoad?
19955         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19956         these bad boys.
19958 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19960         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19961         RemapParameterLValue): New methods that are used to turn a
19962         precomputed FieldInfo into an expression like this:
19964                 instance.FieldInfo
19966         The idea is to use this instead of making LocalVariableReference
19967         have more than one meaning.
19969         * cs-parser.jay: Add error production to BASE.
19971         * ecore.cs: Deal with TypeManager.GetField returning null, which
19972         is now a valid return value.
19974         (FieldExprNoAddress): New expression for Fields whose address can
19975         not be taken.
19977         * expression.cs (LocalVariableReference): During the resolve
19978         phases, create new expressions if we are in a remapping context.
19979         Remove code that dealt with remapping here.
19981         (ParameterReference): same.
19983         (ProxyInstance): New expression, like the `This' expression, but
19984         it is born fully resolved.  We know what we are doing, so remove
19985         the errors that are targeted to user-provided uses of `this'.
19987         * statement.cs (Foreach): our variable is now stored as an
19988         Expression;  During resolution, follow the protocol, dont just
19989         assume it will return this.
19991 2003-08-06  Martin Baulig  <martin@ximian.com>
19993         * support.cs (SeekableStreamReader.cs): New public class.
19995         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19996         SeekableStreamReader instead of the normal StreamReader.
19998 2003-08-04  Martin Baulig  <martin@ximian.com>
20000         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
20001         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
20002         deambiguate casts and delegate invocations.
20003         (parenthesized_expression): Use the new tokens to ensure this is
20004         not a cast of method invocation.
20006         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
20007         when reading a `)' and Deambiguate_CloseParens () was previously
20008         called.
20010         * expression.cs (ParenthesizedExpression): New class.  This is
20011         just used for the CS0075 test.
20012         (Binary.DoResolve): Check for CS0075.   
20014 2003-07-29  Ravi Pratap  <ravi@ximian.com>
20016         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
20017         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
20018         reference comparison.
20020         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
20021         examine the ReturnType for equality - this is necessary in the
20022         cases of implicit and explicit operators whose signature also
20023         includes the return type.
20025 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
20027         * namespace.cs: Cache the result of the namespace computation,
20028         instead of computing it every time.
20030 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
20032         * decl.cs: Use a global arraylist that we reuse over invocations
20033         to avoid excesive memory consumption.  Reduces memory usage on an
20034         mcs compile by one meg (45 average).
20036         * typemanager.cs (LookupTypeReflection): In .NET pointers are
20037         private, work around that.
20039 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
20041         * literal.cs (IntLiteral): Define Zero and One static literals. 
20043         * cs-parser.jay (integer_literal): use static literals to reduce
20044         memory usage for the most used literals (0, 1 and -1).  211kb
20045         reduced in memory usage.
20047         Replace all calls to `new ArrayList' with `new
20048         ArrayList(4)' which is a good average number for most allocations,
20049         and also requires only 16 bytes of memory for its buffer by
20050         default. 
20052         This reduced MCS memory usage in seven megabytes for the RSS after
20053         bootstrapping.
20055 2003-07-28  Ravi Pratap  <ravi@ximian.com>
20057         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
20058         handle params methods the correct way by forming only one
20059         applicable set with params and normal methods in them. Earlier we
20060         were looking at params methods only if we found no normal methods
20061         which was not the correct thing to do.
20063         (Invocation.BetterFunction): Take separate arguments indicating
20064         when candidate and the best method are params methods in their
20065         expanded form.
20067         This fixes bugs #43367 and #46199.
20069         * attribute.cs: Documentation updates.
20071         (CheckAttribute): Rename to CheckAttributeTarget.
20072         (GetValidPlaces): Rename to GetValidTargets.
20074         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
20075         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
20077         Fixes bug #44468.
20079 2003-07-28  Martin Baulig  <martin@ximian.com>
20081         * class.cs (TypeContainer.DefineMembers): Use the base type's full
20082         name when looking up the base class of a nested class.  Fixes #46977.
20084 2003-07-26  Martin Baulig  <martin@ximian.com>
20086         * expression.cs (Indexers.Indexer): New nested struct; contains
20087         getter, setter and the indexer's type.
20088         (Indexers.Properties): This is now an ArrayList of
20089         Indexers.Indexer's.
20090         (IndexerAccess.DoResolveLValue): Correctly set the type if the
20091         indexer doesn't have any getters.
20093         * assign.cs (Assign.DoResolve): Also do the implicit conversions
20094         for embedded property and indexer assignments.
20096 2003-07-26  Martin Baulig  <martin@ximian.com>
20098         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
20099         preprocessor directive is not the first non-whitespace character
20100         on a line.
20102 2003-07-26  Martin Baulig  <martin@ximian.com>
20104         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
20105         namespace parsing, follow the spec more closely.
20107         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
20108         NamespaceEntry.Lookup().
20110 2003-07-25  Martin Baulig  <martin@ximian.com>
20112         * MethodCore.cs (OverridesSomething): New public field; it's set
20113         from TypeContainer.DefineMembers if this method overrides
20114         something (which doesn't need to be a method).  Fix #39462.
20116 2003-07-25  Ravi Pratap  <ravi@ximian.com>
20118         * typemanager.cs (GetMembers): Ensure that the list of members is
20119         reversed. This keeps things in sync.
20121         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
20122         find an AttributeUsage attribute.
20124         * expression.cs (Invocation.OverloadResolve): Perform the check
20125         which disallows Invoke to be directly called on a Delegate.
20127         (Error_InvokeOnDelegate): Report error cs1533.
20129 2003-07-25  Martin Baulig  <martin@ximian.com>
20131         * expression.cs (Indexers.GetIndexersForType): Only look in the
20132         interface hierarchy if the requested type is already an
20133         interface.  Fixes #46788 while keeping #46502 fixed.
20135 2003-07-25  Martin Baulig  <martin@ximian.com>
20137         * class.cs (TypeContainer.DefineMembers): Check whether all
20138         readonly fields have been assigned and report warning CS0649 if
20139         not.
20141         * statement.cs (LocalInfo.IsFixed): Always return true if this is
20142         a valuetype.
20144 2003-07-24  Ravi Pratap  <ravi@ximian.com>
20146         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
20147         returned from GetMethods to make things consistent with the
20148         assumptions MCS makes about ordering of methods.
20150         This should comprehensively fix bug #45127 and it does :-)
20152         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
20153         ordering is actually reverse.
20155         * Clean up some debug messages I left lying around.
20157         * interface.cs (Populate*): Get rid of code which emits attributes
20158         since the stage in which we emit attributes is the 'Emit' stage,
20159         not the define stage.
20161         (Emit): Move attribute emission for interface members here.
20163 2003-07-22  Ravi Pratap  <ravi@ximian.com>
20165         * expression.cs (Invocation.OverloadResolve): Follow the spec more
20166         closely: we eliminate methods in base types when we have an
20167         applicable method in a top-level type.
20169         Please see section 14.5.5.1 for an exact description of what goes
20170         on. 
20172         This fixes bug #45127 and a host of other related to corlib compilation.
20174         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
20175         array is the method corresponding to the top-level type (this is
20176         because of the changes made to icall.c) so we change this
20177         accordingly.
20179         (MethodGroupExpr.Name): This too.
20181         * typemanager.cs (GetElementType): New method which does the right
20182         thing when compiling corlib. 
20184         * everywhere: Make use of the above in the relevant places.
20186 2003-07-22  Martin Baulig  <martin@ximian.com>
20188         * cs-parser.jay (invocation_expression): Moved
20189         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
20190         `cast_expression', but create a InvocationOrCast which later
20191         resolves to either an Invocation or a Cast.
20193         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
20194         method; call this before EmitStatement() to make sure that this
20195         expression can be used as a statement.
20197         * expression.cs (InvocationOrCast): New class; resolves to either
20198         an Invocation or a Cast.
20200         * statement.cs (StatementExpression): Call ResolveStatement() on
20201         the ExpressionStatement before emitting it.
20203 2003-07-21  Martin Baulig  <martin@ximian.com>
20205         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
20206         `ref' and `out' attributes match; fixes #46220.
20207         (MemberAccess.ResolveMemberAccess): You can't reference a type
20208         through an expression; fixes #33180.
20209         (Indexers.GetIndexersForType): Don't return the indexers from
20210         interfaces the class implements; fixes #46502.
20212 2003-07-21  Martin Baulig  <martin@ximian.com>
20214         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
20215         CS0661 checks; fixes bug #30442.
20217 2003-07-21  Martin Baulig  <martin@ximian.com>
20219         * decl.cs (AdditionResult): Added `Error'.
20221         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
20223         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
20224         makes cs0031.cs actually work.
20226 2003-07-20  Martin Baulig  <martin@ximian.com>
20228         * namespace.cs: Fixed that bug which caused a crash when compiling
20229         the debugger's GUI.
20231 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
20233         * typemanager.cs (LookupTypeReflection): Never expose types which
20234         are NotPublic, NestedPrivate, NestedAssembly, or
20235         NestedFamANDAssem.  We used to return these, and later do a check
20236         that would report a meaningful error, but the problem is that we
20237         would not get the real match, if there was a name override.
20239 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
20241         * namespace.cs (Namespace, Name): Do not compute the namespace
20242         name dynamically, compute it in the constructor.  This reduced
20243         memory usage by 1697 KB.
20245         * driver.cs: Use --pause to pause at the end.
20247 2003-07-17  Peter Williams  <peter@newton.cx>
20249         * Makefile: Change the name of the test target so that it doesn't
20250         conflict with the recursive test target.
20252 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
20254         * expression.cs (LocalVariableReference.Emit, EmitAssign,
20255         AddressOf): Do not use EmitThis, that was wrong, use the actual
20256         this pointer.
20258 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
20260         * class.cs (MethodData.Define): While checking if a method is an
20261         interface implementation, improve the test: If we are not public
20262         (use new test here: use the computed MethodAttributes directly,
20263         instead of the parsed modifier flags) check if the `implementing'
20264         method comes from an interface or not.
20266         * pending.cs (VerifyPendingMethods): Slightly better error
20267         message.
20269         * makefile: add test target that does the mcs bootstrap.
20271 2003-07-16  Ravi Pratap  <ravi@ximian.com>
20273         * interface.cs (Define): Do nothing here since there are no
20274         members to populate etc. Move the attribute emission out of here
20275         since this was just totally the wrong place to put it. Attribute
20276         application happens during the 'Emit' phase, not in the 'Define'
20277         phase.
20279         (Emit): Add this method and move the attribute emission here
20281         * rootcontext.cs (EmitCode): Call the Emit method on interface
20282         types too.
20284 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20286         * expression.cs (OverloadResolve): Report error only if Location
20287         is not 'Null' which means that there was a probe going on.
20289 2003-07-14  Martin Baulig  <martin@ximian.com>
20291         * expression.cs (ConditionalLogicalOperator): New public class to
20292         implement user defined conditional logical operators.
20293         This is section 14.11.2 in the spec and bug #40505.
20295 2003-07-14  Martin Baulig  <martin@ximian.com>
20297         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20299 2003-07-14  Martin Baulig  <martin@ximian.com>
20301         * codegen.cs (EmitContext.InFixedInitializer): New public field.
20303         * ecore.cs (IVariable.VerifyFixed): New interface method.
20305         * expression.cs (Unary.ResolveOperator): When resolving the `&'
20306         operator, check whether the variable is actually fixed.  Fixes bug
20307         #36055.  Set a variable definitely assigned when taking its
20308         address as required by the spec.
20310         * statement.cs (LocalInfo.IsFixed): New field.
20311         (LocalInfo.MakePinned): Set `IsFixed' to true.
20313 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20315         * attribute.cs (Attribute.Resolve): While doing a Member lookup
20316         for .ctors, ensure that we only ask for members declared in the
20317         attribute type (BindingFlags.DeclaredOnly).
20319         Fixes bug #43632.
20321         * expression.cs (Error_WrongNumArguments): Report error 1501
20322         correctly the way CSC does.
20324 2003-07-13  Martin Baulig  <martin@ximian.com>
20326         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20327         lookup on the fully qualified name, to make things like "X.X" work
20328         where "X.X" is a fully qualified type name, but we also have a
20329         namespace "X" in the using list.  Fixes #41975.
20331 2003-07-13  Martin Baulig  <martin@ximian.com>
20333         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20334         function. If we're a CompoundAssign, we need to create an embedded
20335         CompoundAssign, not an embedded Assign.
20336         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20337         Fixes #45854.
20339 2003-07-13  Martin Baulig  <martin@ximian.com>
20341         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20342         work to fix bug #46088.
20344 2003-07-13  Ravi Pratap <ravi@ximian.com>
20346         * class.cs (Operator.Emit): Do not emit attributes here - it is
20347         taken care of by the Method class that we delegate too. This takes
20348         care of bug #45876.
20350 2003-07-10  Martin Baulig  <martin@ximian.com>
20352         * expression.cs (TypeOfVoid): New class.
20353         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
20355 2003-07-10  Martin Baulig  <martin@ximian.com>
20357         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20358         bug #35957.
20360 2003-07-10  Martin Baulig  <martin@ximian.com>
20362         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20363         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20365         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20367         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20369 2003-07-10  Martin Baulig  <martin@ximian.com>
20371         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20372         of decimal.  Fixes #42850.
20374         NOTE: I also fixed the created byte blob, but this doesn't work on
20375         the MS runtime and csc never produces any byte blobs for decimal
20376         arrays.
20378 2003-07-10  Martin Baulig  <martin@ximian.com>
20380         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20381         structs; fixes #32068.
20382         (Block.AddChildVariableNames): Fixed #44302.
20384 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20386         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20388 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20390         * attribute.cs: And this test is onger needed.
20392 2003-07-08  Martin Baulig  <martin@ximian.com>
20394         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20395         inaccessible types.  Fixes #36313.
20397         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20399         * namespace.cs (NamespaceEntry): Create implicit entries for all
20400         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20401         implicit entries for N1.N2 and N1.
20403 2003-07-08  Martin Baulig  <martin@ximian.com>
20405         Rewrote the handling of namespaces to fix a lot of the issues
20406         wrt. `using' aliases etc.
20408         * namespace.cs (Namespace): Splitted this class into a
20409         per-assembly `Namespace' and a per-file `NamespaceEntry'.
20411         * typemanager.cs (TypeManager.IsNamespace): Removed.
20412         (TypeManager.ComputeNamespaces): Only compute namespaces from
20413         loaded assemblies here, not the namespaces from the assembly we're
20414         currently compiling.
20416 2003-07-08  Martin Baulig  <martin@ximian.com>
20418         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20420 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20422         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20423         already fixed it.  
20425         I thought about the memory savings here, but LookupTypeReflection
20426         is used under already very constrained scenarios.  Compiling
20427         corlib or mcs only exposes one hit, so it would not really reduce
20428         any memory consumption.
20430 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20432         * typemanager.cs: fixes bug #45889 by only adding public types from
20433         other assemblies to the list of known types.
20435 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20437         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20438         on the type we resolved.
20440 2003-07-05  Martin Baulig  <martin@ximian.com>
20442         * pending.cs (PendingImplementation.ParentImplements): Don't
20443         create the proxy if the parent is abstract.
20445         * class.cs (TypeContainer.DefineIndexers): Process explicit
20446         interface implementations first.  Fixes #37714.
20448 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
20450         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20451         defined recursively;  but since we modify the input parameters
20452         (left is set to `this' temporarily), we reset this value if the
20453         left_is_explicit is false, which gives the original semantics to
20454         the code.  
20456         * literal.cs (NullPointer): new class used to represent a null
20457         literal in a pointer context.
20459         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20460         type is a pointer, use a NullPointer object instead of a
20461         NullLiteral.   Closes 43687
20463         (ExplicitConversion): Convert pointer values using
20464         the conv opcode to the proper type.
20466         * ecore.cs (New): change ValueTypeVariable property into a method,
20467         that returns whether the valuetype is suitable for being used.
20469         * expression.cs (Binary.DoNumericPromotions): Only return if we
20470         the int constant was a valid uint, and we can return both left and
20471         right as uints.  If not, we continue processing, to trigger the
20472         type conversion.  This fixes 39018.
20474         * statement.cs (Block.EmitMeta): During constant resolution, set
20475         the CurrentBlock property on the emitcontext, so that we resolve
20476         constants propertly.
20478 2003-07-02  Martin Baulig  <martin@ximian.com>
20480         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20481         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20483         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20484         than emitting it here.
20486         * statement.cs: Fixed some more flow analysis bugs.
20488 2003-07-02  Martin Baulig  <martin@ximian.com>
20490         * class.cs (MethodData.Define): When implementing interface
20491         methods, set Final unless we're Virtual.
20493         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20494         check work for interface methods.
20496 2003-07-01  Martin Baulig  <martin@ximian.com>
20498         * ecore.cs (EmitContext.This): Replaced this property with a
20499         GetThis() method which takes a Location argument.  This ensures
20500         that we get the correct error location for a CS0188.
20502 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
20504         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20505         ImplicitStandardConversion.
20507         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20509 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
20511         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20512         optimization.
20514 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
20516         * class.cs (Constructor.Define): Turn off initlocals for unsafe
20517         constructors.
20519         (MethodData.Define): Turn off initlocals for unsafe methods.
20521 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
20523         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20524         complete;  Fixes #37521.
20526         * delegate.cs: Use Modifiers.TypeAttr to compute the
20527         TypeAttributes, instead of rolling our own.  This makes the flags
20528         correct for the delegates.
20530 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
20532         * class.cs (Constructor.Define): Set the private flag for static
20533         constructors as well.
20535         * cs-parser.jay (statement_expression): Set the return value to
20536         null, to avoid a crash when we catch an error.
20538 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
20540         * cs-parser.jay: Applied patch from Jackson that adds support for
20541         extern and unsafe modifiers to destructor declarations.
20543         * expression.cs: Report error 21 if the user is trying to index a
20544         System.Array.
20546         * driver.cs: Add an error message, suggested by the bug report.
20548         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20549         if we do not have a ": this ()" constructor initializer.  Fixes 45149
20551 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
20553         * namespace.cs: Add some information to reduce FAQs.
20555 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
20557         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20558         underlying enumeration types.  Fixes #43915.
20560         * expression.cs: Treat ushort/short as legal values to be used in
20561         bitwise operations.
20563 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20565         * delegate.cs: transfer custom attributes for paramenters from
20566         the delegate declaration to Invoke and BeginInvoke.
20568 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20570         * attribute.cs: handle custom marshalers and emit marshal info
20571         for fields, too.
20573 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
20575         * makefile.gnu: Added anonymous.cs to the compiler sources.
20577 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
20579         * iterators.cs: Change the name of the proxy class to include two
20580         underscores.
20582         * cs-parser.jay: Update grammar to include anonymous methods.
20584         * anonymous.cs: new file.
20586 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
20588         * class.cs (Field.Define): Add missing test for pointers and
20589         safety. 
20591 2003-05-27  Ravi Pratap  <ravi@ximian.com>
20593         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20594         we use the stobj opcode.
20596         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20597         since it wasn't the correct fix. 
20599         It still is puzzling that we are required to use stobj for IntPtr
20600         which seems to be a ValueType.
20602 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
20604         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20605         during regular simple name resolution.   Now, the trick is that
20606         instead of returning for processing the simplename, we do a
20607         TypeManager.LookupType (ie, a rooted lookup as opposed to a
20608         contextual lookup type).   If a match is found, return that, if
20609         not, return for further composition.
20611         This fixes long-standing 30485.
20613         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20614         using the address to initialize an object, do an Stobj instead of
20615         using the regular Stelem.
20617         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20618         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20619         Because if we are a BaseIndexerAccess that value will be true.
20620         Fixes 43643.
20622         * statement.cs (GotoCase.Resolve): Return after reporting an
20623         error, do not attempt to continue. 
20625         * expression.cs (PointerArithmetic.Emit): If our operand is a
20626         long, convert our constants to match the operand before
20627         multiplying.  Convert to I type before adding.   Fixes 43670.
20629 2003-05-14  Ravi Pratap  <ravi@ximian.com>
20631         * enum.cs (ImplicitConversionExists) : Rename to
20632         ImplicitEnumConversionExists to remove ambiguity. 
20634         * ecore.cs (NullCast): New type of cast expression class which
20635         basically is very similar to EmptyCast with the difference being
20636         it still is a constant since it is used only to cast a null to
20637         something else
20638         (eg. (string) null)
20640         * convert.cs (ImplicitReferenceConversion): When casting a null
20641         literal, we return a NullCast.
20643         * literal.cs (NullLiteralTyped): Remove - I don't see why this
20644         should be around anymore.
20646         The renaming (reported was slightly wrong). Corrections:
20648         ConvertImplicitStandard -> ImplicitConversionStandard
20649         ConvertExplicitStandard -> ExplicitConversionStandard
20651         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20652         before passing them in !
20654         * convert.cs (ImplicitConversionStandard): When comparing for
20655         equal expr and target types, ensure that expr is not a
20656         NullLiteral.
20658         In general, we must not be checking (expr_type ==
20659         target_type) in the top level conversion methods
20660         (ImplicitConversion, ExplicitConversion etc). This checking is
20661         done in the methods that they delegate to.
20663 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
20665         * convert.cs: Move Error_CannotConvertType,
20666         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20667         ImplicitNumericConversion, ImplicitConversionExists,
20668         ImplicitUserConversionExists, StandardConversionExists,
20669         FindMostEncompassedType, FindMostSpecificSource,
20670         FindMostSpecificTarget, ImplicitUserConversion,
20671         ExplicitUserConversion, GetConversionOperators,
20672         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20673         TryImplicitIntConversion, Error_CannotConvertImplicit,
20674         ConvertImplicitRequired, ConvertNumericExplicit,
20675         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20676         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20677         its own file.
20679         Perform the following renames:
20681         StandardConversionExists -> ImplicitStandardConversionExists
20682         ConvertImplicit -> ImplicitConversion
20683         ConvertImplicitStandard -> ImplicitStandardConversion
20684         TryImplicitIntConversion -> ImplicitIntConversion
20685         ConvertImplicitRequired -> ImplicitConversionRequired
20686         ConvertNumericExplicit -> ExplicitNumericConversion
20687         ConvertReferenceExplicit -> ExplicitReferenceConversion
20688         ConvertExplicit -> ExplicitConversion
20689         ConvertExplicitStandard -> ExplicitStandardConversion
20691 2003-05-19  Martin Baulig  <martin@ximian.com>
20693         * statement.cs (TypeInfo.StructInfo): Made this type protected.
20694         (TypeInfo): Added support for structs having structs as fields.
20696         * ecore.cs (FieldExpr): Implement IVariable.
20697         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20698         VariableInfo for the field.
20700 2003-05-18  Martin Baulig  <martin@ximian.com>
20702         * expression.cs (This.DoResolve): Report a CS0027 if we're
20703         emitting a field initializer.
20705 2003-05-18  Martin Baulig  <martin@ximian.com>
20707         * expression.cs (This.ResolveBase): New public function.
20708         (This.DoResolve): Check for CS0188.
20710         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20711         This.Resolve().
20713         * ecore.cs (MethodGroupExpr.DoResolve): Set the
20714         `instance_expression' to null if we don't have any non-static
20715         methods.
20717 2003-05-18  Martin Baulig  <martin@ximian.com>
20719         Reworked the way how local variables and parameters are handled by
20720         the flow analysis code.
20722         * statement.cs (TypeInfo, VariableMap): New public classes.
20723         (VariableInfo): New public class.  This is now responsible for
20724         checking whether a variable has been assigned.  It is used for
20725         parameters and local variables.
20726         (Block.EmitMeta): Take the InternalParameters as argument; compute
20727         the layout of the flow vectors here.
20728         (Block.LocalMap, Block.ParameterMap): New public properties.
20729         (FlowBranching): The .ctor doesn't get the InternalParameters
20730         anymore since Block.EmitMeta() now computes the layout of the flow
20731         vector.
20732         (MyStructInfo): This class is now known as `StructInfo' and nested
20733         in `TypeInfo'; we don't access this directly anymore.
20735         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20736         property and removed IsAssigned(), IsFieldAssigned(),
20737         SetAssigned() and SetFieldAssigned(); we now call them on the
20738         VariableInfo so we don't need to duplicate this code everywhere.
20740         * expression.cs (ParameterReference): Added `Block block' argument
20741         to the .ctor.
20742         (LocalVariableReference, ParameterReference, This): The new
20743         VariableInfo class is now responsible for all the definite
20744         assignment stuff.
20746         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20747         IsParameterAssigned, SetParameterAssigned): Removed.
20749 2003-05-18  Martin Baulig  <martin@ximian.com>
20751         * typemanager.cs (InitCoreTypes): Try calling
20752         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20753         the 3-args-version.  Corlib now also needs our `void_type'.
20754         (GetMethod): Added overloaded version which takes an optional
20755         `bool report_errors' to allow lookups of optional methods.
20757 2003-05-12  Martin Baulig  <martin@ximian.com>
20759         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20760         only used for locals and not for parameters.
20762 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
20764         * support.cs (InternalParameters.ParameterType): Return the
20765         ExternalType of the parameter.
20767         * parameter.cs (Parameter.ExternalType): drop the two arguments,
20768         they were unused.
20770 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
20772         * class.cs (MethodData.Define): Do not set the `newslot' on
20773         interface members, if they are also flagged as "override".
20775         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20776         better code for ++i and i++.  This only works for static fields
20777         and local variables.
20779         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20780         want to pull the DeclSpace out of the builder_to_declspace instead
20781         of the TypeBuilder (like in TypeContainer.FindMembers).
20783         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20784         instead of LookupTypeContainer.  Fixes the crash on .NET for
20785         looking up interface members.
20787         * const.cs: Create our own emit context during the Definition
20788         stage, so that constants are evaluated in the proper context, when
20789         a recursive definition happens.
20791 2003-05-11  Martin Baulig  <martin@ximian.com>
20793         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
20794         new block for a switch section.
20795         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20796         the adding/lookup in the switch block.  Fixes #39828.
20798 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
20800         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20801         functionality: I needed to convert the data after I had performed
20802         the add/sub operation into the operands type size.
20804         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20805         pass the type for the box operation, otherwise the resulting
20806         object would have been of type object.
20808         (BoxedCast): Add constructor to specify the type to box as.
20810 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20812         * iterators.cs: I was reusing the `count' variable inadvertently,
20813         take steps to not allow this to happen.
20815 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20817         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20818         by creating an array at the point where the params starts and
20819         putting all those arguments there, then adjusting the size of the
20820         array.
20822 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20824         * expression.cs (New.AddressOf): Implement interface
20825         IMemoryLocation.  This is used when the `new' operator is used in
20826         the context of an invocation to a method on a value type.
20828         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20829         example. 
20831         * namespace.cs: Also check the using aliases here.
20833         * driver.cs: Move the test for using validity after the types have
20834         been entered, so we do a single pass that also includes the using
20835         aliases. 
20837         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20838         in the regular case.   CreateSiblingForFinally is doing extra
20839         error checking.
20841         * attribute.cs (GetAttributeArgumentExpression): Store the result
20842         on an out value, and use the return value to indicate failure
20843         instead of using null (which is a valid return for Constant.GetValue).
20845         * statement.cs: Perform the analysis flow for the increment
20846         portion after the statement, because this will be the real flow of
20847         execution.  Fixes #42385
20849         * codegen.cs (EmitContext.EmitArgument,
20850         EmitContext.EmitStoreArgument): New helper functions when the
20851         RemapToProxy flag is set.
20853         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20854         function.
20856         Add support for remapping parameters. 
20858         * iterators.cs: Propagate parameter values;  Store parameter
20859         values in the proxy classes.
20861 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20863         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20864         need a proxy reference;  I do not know what I was thinking
20866         * cs-parser.jay (constructor_initializer): catch another error,
20867         and display nice message.
20869         (field_declaration): catch void field declaration
20870         to flag a better error. 
20872         * class.cs (MemberBase.CheckBase): Report an error instead of a
20873         warning if a new protected member is declared in a struct. 
20874         (Field.Define): catch the error of readonly/volatile.
20876         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20878         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20879         volatile variable is taken
20881 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20883         * statement.cs (Fixed.Resolve): Report an error if we are not in
20884         an unsafe context.
20886 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20888         * typemanager.cs: reuse the code that handles type clashes for
20889         delegates and enumerations.
20891         * class.cs (Report28): Always report.
20893         * expression.cs (EncodeAsAttribute): Allow nulls here.
20895 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20897         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20898         the functionality for testing whether an expression is valid for
20899         an attribute here.  Also handle the case of arrays of elements
20900         being stored. 
20902         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20903         encoding a linear array into an array of objects that are suitable
20904         to be passed to an CustomAttributeBuilder.
20906         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20908         * ecore.cs: (FieldExpr): Handle field remapping here.
20910         * iteratators.cs: Pass the instance variable (if the method is an
20911         instance method) to the constructors, so we can access the field
20912         variables on the class.
20914         TODO: Test this with structs.  I think the THIS variable on
20915         structs might have to be a pointer, and not a refenrece
20917 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20919         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20920         local variables to fields in a proxy class.
20922         * iterators.cs (PopulateProxy): Rename our internal fields to
20923         <XXX>.  
20924         Create a <THIS> field if we are an instance method, so we can
20925         reference our parent container variables.
20926         (MapVariable): Called back from the EmitContext code to enter a
20927         new variable to field mapping into the proxy class (we just create
20928         a FieldBuilder).
20930         * expression.cs
20931         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20932         for using the remapped locals to fields.
20934         I placed the code here, because that gives the same semantics to
20935         local variables, and only changes the Emit code.
20937         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20938         statements inside iterators.
20939         (VariableInfo): Add a FieldBuilder for the cases when we are
20940         remapping local variables to fields in a proxy class
20942         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20943         current_block != null.
20945         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20946         not cope with strings, as it has been moved to the
20947         TableSwitchEmit.  Fixed bug in switch generation.
20949         * expression.cs (New.DoResolve): Provide more context for the user
20950         when reporting an error.
20952         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20953         pointers. 
20955         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20956         check the permissions for it.  Note than in a type-resolution
20957         context the check was already present in DeclSpace.ResolveType,
20958         but was missing from the MemberAccess.
20960         (ArrayCreation.CheckIndices): warn if the user has
20961         more nested levels of expressions, but there are no more
20962         dimensions specified.  Avoids crash on bug 41906.
20964 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20966         * statement.cs (Block): replace Implicit bool, for a generic
20967         flags.   
20968         New flag: `Unchecked'.  This is used during the EmitMeta phase
20969         (which is out-of-line with the regular Resolve/Emit process for a
20970         statement, as this is done ahead of time, but still gets a chance
20971         to call constant resolve).
20973         (Block.Flags): new enum for adding a new flag.
20975         (Block.EmitMeta): track the state of unchecked.
20977         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20978         to enable constant resolution to work there as well.
20980 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20982         * typemanager.cs (ienumerable_type): Also look up
20983         System.Collections.IEnumerable. 
20985 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20987         TODO: Test more than one conditional per method.
20989         * class.cs (Indexer.Define): Report the location where the user is
20990         referencing the unsupported feature.
20992         (MethodData): Overload the use of `conditionals' to
20993         minimize the creation of needless ArrayLists.   This saves roughly
20994         212kb on my machine.
20996         (Method): Implement the new IIteratorContainer interface.
20997         (Method.SetYields): Implement the method by setting the ModFlags
20998         to contain METHOD_YIELDS.
21000         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
21001         which just got set to null.
21003         * iterators.cs: New file.
21005         (Yield, YieldBreak): New statements.
21007         * statement.cs (Return.Resolve): Flag an error if we are used in
21008         an iterator method.
21010         * codegen.cs (InIterator): New flag set if the code is being
21011         compiled in an iterator method.
21013         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
21014         internal modifier, and we just use it to avoid adding extra
21015         fields, as this is seldom used.  
21017         * cs-parser.jay: Add yield_statement (yield and yield break).
21019         * driver.cs: New flag -v2 to turn on version 2 features. 
21021         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
21022         hashtable when v2 is enabled.
21024 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
21026         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
21027         there is already a namespace defined with this name.
21029         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
21030         people upgraded their corlibs.
21032         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
21033         always use fully qualified types, no need to use the compiler
21034         front end.
21036         (TypeManager.IsNamespace): Use binarysearch.
21038         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
21039         AddDelegate): I did not quite use the new IsValid API properly: I
21040         have to pass the short-name and the fullname.  I was passing only
21041         the basename instead of the fullname sometimes. 
21043         (TypeContainer.DefineType): call NamespaceClash.
21045         * interface.cs (Interface.DefineType): use NamespaceClash before
21046         defining the type.
21048         * delegate.cs (Delegate.DefineType): use NamespaceClash before
21049         defining the type.
21051         * enum.cs: (Enum.DefineType): use NamespaceClash before
21052         defining the type.
21054         * typemanager.cs (: 3-line patch that gives us some tasty 11%
21055         speed increase.  First, use the negative_hits cache when we get a
21056         negative.  Second, add the type with its full original name
21057         instead of the new . and + encoded name (reflection uses + to
21058         separate type from a nested type).  Use LookupTypeReflection
21059         directly which bypasses the type->name hashtable (that we already
21060         know does not contain the type.
21062         * decl.cs (DeclSpace.ResolveTypeExpr): track the
21063         location/container type. 
21065         * driver.cs: When passing utf8, use directly the UTF8Encoding.
21067 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
21069         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
21071         * delegate.cs (NewDelegate.Resolve): Test whether an instance
21072         method is being referenced in the method group from a static
21073         context, and report error 120 if so.
21075         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
21076         Error118. 
21078         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
21079         is created, we create the A namespace).
21081         * cs-parser.jay: A namespace also introduces a DeclarationFound.
21082         Fixes #41591
21084 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
21086         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
21087         invocation to ModuleBuilder.GetType with the same values will
21088         return a new type instance, so we need to cache its return
21089         values. 
21091         * expression.cs (Binary.ResolveOperator): Only allow the compare
21092         operators on enums if they are of the same type.
21094         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
21095         types of ValueType on their own case.  Before we were giving them
21096         the same treatment as objects.
21098         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
21099         fullname.  Short name is used to compare against container name.
21100         Fullname is used to check against defined namespace names.
21102         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
21103         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
21105         (Method.CheckBase): Call parent.
21106         (MemberBase.CheckBase): Check for protected members on sealed
21107         classes.
21108         (PropertyBase.CheckBase): Call parent.
21109         (Field.Define): Call parent.
21111         * report.cs: Negative error codes are now mapped to 8000 - code,
21112         so that the display is render more nicely.
21114         * typemanager.cs: Do not use try/catch, instead report a regular
21115         error. 
21117         (GetPointerType, GetReferenceType): These methods provide
21118         mechanisms to obtain the T* and T& from a T.  We had the code
21119         previously scattered around the code base, and it also used
21120         TypeManager.LookupType that would go through plenty of caches.
21121         This one goes directly to the type source.
21123         In some places we did the Type.GetType followed by
21124         ModuleBuilder.GetType, but not in others, so this unifies the
21125         processing as well.
21127         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
21128         statements now that we have namespace information.
21130         * typemanager.cs (IsNamespace): New method, returns whether the
21131         string presented is a namespace or not.
21133         (ComputeNamespaces): New public entry point, computes the list of
21134         available namespaces, using the GetNamespaces API call in Mono, or
21135         the slower version in MS.NET.   
21137         Now before we start the semantic analysis phase, we have a
21138         complete list of namespaces including everything that the user has
21139         provided.
21141         Deleted old code to cache namespaces in .nsc files.
21143 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
21145         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
21146         class/struct location definition Location for the implicit
21147         constructor location.
21149         (Operator.Define): Use the location of the operator for the
21150         implicit Method definition.
21152         (Constructor.Emit): use the constructor location for the implicit
21153         base initializer constructor.
21155         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
21156         and the Expression class now contains two new methods:
21158         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
21159         isolate type lookup from the rest of the resolution process.
21161         Since we use Expressions to hold type definitions due to the way
21162         we parse the input we have historically overloaded Resolve to
21163         perform the Type lookups if a special flag is passed.  Now this is
21164         eliminated and two methods take their place. 
21166         The differences in the two methods between xStep and xTerminal is
21167         that xStep is involved in our current lookup system that uses
21168         SimpleNames to compose a name, while xTerminal is used just to
21169         catch the case where the simplename lookup failed.
21171 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
21173         * expression.cs (ResolveMemberAccess): Remove redundant code.
21174         TypeExpr expressions are always born fully resolved.
21176         * interface.cs (PopulateMethod): Do not lookup the types twice.
21177         We were doing it once during SemanticAnalysis and once during
21178         PopulateMethod.
21180         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
21181         in local variable type definitions, were being returned as a
21182         SimpleName (we decomposed everything into a string), that is
21183         because primary_expression was being used instead of a type in the
21184         grammar (reduce/reduce conflicts).
21186         The part that was wrong is that we converted the expression into a
21187         string (an oversimplification in one hand, compounded with primary
21188         expressions doing string concatenation).
21190         So things like:
21192         A.B.C [] x;
21194         Would return "A.B.C[]" as a SimpleName.  This stopped things like
21195         using clauses from working on this particular context.  And a type
21196         was being matched directly against "A.B.C[]".
21198         We now use the correct approach, and allow for ComposedCast to be
21199         part of the unary expression.  So the "A.B.C []" become a composed
21200         cast of "A.B.C" (as a nested group of MemberAccess with a
21201         SimpleName at the end) plus the rank composition "[]". 
21203         Also fixes 35567
21205 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
21207         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
21208         for the access level checking.
21210         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
21211         `TypeContainer container', because I kept getting confused when I
21212         was debugging this code.
21214         * expression.cs (Indexers): Instead of tracking getters/setters,
21215         we now track them in parallel.  We create one arraylist less, but
21216         most importantly it is possible now for the LValue code to find a
21217         matching get for a set.
21219         (IndexerAccess.DoResolveLValue): Update the code.
21220         GetIndexersForType has been modified already to extract all the
21221         indexers from a type.  The code assumed it did not.
21223         Also make the code set the correct return type for the indexer.
21224         This was fixed a long time ago for properties, but was missing for
21225         indexers.  It used to be void_type.
21227         (Binary.Emit): Test first for doubles instead of
21228         floats, as they are more common.
21230         (Binary.EmitBranchable): Use the .un version of the branch opcodes
21231         when dealing with floats and the <=, >= operators.  This fixes bug
21232         #39314 
21234         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21235         to load the array value by emitting a load on the foreach variable
21236         type.  This was incorrect.  
21238         We now emit the code to load an element using the the array
21239         variable type, and then we emit the conversion operator.
21241         Fixed #40176
21243 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
21245         * attribute.cs: Avoid allocation of ArrayLists in the common case.
21247 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
21249         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21250         test for protection before we test for signatures. 
21252         (MethodSignature.ToString): implement.
21254         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21255         to the case where we reduced into a LongConstant.
21257         * decl.cs (CheckAccessLevel): If the type is an array, we can not
21258         depend on whether the information is acurrate, because the
21259         Microsoft runtime will always claim that the array type is public,
21260         regardless of the real state.
21262         If the type is a pointer, another problem happens: the type is
21263         reported as non-public in Microsoft.  
21265         In both cases we have to call CheckAccessLevel recursively with
21266         the underlying type as the argument to be tested.
21268 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
21270         * assign.cs (Assign.Emit): If we are dealing with a compound
21271         assignment expression, we should use the code path that stores the
21272         intermediate result in a temporary value.  This fixes #40903.
21274         *expression.cs (Indirection.ToString): Provide ToString method for
21275         debugging. 
21277 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
21279         * class.cs: Null out fields holding references to Block objects so
21280         they can be garbage collected.
21282         * expression.cs (OverloadResolve): Remove unused local.
21284 2003-04-07  Martin Baulig  <martin@ximian.com>
21286         * codegen.cs (EmitContext.CurrentFile): New public field.
21287         (EmitContext.Mark): Use the CurrentFile to check whether the
21288         location is in the correct file.
21289         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21291 2003-04-07  Martin Baulig  <martin@ximian.com>
21293         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21295         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21296         location.  [FIXME: The location argument which gets passed to this
21297         method is sometimes wrong!]
21299 2003-04-07  Nick Drochak <ndrochak@gol.com>
21301         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21303 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
21305         * expression.cs (Indirection.EmitAssign): We were using the
21306         temporary, but returning immediately instead of continuing the
21307         EmitAssing flow.
21309 2003-04-06  Martin Baulig  <martin@ximian.com>
21311         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21312         if it's a nested child, but also deriving from the outer class.
21313         See test 190.cs.
21315         * typemanager.cs (IsNestedChildOf): Make this work if it's a
21316         nested child, but also deriving from the outer class.  See
21317         test-190.cs.
21318         (FilterWithClosure): We may access private members of the outer
21319         class if we're a nested child and deriving from the outer class.
21320         (RealMemberLookup): Only set `closure_private_ok' if the
21321         `original_bf' contained BindingFlags.NonPublic.
21323 2003-04-05  Martin Baulig  <martin@ximian.com>
21325         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21327 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
21329         * class.cs (Event.Define): Do not allow abstract events to have
21330         initializers. 
21332 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
21334         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21335         block in event declarations.
21337         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21338         value type, get its address.
21340         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21341         leaving a class on the stack instead of a boolean value (int
21342         0/1).  Change the code so we compare against null, and then the
21343         result against zero.
21345         * class.cs (TypeContainer.GetClassBases): We were checking for the
21346         parent class being sealed too late.
21348         * expression.cs (Binary.Emit): For <= and >= when dealing with
21349         floating point values, use cgt.un and clt.un instead of cgt and
21350         clt alone.
21352 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
21354         * statement.cs: Apply the same optimization as MS: skip the 
21355         GetEnumerator returning an IEnumerator, and use the one returning a 
21356         CharEnumerator instead. This allows us to avoid the try-finally block 
21357         and the boxing.
21359 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
21361         * cs-parser.jay: Attributes cannot be applied to
21362                          namespaces. Fixes #40473
21364 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21366         * class.cs:
21367         (Add*): check if the name is valid using the full name for constants,
21368         fields, properties and events.
21370 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
21372         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21373         char constants to be part of the enumeration.
21375         * expression.cs (Conditional.DoResolve): Add support for operator
21376         true. Implements the missing functionality from 14.12
21378         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21379         operator true/false as required by the spec.
21381         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21382         implicit conversion to boolean.
21384         * statement.cs (Statement.ResolveBoolean): A boolean expression is
21385         also one where the type implements `operator true'. 
21387         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21388         get an expression that will invoke operator true based on an
21389         expression.  
21391         (GetConversionOperators): Removed the hack that called op_True
21392         here.  
21394         (Expression.ResolveBoolean): Move this from Statement.
21396 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
21398         * ecore.cs (FieldExpr): do not allow initialization of initonly
21399         fields on derived classes
21401 2003-03-13  Martin Baulig  <martin@ximian.com>
21403         * statement.cs (Block.Emit): Call ig.BeginScope() and
21404         ig.EndScope() when compiling with debugging info; call
21405         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21407 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
21409         * expression.cs (Indexers): Do not construct immediately, allow
21410         for new members to be appended as we go.  Fixes 38143
21412 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21414         * expression.cs: save/restore context when resolving an unchecked
21415         expression.
21417 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
21419         * cfold.cs: Catch division by zero in modulus operator during
21420         constant folding.
21422 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
21424         * interface.cs (Interface.DefineMembers): Avoid defining members
21425         twice. 
21427 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
21429         * driver.cs: handle the +/- options for -noconfig
21431         * statement.cs (Unckeched.Resolve): Also track the state of
21432         unchecked in the Resolve phase.
21434 2003-02-27  Martin Baulig  <martin@ximian.com>
21436         * ecore.cs (Expression.MemberLookup): Don't create a
21437         MethodGroupExpr for something which is not a method.  Fixes #38291.
21439 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
21441         * class.cs (MemberBase.CheckParameters): Also check that the type
21442         is unmanaged if it is a pointer.
21444         * expression.cs (SizeOf.Resolve): Add location information.
21446         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21447         a managed type is declared.
21449         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21450         parameter modifiers as well.  Fixes bug 38606
21452         * class.cs: Very sad.  Am backing out the speed up changes
21453         introduced by the ArrayList -> Array in the TypeContainer, as they
21454         were not actually that much faster, and introduced a bug (no error
21455         reports on duplicated methods).
21457         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21458         source first, this will guarantee that we have a valid expression
21459         before calling in lower levels functions that will require a
21460         resolved object.  Then use this original_source in the
21461         target.ResolveLValue instead of the original source that was
21462         passed to us.
21464         Another change.  Use target.Resolve instead of LValueResolve.
21465         Although we are resolving for LValues, we will let the Assign code
21466         take care of that (it will be called again from Resolve).  This
21467         basically allows code like this:
21469         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21470         class Y { void A (X x) { x [0] += o; }
21472         The problem was that the indexer was trying to resolve for
21473         set_Item (idx, object o) and never finding one.  The real set_Item
21474         was set_Item (idx, X).  By delaying the process we get the right
21475         semantics. 
21477         Fixes bug 36505
21479 2003-02-23  Martin Baulig  <martin@ximian.com>
21481         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21482         while calling DoEmit ().
21484         * codegen.cs (EmitContext.Mark): Don't mark locations in other
21485         source files; if you use the #line directive inside a method, the
21486         compiler stops emitting line numbers for the debugger until it
21487         reaches the end of the method or another #line directive which
21488         restores the original file.
21490 2003-02-23  Martin Baulig  <martin@ximian.com>
21492         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21494 2003-02-23  Martin Baulig  <martin@ximian.com>
21496         * statement.cs (Block.AddChildVariableNames): We need to call this
21497         recursively, not just for our immediate children.
21499 2003-02-23  Martin Baulig  <martin@ximian.com>
21501         * class.cs (Event.Define): Always make the field private, like csc does.
21503         * typemanager.cs (TypeManager.RealMemberLookup): Make events
21504         actually work, fixes bug #37521.
21506 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
21508         * delegate.cs: When creating the various temporary "Parameters"
21509         classes, make sure that we call the ComputeAndDefineParameterTypes
21510         on those new parameters (just like we do with the formal ones), to
21511         allow them to be resolved in the context of the DeclSpace.
21513         This fixes the bug that Dick observed in Bugzilla #38530.
21515 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
21517         * expression.cs (ResolveMemberAccess): When resolving a constant,
21518         do not attempt to pull a constant if the value was not able to
21519         generate a valid constant.
21521         * const.cs (LookupConstantValue): Do not report more errors than required.
21523 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21525         * expression.cs: fixes bug #38328.
21527 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21529         * class.cs: Changed all the various members that can be part of a
21530         class from being an ArrayList to be an Array of the right type.
21531         During the DefineType type_list, interface_list, delegate_list and
21532         enum_list are turned into types, interfaces, delegates and enums
21533         arrays.  
21535         And during the member population, indexer_list, event_list,
21536         constant_list, field_list, instance_constructor_list, method_list,
21537         operator_list and property_list are turned into their real arrays.
21539         Although we could probably perform this operation earlier, for
21540         good error reporting we need to keep the lists and remove the
21541         lists for longer than required.
21543         This optimization was triggered by Paolo profiling the compiler
21544         speed on the output of `gen-sample-program.pl' perl script. 
21546         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21547         not crash in methods like MemberLookupFailed that use this field.  
21549         This problem arises when the compiler fails to resolve a type
21550         during interface type definition for example.
21552 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21554         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21555         inherit from System.Object, so we have to stop at null, not only
21556         when reaching System.Object.
21558 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
21560         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21561         DeclaredOnly because the parent indexer might have had a different
21562         name, but did not loop until the top of the hierarchy was reached.
21564         The problem this one fixes is 35492: when a class implemented an
21565         indexer from an interface, we were getting the interface method
21566         (which was abstract) and we were flagging an error (can not invoke
21567         abstract method).
21569         This also keeps bug 33089 functioning, and test-148 functioning.
21571         * typemanager.cs (IsSpecialMethod): The correct way of figuring
21572         out if a method is special is to see if it is declared in a
21573         property or event, or whether it is one of the predefined operator
21574         names.   This should fix correctly #36804.
21576 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
21578         The goal here is to remove the dependency on EmptyCast.Peel ().
21579         Killing it completely.
21581         The problem is that currently in a number of places where
21582         constants are expected, we have to "probe" for an EmptyCast, and
21583         Peel, which is not the correct thing to do, as this will be
21584         repetitive and will likely lead to errors. 
21586         The idea is to remove any EmptyCasts that are used in casts that
21587         can be reduced to constants, so we only have to cope with
21588         constants. 
21590         This bug hunt was triggered by Bug 37363 and the desire to remove
21591         the duplicate pattern where we were "peeling" emptycasts to check
21592         whether they were constants.  Now constants will always be
21593         constants.
21595         * ecore.cs: Use an enumconstant here instead of wrapping with
21596         EmptyCast.  
21598         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21599         throwing me off.  By handling this we can get rid of a few hacks.
21601         * statement.cs (Switch): Removed Peel() code.
21603 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
21605         * class.cs: Location information for error 508
21607         * expression.cs (New.DoResolve): Add a guard against double
21608         resolution of an expression.  
21610         The New DoResolve might be called twice when initializing field
21611         expressions (see EmitFieldInitializers, the call to
21612         GetInitializerExpression will perform a resolve on the expression,
21613         and later the assign will trigger another resolution
21615         This leads to bugs (#37014)
21617         * delegate.cs: The signature for EndInvoke should contain any ref
21618         or out parameters as well.  We were not doing this in the past. 
21620         * class.cs (Field.Define): Do not overwrite the type definition
21621         inside the `volatile' group.  Turns out that volatile enumerations
21622         were changing the type here to perform a validity test, which
21623         broke conversions. 
21625 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
21627         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21628         and structs, we do not want to load the instance variable
21630         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21631         enum_type has to be handled like an object reference (implicit
21632         conversions exists from this to object), but the regular IsClass
21633         and IsValueType tests will never return true for this one.
21635         Also we use TypeManager.IsValueType instead of type.IsValueType,
21636         just for consistency with the rest of the code (this is only
21637         needed if we ever use the construct exposed by test-180.cs inside
21638         corlib, which we dont today).
21640 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
21642         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21643         just InternalCall.
21645 2003-02-09  Martin Baulig  <martin@ximian.com>
21647         * namespace.cs (Namespace..ctor): Added SourceFile argument.
21648         (Namespace.DefineNamespaces): New static public method; this is
21649         called when we're compiling with debugging to add all namespaces
21650         to the symbol file.
21652         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21653         pass it to the Namespace's .ctor.
21655         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21656         and MethodBase arguments; pass the namespace ID to the symwriter;
21657         pass the MethodBase instead of the token to the symwriter.
21658         (SymbolWriter.DefineNamespace): New method to add a namespace to
21659         the symbol file.
21661 2003-02-09  Martin Baulig  <martin@ximian.com>
21663         * symbolwriter.cs: New file.  This is a wrapper around
21664         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
21665         methods here in near future.
21667 2003-02-09  Martin Baulig  <martin@ximian.com>
21669         * codegen.cs (EmitContext.Mark): Just pass the arguments to
21670         ILGenerator.MarkSequencePoint() which are actually used by the
21671         symbol writer.
21673 2003-02-09  Martin Baulig  <martin@ximian.com>
21675         * location.cs (SourceFile): New public sealed class.  This
21676         contains the name and an index which is used in the location's token.
21677         (Location): Reserve an appropriate number of bits in the token for
21678         the source file instead of walking over that list, this gives us a
21679         really huge performance improvement when compiling with debugging.
21681         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21682         `SourceFile' argument instead of a string.
21683         (Driver.ProcessFile): Add all the files via Location.AddFile(),
21684         but don't parse/tokenize here, we need to generate the list of all
21685         source files before we do that.
21686         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
21687         the files.
21689         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21690         instead of a string.
21692         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21693         of a string.
21695 2003-02-09  Martin Baulig  <martin@ximian.com>
21697         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21698         filename on `#line default'.
21700 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21702         * statement.cs: don't clear the pinned var when the fixed statement
21703         returns from the method (fixes bug#37752).
21705 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21707         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
21708         to IsValueType.
21710 2003-02-07  Martin Baulig  <martin@ximian.com>
21712         * driver.cs: Removed the `--debug-args' command line argument.
21714         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21715         automatically by the AsssemblyBuilder.
21716         (CodeGen.InitializeSymbolWriter): We don't need to call any
21717         initialization function on the symbol writer anymore.  This method
21718         doesn't take any arguments.
21720 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
21722         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21723         from referenced assemblies as well.
21725 2003-02-02  Martin Baulig  <martin@ximian.com>
21727         * class.cs (MethodData.Emit): Generate debugging info for external methods.
21729 2003-02-02  Martin Baulig  <martin@ximian.com>
21731         * class.cs (Constructor.Emit): Open the symbol writer before
21732         emitting the constructor initializer.
21733         (ConstructorInitializer.Emit): Call ec.Mark() to allow
21734         single-stepping through constructor initializers.
21736 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
21738         * class.cs: Handle error 549: do not allow virtual methods in
21739         sealed classes. 
21741 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21743         * decl.cs: Check access levels when resolving types
21745 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21747         * statement.cs: Add parameters and locals set in catch blocks that might 
21748         return to set vector
21750 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
21752         * class.cs (Operator): Set the SpecialName flags for operators.
21754         * expression.cs (Invocation.DoResolve): Only block calls to
21755         accessors and operators on SpecialName methods.
21757         (Cast.TryReduce): Handle conversions from char constants.
21760 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21762         * statement.cs: small memory and time optimization in FlowBranching.
21764 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
21766         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21767         problem that the last fix but in the other sid (Set).
21769         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21770         access when there is no indexer in the hierarchy.
21772 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21774         * class.cs: Combine some if statements.
21776 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21778         * driver.cs: fixed bug #37187.
21780 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
21782         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21783         any indexer, it's needed to build a list with all the indexers in the
21784         hierarchy (AllGetters), else we have problems. Fixes #35653.
21786 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
21788         * class.cs (MethodData.Define): It is wrong for an interface
21789         implementation to be static in both cases: explicit and implicit.
21790         We were only handling this in one case.
21792         Improve the if situation there to not have negations.
21794         * class.cs (Field.Define): Turns out that we do not need to check
21795         the unsafe bit on field definition, only on usage.  Remove the test.
21797 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21799         * driver.cs: use assembly.Location instead of Codebase (the latest
21800         patch made mcs fail when using MS assemblies).
21802 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
21804         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21805         get the path to *corlib.dll.
21807 2003-01-21  Nick Drochak <ndrochak@gol.com>
21809         * cs-tokenizer.cs:
21810         * pending.cs:
21811         * typemanager.cs: Remove compiler warnings
21813 2003-01-20  Duncan Mak  <duncan@ximian.com>
21815         * AssemblyInfo.cs: Bump the version number to 0.19.
21817 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21819         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21821 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21823         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21825 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21827         * cs-parser.jay: Small fix: we were not comparing the constructor
21828         name correctly.   Thanks to Zoltan for the initial pointer.
21830 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21832         * cs-tokenizer.cs: Set file name when specified with #line
21834 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21836         * cs-parser.jay: Only perform the constructor checks here if we
21837         are named like the class;  This will help provider a better
21838         error.  The constructor path is taken when a type definition is
21839         not found, but most likely the user forgot to add the type, so
21840         report that rather than the constructor error.
21842 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21844         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21845         allocations.
21847 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21849         * cs-parser.jay: Add cleanup call.
21851 2003-01-13  Duncan Mak  <duncan@ximian.com>
21853         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21854         consistent with other methods.
21856 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21858         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21860 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21862         * attribute.cs: only set GuidAttr to true when we have a
21863         GuidAttribute.
21865 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21867         * ecore.cs:
21868         * expression.cs:
21869         * typemanager.cs: fixes to allow mcs compile corlib with the new
21870         Type.IsSubclassOf fix.
21872 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21874         * expression.cs (LocalVariableReference.DoResolve): Classify a
21875         constant as a value, not as a variable.   Also, set the type for
21876         the variable.
21878         * cs-parser.jay (fixed_statement): take a type instead of a
21879         pointer_type, so we can produce a better error message later.
21881         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21882         as an error.  
21884         (For.DoEmit): Make inifinite loops have a
21885         non-conditional branch back.
21887         (Fixed.DoEmit): First populate the pinned variables, then emit the
21888         statement, then clear the variables.  Before I was emitting the
21889         code once for each fixed piece.
21892 2003-01-08  Martin Baulig  <martin@ximian.com>
21894         * statement.cs (FlowBranching.MergeChild): A break in a
21895         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21897 2003-01-08  Martin Baulig  <martin@ximian.com>
21899         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21900         lives in the same number space than `param_map'.  Fixes #36154.
21902 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21904         * cs-parser.jay (constructor_declaration): Set the
21905         Constructor.ModFlags before probing for it.  This makes the
21906         compiler report 514, 515 and 132 (the code was there, but got
21907         broken). 
21909         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21910         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21911         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21913 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21915         * enum.cs: create the enum static fields using the enum type.
21917 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21919         * class.cs: don't try to create the ParamBuilder for the return
21920         type if it's not needed (and handle it breaking for the ms runtime
21921         anyway).
21923 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21925         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21927 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21929         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21930         the command.   This showed up while compiling the JANET source
21931         code, which used \r as its only newline separator.
21933 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21935         * class.cs (Method.Define): If we are an operator (because it
21936         reuses our code), then set the SpecialName and HideBySig.  #36128
21938 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21940         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21941         exception, report error 120 `object reference required'.
21943         * driver.cs: Add --pause option, used during to measure the size
21944         of the process as it goes with --timestamp.
21946         * expression.cs (Invocation.DoResolve): Do not allow methods with
21947         SpecialName to be invoked.
21949 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21951         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21952         number before adding it.
21954 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21956         * ecore.cs (StandardImplicitConversion): When in an unsafe
21957         context, we allow conversion between void * to any other pointer
21958         type. This fixes bug #35973.
21960 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21962         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21963         is not thrown when extensionless outputs are used 
21965 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21967         * rootcontext.cs: fixed compilation of corlib.
21969 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21971         * attribute.cs (Attributes.Contains): Add new method.
21973         * class.cs (MethodCore.LabelParameters): if the parameter is an
21974         `out' parameter, check that no attribute `[In]' has been passed.
21976         * enum.cs: Handle the `value__' name in an enumeration.
21978 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21980         * decl.cs: Added special case to allow overrides on "protected
21981         internal" methods
21983 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21985         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21986         since it makes much more sense.
21988         (Attributes.ctor): Don't require a Location parameter.
21990         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21992         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21993         since we already have that information per attribute.
21995         * everywhere : make appropriate changes.
21997         * class.cs (LabelParameters): Write the code which actually
21998         applies attributes to the return type. We can't do this on the MS
21999         .NET runtime so we flag a warning in the case an exception is
22000         thrown.
22002 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
22004         * const.cs: Handle implicit null conversions here too.
22006 2002-12-17  Ravi Pratap  <ravi@ximian.com>
22008         * class.cs (MethodCore.LabelParameters): Remove the extra
22009         Type [] parameter since it is completely unnecessary. Instead
22010         pass in the method's attributes so that we can extract
22011         the "return" attribute.
22013 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
22015         * cs-parser.jay (parse): Use Report.Error to flag errors instead
22016         of ignoring it and letting the compile continue.
22018         * typemanager.cs (ChangeType): use an extra argument to return an
22019         error condition instead of throwing an exception.
22021 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
22023         * expression.cs (Unary.TryReduce): mimic the code for the regular
22024         code path.  Perform an implicit cast in the cases where we can
22025         implicitly convert to one of the integral types, and then reduce
22026         based on that constant.   This fixes bug #35483.
22028 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22030         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
22032 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22034         * namespace.cs: fixed bug #35489.
22036 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
22038         * class.cs: Remove some dead code.
22040         * cs-parser.jay: Estimate the number of methods needed
22041         (RootContext.MethodCount);
22043         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
22044         numbers instead of StringBuilders.
22046         * support.cs (PtrHashtable): Add constructor with initial size;
22047         We can now reduce reallocations of the method table.
22049 2002-12-10  Ravi Pratap  <ravi@ximian.com>
22051         * attribute.cs (ApplyAttributes): Keep track of the emitted
22052         attributes on a per-target basis. This fixes bug #35413.
22054 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
22056         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
22057         default to the Windows 1252 encoding.
22059         (UnixParseOption): Support version, thanks to Alp for the missing
22060         pointer. 
22062         * AssemblyInfo.cs: Add nice assembly information.
22064         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
22065         (bug 35169).
22067         * cs-parser.jay: Allow a trailing comma before the close bracked
22068         in the attribute_section production.
22070         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
22071         address of the instance was being taken, I will take this out,
22072         because we take the address of the object immediately here.
22074 2002-12-09  Ravi Pratap  <ravi@ximian.com>
22076         * typemanager.cs (AreMultipleAllowed): Take care of the most
22077         obvious case where attribute type is not in the current assembly -
22078         stupid me ;-)
22080 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
22082         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
22083         definitions, instead of doing that afterwards.  
22085         Also we use a nice little hack, depending on the constructor, we
22086         know if we are a "composed" name or a simple name.  Hence, we
22087         avoid the IndexOf test, and we avoid 
22089         * codegen.cs: Add code to assist in a bug reporter to track down
22090         the source of a compiler crash. 
22092 2002-12-07  Ravi Pratap  <ravi@ximian.com>
22094         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
22095         types have been emitted for a given element and flag an error
22096         if something which does not have AllowMultiple set is used more
22097         than once.
22099         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
22100         attribute types and their corresponding AllowMultiple properties
22102         (AreMultipleAllowed): Check the property for a given type.
22104         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
22105         property in the case we have a TypeContainer.
22107         (Attributes.AddAttribute): Detect duplicates and just skip on
22108         adding them. This trivial fix catches a pretty gross error in our
22109         attribute emission - global attributes were being emitted twice!
22111         Bugzilla bug #33187 is now fixed.
22113 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
22115         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
22116         instead of pp_and).
22118         * expression.cs (Binary.ResolveOperator): I can only use the
22119         Concat (string, string, string) and Concat (string, string,
22120         string, string) if the child is actually a concatenation of
22121         strings. 
22123 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
22125         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
22126         context where we need a 2-character lookahead.
22128         * pending.cs (PendingImplementation): Rework so we can keep track
22129         of interface types all the time, and flag those which were
22130         implemented by parents as optional.
22132 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
22134         * expression.cs (Binary.ResolveOperator): Use
22135         String.Concat(string,string,string) or
22136         String.Concat(string,string,string,string) when possible. 
22138         * typemanager: More helper methods.
22141 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
22143         * pending.cs: remove the bogus return from GetMissingInterfaces()
22144         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
22146 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22148         * namespace.cs: avoid duplicated 'using xxx' being added to
22149         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
22150         when we get more than one 'using' statement for the same namespace.
22151         Report a CS0105 warning for it.
22153 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
22155         * cs-tokenizer.cs (consume_identifier): use read directly, instead
22156         of calling getChar/putback, uses internal knowledge of it.    
22158         (xtoken): Reorder tokenizer so most common patterns are checked
22159         first.  This reduces the compilation time in another 5% (from 8.11s
22160         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
22162         The parsing time is 22% of the compilation in mcs, and from that
22163         64% is spent on the tokenization process.  
22165         I tried using a binary search for keywords, but this is slower
22166         than the hashtable.  Another option would be to do a couple of
22167         things:
22169                 * Not use a StringBuilder, instead use an array of chars,
22170                   with a set value.  Notice that this way we could catch
22171                   the 645 error without having to do it *afterwards*.
22173                 * We could write a hand-parser to avoid the hashtable
22174                   compares altogether.
22176         The identifier consumption process takes 37% of the tokenization
22177         time.  Another 15% is spent on is_number.  56% of the time spent
22178         on is_number is spent on Int64.Parse:
22180                 * We could probably choose based on the string length to
22181                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
22182                   computations. 
22184         Another 3% is spend on wrapping `xtoken' in the `token' function.
22186         Handle 0xa0 as whitespace (#34752)
22188 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
22190         * typemanager.cs (IsCLRType): New routine to tell whether a type
22191         is one of the builtin types.  
22193         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
22194         typecode in more places instead of doing pointer comparissions.
22195         We could leverage some knowledge about the way the typecodes are
22196         laid out.
22198         New code to cache namespaces in assemblies, it is currently not
22199         invoked, to be used soon.
22201         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
22203         * expression.cs (Binary.ResolveOperator): specially handle
22204         strings, and do not perform user-defined operator overloading for
22205         built-in types.
22207 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
22209         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
22210         internalcall as it is a pretty simple operation;  Avoid whenever
22211         possible to call Char.IsLetter.
22213         (consume_identifier): Cut by half the number of
22214         hashtable calls by merging the is_keyword and GetKeyword behavior.
22216         Do not short-circuit, because if we do, we
22217         report errors (ie, #if false && true would produce an invalid
22218         directive error);
22221 2002-11-24  Martin Baulig  <martin@ximian.com>
22223         * expression.cs (Cast.TryReduce): If we're in checked syntax,
22224         check constant ranges and report a CS0221.  Fixes #33186.
22226 2002-11-24  Martin Baulig  <martin@ximian.com>
22228         * cs-parser.jay: Make this work for uninitialized variable
22229         declarations in the `for' initializer.  Fixes #32416.
22231 2002-11-24  Martin Baulig  <martin@ximian.com>
22233         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22234         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
22236 2002-11-24  Martin Baulig  <martin@ximian.com>
22238         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22239         argument; if true, we also check for user-defined conversions.
22240         This is only needed if both arguments are of a user-defined type.
22241         Fixes #30443, added test-175.cs.
22242         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22244         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22246 2002-11-24  Martin Baulig  <martin@ximian.com>
22248         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22249         function to get the store opcode.
22250         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22251         only emit the Ldelema if the store opcode is Stobj.  You must run
22252         both test-34 and test-167 to test this.  Fixes #34529.
22254 2002-11-23  Martin Baulig  <martin@ximian.com>
22256         * ecore.cs (Expression.MemberLookup): Added additional
22257         `qualifier_type' argument which is used when we're being called
22258         from MemberAccess.DoResolve() and null if we're called from a
22259         SimpleName lookup.
22260         (Expression.MemberLookupFailed): New method to report errors; this
22261         does the CS1540 check and reports the correct error message.
22263         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22264         argument for the CS1540 check and redone the way how we're dealing
22265         with private members.  See the comment in the source code for details.
22266         (FilterWithClosure): Reverted this back to revision 1.197; renamed
22267         `closure_start_type' to `closure_qualifier_type' and check whether
22268         it's not null.  It was not this filter being broken, it was just
22269         being called with the wrong arguments.
22271         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22272         and pass it the correct `qualifier_type'; this also does the error
22273         handling for us.
22275 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
22277         * expression.cs (Invocation.EmitParams): If the we are dealing
22278         with a non-built-in value type, load its address as well.
22280         (ArrayCreation): Use a a pretty constant instead
22281         of the hardcoded value 2.   Use 6 instead of 2 for the number of
22282         static initializers.  
22284         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22285         because they are not really value types, just glorified integers. 
22287         * driver.cs: Do not append .exe, the CSC compiler does not do it.
22289         * ecore.cs: Remove redundant code for enumerations, make them use
22290         the same code path as everything else, fixes the casting issue
22291         with enumerations in Windows.Forms.
22293         * attribute.cs: Do only cast to string if it is a string, the
22294         validation happens later.
22296         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22297         people upgrade their corlibs.
22299         * ecore.cs: Oops, enumerations were not following the entire code path
22301 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
22303         * typemanager.cs (FilterWithClosure): Commented out the test for
22304         1540 in typemanager.cs, as it has problems when accessing
22305         protected methods from a parent class (see test-174.cs). 
22307         * attribute.cs (Attribute.ValidateGuid): new method.
22308         (Attribute.Resolve): Use above.
22310 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
22312         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22314         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22315         handling for enumerations, as we only needed the TypeContainer
22316         functionality to begin with (this is required for the fix below to
22317         work for enums that reference constants in a container class for
22318         example). 
22320         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22322         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22323         a valid TypeBuilder to perform lookups on.o
22325         * class.cs (InheritableMemberSignatureCompare): Use true in the
22326         call to GetGetMethod and GetSetMethod, because we are comparing
22327         the signature, and we need to get the methods *even* if they are
22328         private. 
22330         (PropertyBase.CheckBase): ditto.
22332         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22333         GotoCase.Resolve): Use Peel on EmpytCasts.
22335         * ecore.cs (EmptyCast): drop child, add Peel method.
22337 2002-11-17  Martin Baulig  <martin@ximian.com>
22339         * ecore.cs (EmptyCast.Child): New public property.
22341         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22342         label resolved to an EmptyCast.  Fixes #34162.
22343         (GotoCase.Resolve): Likewise.
22344         (Block.EmitMeta): Likewise.
22346 2002-11-17  Martin Baulig  <martin@ximian.com>
22348         * expression.cs (Invocation.BetterConversion): Prefer int over
22349         uint; short over ushort; long over ulong for integer literals.
22350         Use ImplicitConversionExists instead of StandardConversionExists
22351         since we also need to check for user-defined implicit conversions.
22352         Fixes #34165.  Added test-173.cs.
22354 2002-11-16  Martin Baulig  <martin@ximian.com>
22356         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22357         with the `true' and `false' literals.  Fixes #33151.
22359 2002-11-16  Martin Baulig  <martin@ximian.com>
22361         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22362         October 22nd; don't do the cs1540 check for static members.
22364         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22365         now using our own filter here and doing the cs1540 check again.
22367 2002-11-16  Martin Baulig  <martin@ximian.com>
22369         * support.cs (InternalParameters): Don't crash if we don't have
22370         any fixed parameters.  Fixes #33532.
22372 2002-11-16  Martin Baulig  <martin@ximian.com>
22374         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22375         when looking up static methods to make this work on Windows.
22376         Fixes #33773.
22378 2002-11-16  Martin Baulig  <martin@ximian.com>
22380         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22381         a setter rather than using PropertyInfo.CanWrite.
22383 2002-11-15  Nick Drochak  <ndrochak@gol.com>
22385         * class.cs: Allow acces to block member by subclasses. Fixes build
22386         breaker.
22388 2002-11-14  Martin Baulig  <martin@ximian.com>
22390         * class.cs (Constructor.Emit): Added the extern/block check.
22391         Fixes bug #33678.
22393 2002-11-14  Martin Baulig  <martin@ximian.com>
22395         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22396         iteration while looking for indexers, this is needed because the
22397         indexer may have a different name in our base classes.  Fixed the
22398         error reporting (no indexers at all, not get accessor, no
22399         overloaded match).  Fixes bug #33089.
22400         (IndexerAccess.DoResolveLValue): Likewise.
22402 2002-11-14  Martin Baulig  <martin@ximian.com>
22404         * class.cs (PropertyBase.CheckBase): Make this work for multiple
22405         indexers.  Fixes the first part of bug #33089.
22406         (MethodSignature.InheritableMemberSignatureCompare): Added support
22407         for properties.
22409 2002-11-13  Ravi Pratap  <ravi@ximian.com>
22411         * attribute.cs (Attribute.Resolve): Catch the
22412         NullReferenceException and report it since it isn't supposed to
22413         happen. 
22415 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
22417         * expression.cs (Binary.EmitBranchable): Also handle the cases for
22418         LogicalOr and LogicalAnd that can benefit from recursively
22419         handling EmitBranchable.  The code now should be nice for Paolo.
22421 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
22423         * typemanager.cs (LookupType): Added a negative-hit hashtable for
22424         the Type lookups, as we perform quite a number of lookups on
22425         non-Types.  This can be removed once we can deterministically tell
22426         whether we have a type or a namespace in advance.
22428         But this might require special hacks from our corlib.
22430         * TODO: updated.
22432         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22433         and double which avoids a conversion from an integer to a double.
22435         * expression.cs: tiny optimization, avoid calling IsConstant,
22436         because it effectively performs the lookup twice.
22438 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
22440         But a bogus return here to keep the semantics of the old code
22441         until the Mono runtime is fixed.
22443         * pending.cs (GetMissingInterfaces): New method used to remove all
22444         the interfaces that are already implemented by our parent
22445         classes from the list of pending methods. 
22447         * interface.cs: Add checks for calls after ResolveTypeExpr.
22449 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
22451         * class.cs (Class.Emit): Report warning 67: event not used if the
22452         warning level is beyond 3.
22454         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22455         being a NullLiteral.
22457         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22458         specifiers. 
22460         * class.cs (TypeContainer.GetClassBases): Cover a missing code
22461         path that might fail if a type can not be resolved.
22463         * expression.cs (Binary.Emit): Emit unsigned versions of the
22464         operators. 
22466         * driver.cs: use error 5.
22468 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22470         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22472 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
22474         * cs-parser.jay (switch_section): A beautiful patch from Martin
22475         Baulig that fixed 33094.
22477 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
22479         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22480         Check whether the base is abstract and report an error if so.
22482         * expression.cs (IndexerAccess.DoResolveLValue,
22483         IndexerAccess.DoResolve): ditto. 
22485         (Invocation.DoResolve): ditto.
22487         (Invocation.FullMethodDesc): Improve the report string.
22489         * statement.cs (Block): Eliminate IsVariableDefined as it is
22490         basically just a wrapper for GetVariableInfo.
22492         * ecore.cs (SimpleName): Use new 
22494         * support.cs (ReflectionParamter.ParameterType): We unwrap the
22495         type, as we return the actual parameter ref/unref state on a
22496         different call.
22498 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
22500         * support.cs: Return proper flags REF/OUT fixing the previous
22501         commit.  
22503         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
22504         not used to mean `ref' but `ref or out' in ParameterReference
22506         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22507         full type signature instead of calling TypeManger.CSharpName
22508         ourselves. 
22510         * support.cs (InternalParameters.ParameterDesc): Do not compare
22511         directly to the modflags, because REF/OUT will actually be bitsets
22512         if set. 
22514         * delegate.cs (VerifyMethod): Check also the modifiers.
22516         * cs-tokenizer.cs: Fix bug where floating point values with an
22517         exponent where a sign was missing was ignored.
22519         * driver.cs: Allow multiple assemblies to be specified in a single
22520         /r: argument
22522 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
22524         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
22525         because identifiers after a parenthesis would end up in this kind
22526         of production, and we needed to desamiguate it for having casts
22527         like:
22529                 (UserDefinedType *) xxx
22531 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
22533         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22534         we should set on the Bindingflags.NonPublic, but not turn on
22535         private_ok.  private_ok controls whether a Private member is
22536         returned (this is chekced on the filter routine), while the
22537         BindingFlags.NonPublic just controls whether private/protected
22538         will be allowed.   This fixes the problem part of the problem of
22539         private properties being allowed to be used in derived classes.
22541         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22542         so we can call the children DoResolveLValue method (this will
22543         properly signal errors on lvalue assignments to base properties)
22545         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22546         getter are null, and we have a property info, we know that this
22547         happened because the lookup failed, so we report an error 122 for
22548         protection level violation.
22550         We also silently return if setter and getter are null in the
22551         resolve functions, this condition only happens if we have flagged
22552         the error before.  This is the other half of the problem. 
22554         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22555         not have accessibility information, that is why we were returning
22556         true in the filter function in typemanager.cs.
22558         To properly report 122 (property is inaccessible because of its
22559         protection level) correctly, we report this error in ResolveAccess
22560         by failing if both the setter and the getter are lacking (ie, the
22561         lookup failed). 
22563         DoResolve and DoLResolve have been modified to check for both
22564         setter/getter being null and returning silently, the reason being
22565         that I did not want to put the knowledge about this error in upper
22566         layers, like:
22568         int old = Report.Errors;
22569         x = new PropertyExpr (...);
22570         if (old != Report.Errors)
22571                 return null;
22572         else
22573                 return x;
22575         So the property expr is returned, but it is invalid, so the error
22576         will be flagged during the resolve process. 
22578         * class.cs: Remove InheritablePropertySignatureCompare from the
22579         class, as we no longer depend on the property signature to compute
22580         whether it is possible to implement a method or not.
22582         The reason is that calling PropertyInfo.GetGetMethod will return
22583         null (in .NET, in Mono it works, and we should change this), in
22584         cases where the Get Method does not exist in that particular
22585         class.
22587         So this code:
22589         class X { public virtual int A { get { return 1; } } }
22590         class Y : X { }
22591         class Z : Y { public override int A { get { return 2; } } }
22593         Would fail in Z because the parent (Y) would not have the property
22594         defined.  So we avoid this completely now (because the alternative
22595         fix was ugly and slow), and we now depend exclusively on the
22596         method names.
22598         (PropertyBase.CheckBase): Use a method-base mechanism to find our
22599         reference method, instead of using the property.
22601         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22602         routines are gone now.
22604         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22605         names, they were incorrectly named.
22607         * cs-tokenizer.cs: Return are more gentle token on failure. 
22609         * pending.cs (PendingImplementation.InterfaceMethod): This routine
22610         had an out-of-sync index variable, which caused it to remove from
22611         the list of pending methods the wrong method sometimes.
22613 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
22615         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22616         CanWrite, because those refer to this particular instance of the
22617         property, and do not take into account the fact that we can
22618         override single members of a property.
22620         Constructor requires an EmitContext.  The resolution process does
22621         not happen here, but we need to compute the accessors before,
22622         because the resolution does not always happen for properties.
22624         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22625         subclass, before we did not update this flag, but we did update
22626         bindingflags. 
22628         (GetAccessors): Drop this routine, as it did not work in the
22629         presence of partially overwritten set/get methods. 
22631         Notice that this broke the cs1540 detection, but that will require
22632         more thinking. 
22634 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22636         * class.cs:
22637         * codegen.cs:
22638         * driver.cs: issue a warning instead of an error if we don't support
22639         debugging for the platform. Also ignore a couple of errors that may
22640         arise when trying to write the symbols. Undo my previous patch.
22642 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22644         * driver.cs: ignore /debug switch except for Unix platforms.
22646 2002-10-23  Nick Drochak  <ndrochak@gol.com>
22648         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22650 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
22652         * driver.cs: Do not make mcs-debug conditional, so we do not break
22653         builds that use it.
22655         * statement.cs (UsageVector.MergeChildren): I would like Martin to
22656         review this patch.  But basically after all the children variables
22657         have been merged, the value of "Breaks" was not being set to
22658         new_breaks for Switch blocks.  I think that it should be set after
22659         it has executed.  Currently I set this to the value of new_breaks,
22660         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22661         conservative, but I do not understand this code very well.
22663         I did not break anything in the build, so that is good ;-)
22665         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22667 2002-10-20  Mark Crichton  <crichton@gimp.org>
22669         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
22671 2002-10-20  Nick Drochak  <ndrochak@gol.com>
22673         * cfold.cs: Fixed compile blocker.
22675 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
22677         * driver.cs: I was chekcing the key, not the file.
22679 2002-10-19  Ravi Pratap  <ravi@ximian.com>
22681         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22682         message that we were generating - we just need to silently return
22683         a null.
22685 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
22687         * class.cs (Event.Define): Change my previous commit, as this
22688         breaks the debugger.  This is a temporary hack, as it seems like
22689         the compiler is generating events incorrectly to begin with.
22691         * expression.cs (Binary.ResolveOperator): Added support for 
22692         "U operator - (E x, E y)"
22694         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22695         y)".
22697         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22698         init-only variables, but this path did not take into account that
22699         there might be also instance readonly variables.  Correct this
22700         problem. 
22702         This fixes bug 32253
22704         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22705         delegates as well.
22707         * driver.cs: Change the extension for modules to `netmodule'
22709         * cs-parser.jay: Improved slightly the location tracking for
22710         the debugger symbols.
22712         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22713         modifiers that were specified instead of the hardcoded value
22714         (FamAndAssem).  This was basically ignoring the static modifier,
22715         and others.  Fixes 32429.
22717         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22718         fixed a bug in the process (32476)
22720         * expression.cs (ArrayAccess.EmitAssign): Patch from
22721         hwang_rob@yahoo.ca that fixes bug 31834.3
22723 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
22725         * driver.cs: Make the module extension .netmodule.
22727 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
22729         * driver.cs: Report an error if the resource file is not found
22730         instead of crashing.
22732         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22733         false, like Emit does.
22735 2002-10-16  Nick Drochak  <ndrochak@gol.com>
22737         * typemanager.cs: Remove unused private member.  Also reported mcs
22738         bug to report this as a warning like csc.
22740 2002-10-15  Martin Baulig  <martin@gnome.org>
22742         * statement.cs (Statement.Emit): Made this a virtual method; emits
22743         the line number info and calls DoEmit().
22744         (Statement.DoEmit): New protected abstract method, formerly knows
22745         as Statement.Emit().
22747         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22749 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
22751         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22752         have fixed a remaining problem: not every AddXXXX was adding a
22753         fully qualified name.  
22755         Now everyone registers a fully qualified name in the DeclSpace as
22756         being defined instead of the partial name.  
22758         Downsides: we are slower than we need to be due to the excess
22759         copies and the names being registered this way.  
22761         The reason for this is that we currently depend (on the corlib
22762         bootstrap for instance) that types are fully qualified, because
22763         we dump all the types in the namespace, and we should really have
22764         types inserted into the proper namespace, so we can only store the
22765         basenames in the defined_names array.
22767 2002-10-10  Martin Baulig  <martin@gnome.org>
22769         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22770         from bug #31834, see the bug report for a testcase which is
22771         miscompiled.
22773 2002-10-10  Martin Baulig  <martin@gnome.org>
22775         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22776         flow analysis code for this.
22778         * statement.cs (Do, While, For): Tell the flow analysis code about
22779         infinite loops.
22780         (FlowBranching.UsageVector): Added support for infinite loops.
22781         (Block.Resolve): Moved the dead code elimination here and use flow
22782         analysis to do it.
22784 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
22786         * class.cs (Field.Define): Catch cycles on struct type
22787         definitions. 
22789         * typemanager.cs (IsUnmanagedtype): Do not recursively check
22790         fields if the fields are static.  We only need to check instance
22791         fields. 
22793         * expression.cs (As.DoResolve): Test for reference type.
22795         * statement.cs (Using.ResolveExpression): Use
22796         ConvertImplicitRequired, not ConvertImplicit which reports an
22797         error on failture
22798         (Using.ResolveLocalVariableDecls): ditto.
22800         * expression.cs (Binary.ResolveOperator): Report errors in a few
22801         places where we had to.
22803         * typemanager.cs (IsUnmanagedtype): Finish implementation.
22805 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22807         * expression.cs: Use StoreFromPtr instead of extracting the type
22808         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22810         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22811         an enumeration value to a System.Enum, but System.Enum is not a
22812         value type, but an class type, so we need to box.
22814         (Expression.ConvertExplicit): One codepath could return
22815         errors but not flag them.  Fix this.  Fixes #31853
22817         * parameter.cs (Resolve): Do not allow void as a parameter type.
22819 2002-10-06  Martin Baulig  <martin@gnome.org>
22821         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22822         if it's a class type and not a struct.  Fixes #31815.
22824 2002-10-06  Martin Baulig  <martin@gnome.org>
22826         * statement.cs: Reworked the flow analysis code a bit to make it
22827         usable for dead code elimination.
22829 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22831         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22833 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22835         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22836         to fix the test 165, will investigate deeper.
22838 2002-10-04  Martin Baulig  <martin@gnome.org>
22840         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22841         finally blocks actually work.
22842         (Try.Resolve): We don't need to create a sibling for `finally' if
22843         there is no finally block.
22845 2002-10-04  Martin Baulig  <martin@gnome.org>
22847         * class.cs (Constructor.Define): The default accessibility for a
22848         non-default constructor is private, not public.
22850 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22852         * class.cs (Constructor): Make AllowedModifiers public, add
22853         EXTERN.
22855         * cs-parser.jay: Perform the modifiers test here, as the
22856         constructor for the Constructor class usually receives a zero
22857         because of the way we create it (first we create, later we
22858         customize, and we were never checking the modifiers).
22860         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22861         is a version of LookupTypeReflection that includes the type-name
22862         cache.  This can be used as a fast path for functions that know
22863         the fully qualified name and are only calling into *.GetType() to
22864         obtain a composed type.
22866         This is also used by TypeManager.LookupType during its type
22867         composition.
22869         (LookupType): We now also track the real type name, as sometimes
22870         we can get a quey for the real type name from things like
22871         ComposedCast.  This fixes bug 31422.
22873         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22874         complete type fullname, it does not have to go through the type
22875         resolution system to obtain the composed version of the type (for
22876         obtaining arrays or pointers).
22878         (Conditional.Emit): Use the EmitBoolExpression to
22879         generate nicer code, as requested by Paolo.
22881         (ArrayCreation.CheckIndices): Use the patch from
22882         hwang_rob@yahoo.ca to validate the array initializers. 
22884 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22886         * class.cs (ConstructorInitializer.Emit): simplify code by using
22887         Invocation.EmitCall, and at the same time, fix the bugs in calling
22888         parent constructors that took variable arguments. 
22890         * ecore.cs (Expression.ConvertNumericExplicit,
22891         Expression.ImplicitNumericConversion): Remove the code that
22892         manually wrapped decimal (InternalTypeConstructor call is now gone
22893         as well).
22895         * expression.cs (Cast.TryReduce): Also handle decimal types when
22896         trying to perform a constant fold on the type.
22898         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22900         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22901         that only turned off an error report, and did nothing else. 
22903 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22905         * driver.cs: Handle and ignore /fullpaths
22907 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22909         * expression.cs (Binary.ResolveOperator): Catch the case where
22910         DoNumericPromotions returns true, 
22912         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22914 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22916         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22917         report error 70.
22919 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22921         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22922         conversion exists, but it is also required that the conversion be
22923         performed.  This manifested in "(Type64Enum) 2".  
22925         * class.cs (TypeManager.AddMethod): The fix is not to change
22926         AddEnum, because that one was using a fully qualified name (every
22927         DeclSpace derivative does), but to change the AddMethod routine
22928         that was using an un-namespaced name.  This now correctly reports
22929         the duplicated name.
22931         Revert patch until I can properly fix it.  The issue
22932         is that we have a shared Type space across all namespaces
22933         currently, which is wrong.
22935         Options include making the Namespace a DeclSpace, and merge
22936         current_namespace/current_container in the parser.
22938 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22940         * cs-parser.jay: Improve error reporting when we get a different
22941         kind of expression in local_variable_type and
22942         local_variable_pointer_type. 
22944         Propagate this to avoid missleading errors being reported.
22946         * ecore.cs (ImplicitReferenceConversion): treat
22947         TypeManager.value_type as a target just like object_type.   As
22948         code like this:
22950         ValueType v = 1;
22952         Is valid, and needs to result in the int 1 being boxed before it
22953         is assigned to the value type v.
22955         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22956         to validate the enumeration name.
22958         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22959         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22960         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22962         * ecore.cs (TryImplicitIntConversion): When doing an
22963         implicit-enumeration-conversion, check if the type is 64-bits and
22964         perform a conversion before passing to EnumConstant.
22966 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22968         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22969         report ambiguous type references.  Unlike the MS version, we
22970         report what the ambiguity is.   Innovation at work ;-)
22972         (DeclSpace.FindType): Require a location argument to
22973         display when we display an ambiguous error.
22975         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22977         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22979         * expression.cs (EmitDynamicInitializers): Apply patch from
22980         hwang_rob@yahoo.ca that fixes the order in which we emit our
22981         initializers. 
22983 2002-09-21  Martin Baulig  <martin@gnome.org>
22985         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22986         delegate takes no arguments.
22988 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22990         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22991         from integers.
22993         * expression.cs: Extract the underlying type.
22995         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22997         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22999 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
23001         * class.cs (TypeContainer.DefineType): We can not use the nice
23002         PackingSize with the size set to 1 DefineType method, because it
23003         will not allow us to define the interfaces that the struct
23004         implements.
23006         This completes the fixing of bug 27287
23008         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
23009         means also structs.  This fixes part of the problem. 
23010         (Expresion.ImplicitReferenceConversionExists): ditto.
23012         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
23013         error if there were no errors reported during the type lookup
23014         process, to avoid duplicates or redundant errors.  Without this
23015         you would get an ambiguous errors plus a type not found.  We have
23016         beaten the user enough with the first error.  
23018         (DeclSparce.FindType): Emit a warning if we have an ambiguous
23019         reference. 
23021         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
23022         during the resolution process, stop the lookup, this avoids
23023         repeated error reports (same error twice).
23025         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
23027         * typemanager.cs (LookupType): Redo the type lookup code to match
23028         the needs of System.Reflection.  
23030         The issue is that System.Reflection requires references to nested
23031         types to begin with a "+" sign instead of a dot.  So toplevel
23032         types look like: "NameSpace.TopLevelClass", and nested ones look
23033         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
23034         levels. 
23036 2002-09-19  Martin Baulig  <martin@gnome.org>
23038         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
23039         says that a method always returns or always throws an exception,
23040         don't report the CS0161.
23042         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
23043         set `Returns = new_returns'.
23045 2002-09-19  Martin Baulig  <martin@gnome.org>
23047         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
23048         to an enum constant, check for a CS0176.
23050 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
23052         * class.cs (TypeContainer.CheckPairedOperators): Now we check
23053         for operators that must be in pairs and report errors.
23055         * ecore.cs (SimpleName.DoResolveType): During the initial type
23056         resolution process, when we define types recursively, we must
23057         check first for types in our current scope before we perform
23058         lookups in the enclosing scopes.
23060         * expression.cs (MakeByteBlob): Handle Decimal blobs.
23062         (Invocation.VerifyArgumentsCompat): Call
23063         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
23064         I thought we were supposed to always call this, but there are a
23065         few places in the code where we dont do it.
23067 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
23069         * driver.cs: Add support in -linkres and -resource to specify the
23070         name of the identifier.
23072 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
23074         * ecore.cs (StandardConversionExists): Sync with the conversion
23075         code: allow anything-* to void* conversions.
23077         (FindMostSpecificSource): Use an Expression argument
23078         instead of a Type, because we might be handed over a Literal which
23079         gets a few more implicit conversions that plain types do not.  So
23080         this information was being lost.
23082         Also, we drop the temporary type-holder expression when not
23083         required.
23085 2002-09-17  Martin Baulig  <martin@gnome.org>
23087         * class.cs (PropertyBase.CheckBase): Don't check the base class if
23088         this is an explicit interface implementation.
23090 2002-09-17  Martin Baulig  <martin@gnome.org>
23092         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
23093         different `IndexerName' attributes.
23095         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
23096         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
23097         virtual CommonResolve().
23099 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
23101         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
23102         and convert that to the UnderlyingType.
23104         * statement.cs (Foreach.Resolve): Indexers are just like variables
23105         or PropertyAccesses.
23107         * cs-tokenizer.cs (consume_string): Track line numbers and columns
23108         inside quoted strings, we were not doing this before.
23110 2002-09-16  Martin Baulig  <martin@gnome.org>
23112         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
23113         resolve it.  This is needed for the definite assignment check of the
23114         instance expression, fixes bug #29846.
23115         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
23117 2002-09-16  Nick Drochak  <ndrochak@gol.com>
23119         * parameter.cs: Fix compile error.  Cannot reference static member
23120         from an instance object.  Is this an mcs bug?
23122 2002-09-14  Martin Baulig  <martin@gnome.org>
23124         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
23125         multiple times.  Fixes bug #30295, added test-166.cs.
23127 2002-09-14  Martin Baulig  <martin@gnome.org>
23129         * statement.cs (Block.Emit): Don't emit unreachable code.
23130         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
23131         `break' statements.
23132         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
23134 2002-09-14  Martin Baulig  <martin@gnome.org>
23136         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
23137         is set.
23139 2002-09-14  Martin Baulig  <martin@gnome.org>
23141         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
23142         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
23143         be false on the ms runtime.
23145 2002-09-13  Martin Baulig  <martin@gnome.org>
23147         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
23148         the CS0038 error message.
23150 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
23152         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
23153         constant inside, return it.
23155 2002-09-12  Martin Baulig  <martin@gnome.org>
23157         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
23158         implicit conversion can be done between enum types.
23160         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
23161         check whether an implicit conversion to the current enum's UnderlyingType
23162         exists and report an error if not.
23164         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
23165         without debugging support.
23167         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
23168         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
23170 2002-09-12  Martin Baulig  <martin@gnome.org>
23172         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
23174         * ecore.cs (IMemberExpr.DeclaringType): New property.
23175         (SimpleName.SimpleNameResolve): Check whether we're accessing a
23176         nonstatic member of an outer type (CS0038).
23178 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
23180         * driver.cs: Activate the using-error detector at warning level
23181         4 (at least for MS-compatible APIs).
23183         * namespace.cs (VerifyUsing): Small buglett fix.
23185         * pending.cs (PendingImplementation): pass the container pointer. 
23187         * interface.cs (GetMethods): Allow for recursive definition.  Long
23188         term, I would like to move every type to support recursive
23189         definitions, not the current ordering mechanism that we have right
23190         now.
23192         The situation is this: Attributes are handled before interfaces,
23193         so we can apply attributes to interfaces.  But some attributes
23194         implement interfaces, we will now handle the simple cases
23195         (recursive definitions will just get an error).  
23197         * parameter.cs: Only invalidate types at the end if we fail to
23198         lookup all types.  
23200 2002-09-09  Martin Baulig  <martin@gnome.org>
23202         * ecore.cs (PropertyExpr.Emit): Also check for
23203         TypeManager.system_int_array_get_length so this'll also work when
23204         compiling corlib.  Fixes #30003.
23206 2002-09-09  Martin Baulig  <martin@gnome.org>
23208         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
23209         and throw an exception if we can't get the type's size.  Fixed #30040,
23210         added test-165.cs.
23212 2002-09-09  Martin Baulig  <martin@gnome.org>
23214         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
23216         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
23217         context.  Fixes bug #30027.
23219         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
23220         virtual functions.  Fixes bug #30043, added test-164.cs.
23222 2002-09-08  Ravi Pratap  <ravi@ximian.com>
23224         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
23226 2002-09-08  Nick Drochak  <ndrochak@gol.com>
23228         * driver.cs: Use an object to get the windows codepage since it's not a
23229         static property.
23231 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
23233         * statement.cs (For.Emit): for infinite loops (test == null)
23234         return whether there is a break inside, not always "true".
23236         * namespace.cs (UsingEntry): New struct to hold the name of the
23237         using definition, the location where it is defined, and whether it
23238         has been used in a successful type lookup.
23240         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23241         strings.
23243         * decl.cs: ditto.
23245 2002-09-06  Ravi Pratap  <ravi@ximian.com>
23247         * attribute.cs : Fix incorrect code which relied on catching
23248         a NullReferenceException to detect a null being passed in
23249         where an object was expected.
23251 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
23253         * statement.cs (Try): flag the catch variable as assigned
23255         * expression.cs (Cast): Simplified by using ResolveType instead of
23256         manually resolving.
23258         * statement.cs (Catch): Fix bug by using ResolveType.
23260 2002-09-06  Ravi Pratap  <ravi@ximian.com>
23262         * expression.cs (BetterConversion): Special case for when we have
23263         a NullLiteral as the argument and we have to choose between string
23264         and object types - we choose string the way csc does.
23266         * attribute.cs (Attribute.Resolve): Catch the
23267         NullReferenceException and report error #182 since the Mono
23268         runtime no more has the bug and having this exception raised means
23269         we tried to select a constructor which takes an object and is
23270         passed a null.
23272 2002-09-05  Ravi Pratap  <ravi@ximian.com>
23274         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23275         message (1502, 1503) when we can't locate a method after overload
23276         resolution. This is much more informative and closes the bug
23277         Miguel reported.
23279         * interface.cs (PopulateMethod): Return if there are no argument
23280         types. Fixes a NullReferenceException bug.
23282         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23283         expressions too. Previously we were checking only in one place for
23284         positional arguments leaving out named arguments.
23286         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23287         type to the enum type is not allowed. Remove code corresponding to
23288         that.
23290         (ConvertNumericExplicit): Allow explicit conversions from
23291         the underlying type to enum type. This precisely follows the spec
23292         and closes a bug filed by Gonzalo.
23294 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23296         * compiler.csproj:
23297         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23299 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
23301         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23302         it was important that we stored the right value after the
23303         reduction in `converted'.
23305 2002-09-04  Martin Baulig  <martin@gnome.org>
23307         * location.cs (Location.SymbolDocument): Use full pathnames for the
23308         source files.
23310 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
23312         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23313         of the expression resolve mechanism, because that will catch the
23314         SimpleName error failures.
23316         (Conditional): If we can not resolve the
23317         expression, return, do not crash.
23319 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23321         * cs-tokenizer.cs:
23322         (location): display token name instead of its number.
23324 2002-08-28  Martin Baulig  <martin@gnome.org>
23326         * expression.cs (Binary.ResolveOperator): Don't silently return
23327         but return an error if an operator cannot be applied between two
23328         enum types.
23330 2002-08-28  Martin Baulig  <martin@gnome.org>
23332         * class.cs (Constructor.Define): Set the permission attributes
23333         correctly instead of making all constructors public.
23335 2002-08-28  Martin Baulig  <martin@gnome.org>
23337         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23338         for private members before reporting a CS0103; if we find anything,
23339         it's a CS0122.
23341 2002-08-28  Martin Baulig  <martin@gnome.org>
23343         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23344         to check whether `closure_start_type == closure_invocation_type',
23345         we also need to check whether `m.DeclaringType == closure_invocation_type'
23346         before bypassing the permission checks.  We might be accessing
23347         protected/private members from the base class.
23348         (TypeManager.RealMemberLookup): Only set private_ok if private
23349         members were requested via BindingFlags.NonPublic.
23351         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23353         * expression.cs (MemberAccess.ResolveMemberAccess): Set
23354         MethodGroupExpr.IsExplicitImpl if appropriate.
23355         (Invocation.DoResolve): Don't report the CS0120 for explicit
23356         interface implementations.
23358 2002-08-27  Martin Baulig  <martin@gnome.org>
23360         * expression.cs (Invocation.DoResolve): If this is a static
23361         method and we don't have an InstanceExpression, we must report
23362         a CS0120.
23364 2002-08-25  Martin Baulig  <martin@gnome.org>
23366         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23367         `==' between a valuetype and an object.
23369 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
23371         * ecore.cs (TypeExpr): Provide a ToString method.
23373 2002-08-24  Martin Baulig  <martin@gnome.org>
23375         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23376         now called proggie.dbg and it's a binary file.
23378 2002-08-23  Martin Baulig  <martin@gnome.org>
23380         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23382 2002-08-23  Martin Baulig  <martin@gnome.org>
23384         * struct.cs (MyStructInfo.ctor): Make this work with empty
23385         structs; it's not allowed to use foreach() on null.
23387 2002-08-23  Martin Baulig  <martin@gnome.org>
23389         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23390         writer the full pathname of the generated assembly.
23392 2002-08-23  Martin Baulig  <martin@gnome.org>
23394         * statements.cs (FlowBranching.UsageVector.MergeChildren):
23395         A `finally' block never returns or breaks; improved handling of
23396         unreachable code.
23398 2002-08-23  Martin Baulig  <martin@gnome.org>
23400         * statement.cs (Throw.Resolve): Allow `throw null'.
23402 2002-08-23  Martin Baulig  <martin@gnome.org>
23404         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23405         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23406         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
23407         MemberLookup would return a wrong event if this is an explicit
23408         interface implementation and the class has an event with the same
23409         name.
23411 2002-08-23  Martin Baulig  <martin@gnome.org>
23413         * statement.cs (Block.AddChildVariableNames): New public method.
23414         (Block.AddChildVariableName): Likewise.
23415         (Block.IsVariableNameUsedInChildBlock): Likewise.
23416         (Block.AddVariable): Check whether a variable name has already
23417         been used in a child block.
23419         * cs-parser.jay (declare_local_variables): Mark all variable names
23420         from the current block as being used in a child block in the
23421         implicit block.
23423 2002-08-23  Martin Baulig  <martin@gnome.org>
23425         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23426         find the symbol writer.
23428         * driver.cs: csc also allows the arguments to /define being
23429         separated by commas, not only by semicolons.
23431 2002-08-23  Martin Baulig  <martin@gnome.org>
23433         * interface.cs (Interface.GetMembers): Added static check for events.
23435 2002-08-15  Martin Baulig  <martin@gnome.org>
23437         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23438         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23440         * ecore.cs (Expression.MemberLookup): Added documentation and explained
23441         why the MethodData.EmitDestructor() change was necessary.
23443 2002-08-20  Martin Baulig  <martin@gnome.org>
23445         * class.cs (TypeContainer.FindMembers): Added static check for events.
23447         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23449         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23450         use Type.GetEvents(), not Type.FindMembers().
23452 2002-08-20  Martin Baulig  <martin@gnome.org>
23454         * decl.cs (MemberCache): Added a special method cache which will
23455         be used for method-only searched.  This ensures that a method
23456         search will return a MethodInfo with the correct ReflectedType for
23457         inherited methods.      
23459 2002-08-20  Martin Baulig  <martin@gnome.org>
23461         * decl.cs (DeclSpace.FindMembers): Made this public.
23463 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23465         * delegate.cs: fixed build on windows.
23466         [FIXME:  Filed as bug #29150: MCS must report these errors.]
23468 2002-08-19  Ravi Pratap  <ravi@ximian.com>
23470         * ecore.cs (StandardConversionExists): Return a false
23471         if we are trying to convert the void type to anything else
23472         since that is not allowed.
23474         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23475         we flag error 70 in the event an event is trying to be accessed
23476         directly from outside the declaring type.
23478 2002-08-20  Martin Baulig  <martin@gnome.org>
23480         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23481         MemberCache from typemanager.cs to decl.cs.
23483 2002-08-19  Martin Baulig  <martin@gnome.org>
23485         * class.cs (TypeContainer): Implement IMemberContainer.
23486         (TypeContainer.DefineMembers): Create the MemberCache.
23487         (TypeContainer.FindMembers): Do better BindingFlags checking; only
23488         return public members if BindingFlags.Public was given, check
23489         whether members are static.
23491 2002-08-16  Martin Baulig  <martin@gnome.org>
23493         * decl.cs (DeclSpace.Define): Splitted this in Define and
23494         DefineMembers.  DefineMembers is called first and initializes the
23495         MemberCache.
23497         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
23498         DefineMembers() on all our DeclSpaces.
23500         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23501         but call DefineMembers() on all nested interfaces.  We call their
23502         Define() in our new Define() function.
23504         * interface.cs (Interface): Implement IMemberContainer.
23505         (Interface.Define): Moved all code except the attribute stuf to
23506         DefineMembers().
23507         (Interface.DefineMembers): Initialize the member cache.
23509         * typemanager.cs (IMemberFinder): Removed this interface, we don't
23510         need this anymore since we can use MemberCache.FindMembers directly.
23512 2002-08-19  Martin Baulig  <martin@gnome.org>
23514         * typemanager.cs (MemberCache): When creating the cache for an
23515         interface type, add all inherited members.
23516         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23517         to `out bool used_cache' and documented it.
23518         (TypeManager.MemberLookup): If we already used the cache in the first
23519         iteration, we don't need to do the interfaces check.
23521 2002-08-19  Martin Baulig  <martin@gnome.org>
23523         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
23524         here from IMemberFinder and don't implement this interface anymore.
23525         (DeclSpace.MemberCache): Moved here from IMemberFinder.
23527         * typemanager.cs (IMemberFinder): This interface is now only used by
23528         classes which actually support the member cache.
23529         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23530         since we only put DeclSpaces into this Hashtable.
23531         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23532         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23534 2002-08-16  Martin Baulig  <martin@gnome.org>
23536         * typemanager.cs (ICachingMemberFinder): Removed.
23537         (IMemberFinder.MemberCache): New property.
23538         (TypeManager.FindMembers): Merged this with RealFindMembers().
23539         This function will never be called from TypeManager.MemberLookup()
23540         so we can't use the cache here, just the IMemberFinder.
23541         (TypeManager.MemberLookup_FindMembers): Check whether the
23542         IMemberFinder has a MemberCache and call the cache's FindMembers
23543         function.
23544         (MemberCache): Rewrote larger parts of this yet another time and
23545         cleaned it up a bit.
23547 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
23549         * driver.cs (LoadArgs): Support quoting.
23551         (Usage): Show the CSC-like command line arguments.
23553         Improved a few error messages.
23555 2002-08-15  Martin Baulig  <martin@gnome.org>
23557         * typemanager.cs (IMemberContainer.Type): New property.
23558         (IMemberContainer.IsInterface): New property.
23560         The following changes are conditional to BROKEN_RUNTIME, which is
23561         defined at the top of the file.
23563         * typemanager.cs (MemberCache.MemberCache): Don't add the base
23564         class'es members, but add all members from TypeHandle.ObjectType
23565         if we're an interface.
23566         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23567         is the current type.
23568         (MemberCache.CacheEntry.Container): Removed this field.
23569         (TypeHandle.GetMembers): Include inherited members.
23571 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23573         * typemanager.cs: fixed compilation and added a comment on a field that
23574         is never used.
23576 2002-08-15  Martin Baulig  <martin@gnome.org>
23578         * class.cs (ConstructorInitializer.Resolve): In the
23579         Expression.MemberLookup call, use the queried_type as
23580         invocation_type.
23582         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23583         declared' attribute, it's always true.
23584         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23585         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23586         temporary wrapper for FindMembers which tells MemberLookup whether
23587         members from the base classes are included in the return value.
23588         This will go away soon.
23589         (TypeManager.MemberLookup): Use this temporary hack here; once the
23590         new MemberCache is completed, we don't need to do the DeclaredOnly
23591         looping here anymore since the MemberCache will take care of this.
23592         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23593         (MemberCache): When creating the MemberCache for a class, get
23594         members from the current class and all its base classes.
23595         (MemberCache.CacheEntry.Container): New field.  This is a
23596         temporary hack until the Mono runtime is fixed to distinguish
23597         between ReflectedType and DeclaringType.  It allows us to use MCS
23598         with both the MS runtime and the unfixed Mono runtime without
23599         problems and without accecting performance.
23600         (MemberCache.SearchMembers): The DeclaredOnly looping from
23601         TypeManager.MemberLookup is now done here.      
23603 2002-08-14  Martin Baulig  <martin@gnome.org>
23605         * statement.cs (MyStructInfo.MyStructInfo): Don't call
23606         Type.GetFields on dynamic types but get the fields from the
23607         corresponding TypeContainer.
23608         (MyStructInfo.GetStructInfo): Added check for enum types.
23610         * typemanager.cs (MemberList.IsSynchronized): Implemented.
23611         (MemberList.SyncRoot): Implemented.
23612         (TypeManager.FilterWithClosure): No need to check permissions if
23613         closure_start_type == closure_invocation_type, don't crash if
23614         closure_invocation_type is null.
23616 2002-08-13  Martin Baulig  <martin@gnome.org>
23618         Rewrote TypeContainer.FindMembers to use a member cache.  This
23619         gives us a speed increase of about 35% for the self-hosting MCS
23620         build and of about 15-20% for the class libs (both on GNU/Linux).
23622         * report.cs (Timer): New class to get enhanced profiling.  This
23623         whole class is "TIMER" conditional since it remarkably slows down
23624         compilation speed.
23626         * class.cs (MemberList): New class.  This is an IList wrapper
23627         which we're now using instead of passing MemberInfo[]'s around to
23628         avoid copying this array unnecessarily.
23629         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23630         (ICachingMemberFinder, IMemberContainer): New interface.
23631         (TypeManager.FilterWithClosure): If `criteria' is null, the name
23632         has already been checked, otherwise use it for the name comparision.
23633         (TypeManager.FindMembers): Renamed to RealMemberFinder and
23634         provided wrapper which tries to use ICachingMemberFinder.FindMembers
23635         if possible.  Returns a MemberList, not a MemberInfo [].
23636         (TypeHandle): New class, implements IMemberContainer.  We create
23637         one instance of this class per type, it contains a MemberCache
23638         which is used to do the member lookups.
23639         (MemberCache): New class.  Each instance of this class contains
23640         all members of a type and a name-based hash table.
23641         (MemberCache.FindMembers): This is our new member lookup
23642         function.  First, it looks up all members of the requested name in
23643         the hash table.  Then, it walks this list and sorts out all
23644         applicable members and returns them.
23646 2002-08-13  Martin Baulig  <martin@gnome.org>
23648         In addition to a nice code cleanup, this gives us a performance
23649         increase of about 1.4% on GNU/Linux - not much, but it's already
23650         half a second for the self-hosting MCS compilation.
23652         * typemanager.cs (IMemberFinder): New interface.  It is used by
23653         TypeManager.FindMembers to call FindMembers on a TypeContainer,
23654         Enum, Delegate or Interface.
23655         (TypeManager.finder_to_member_finder): New PtrHashtable.
23656         (TypeManager.finder_to_container): Removed.
23657         (TypeManager.finder_to_delegate): Removed.
23658         (TypeManager.finder_to_interface): Removed.
23659         (TypeManager.finder_to_enum): Removed.
23661         * interface.cs (Interface): Implement IMemberFinder.
23663         * delegate.cs (Delegate): Implement IMemberFinder.
23665         * enum.cs (Enum): Implement IMemberFinder.
23667         * class.cs (TypeContainer): Implement IMemberFinder.
23669 2002-08-12  Martin Baulig  <martin@gnome.org>
23671         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23673 2002-08-12  Martin Baulig  <martin@gnome.org>
23675         * ecore.cs (ITypeExpression): New interface for expressions which
23676         resolve to a type.
23677         (TypeExpression): Renamed to TypeLookupExpression.
23678         (Expression.DoResolve): If we're doing a types-only lookup, the
23679         expression must implement the ITypeExpression interface and we
23680         call DoResolveType() on it.
23681         (SimpleName): Implement the new ITypeExpression interface.
23682         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23683         hack, the situation that we're only looking up types can't happen
23684         anymore when this method is called.  Moved the type lookup code to
23685         DoResolveType() and call it.
23686         (SimpleName.DoResolveType): This ITypeExpression interface method
23687         is now doing the types-only lookup.
23688         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23689         (ResolveFlags): Added MaskExprClass.
23691         * expression.cs (MemberAccess): Implement the ITypeExpression
23692         interface.
23693         (MemberAccess.DoResolve): Added support for a types-only lookup
23694         when we're called via ITypeExpression.DoResolveType().
23695         (ComposedCast): Implement the ITypeExpression interface.
23697         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
23698         Expression.Resolve() with ResolveFlags.Type instead.
23700 2002-08-12  Martin Baulig  <martin@gnome.org>
23702         * interface.cs (Interface.Define): Apply attributes.
23704         * attribute.cs (Attribute.ApplyAttributes): Added support for
23705         interface attributes.
23707 2002-08-11  Martin Baulig  <martin@gnome.org>
23709         * statement.cs (Block.Emit): Only check the "this" variable if we
23710         do not always throw an exception.
23712         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23713         whether the property has a set accessor.
23715 2002-08-11  Martin Baulig  <martin@gnome.org>
23717         Added control flow analysis support for structs.
23719         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23720         with control flow analysis turned off.
23721         (IVariable): New interface.
23722         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23723         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23724         (FieldExpr.DoResolve): Resolve the instance expression with flow
23725         analysis turned off and do the definite assignment check after the
23726         resolving when we know what the expression will resolve to.
23728         * expression.cs (LocalVariableReference, ParameterReference):
23729         Implement the new IVariable interface, only call the flow analysis
23730         code if ec.DoFlowAnalysis is true.
23731         (This): Added constructor which takes a Block argument.  Implement
23732         the new IVariable interface.
23733         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23734         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23735         This does the definite assignment checks for struct members.
23737         * class.cs (Constructor.Emit): If this is a non-static `struct'
23738         constructor which doesn't have any initializer, call
23739         Block.AddThisVariable() to tell the flow analysis code that all
23740         struct elements must be initialized before control returns from
23741         the constructor.
23743         * statement.cs (MyStructInfo): New public class.
23744         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23745         argument to this indexer.  If non-zero, check an individual struct
23746         member, not the whole struct.
23747         (FlowBranching.CheckOutParameters): Check struct members.
23748         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23749         overloaded versions of these methods which take an additional
23750         `int field_idx' argument to check struct members.
23751         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23752         overloaded versions of these methods which take an additional
23753         `string field_name' argument to check struct member.s
23754         (VariableInfo): Implement the IVariable interface.
23755         (VariableInfo.StructInfo): New public property.  Returns the
23756         MyStructInfo instance of the variable if it's a struct or null.
23757         (Block.AddThisVariable): New public method.  This is called from
23758         Constructor.Emit() for non-static `struct' constructor which do
23759         not have any initializer.  It creates a special variable for the
23760         "this" instance variable which will be checked by the flow
23761         analysis code to ensure that all of the struct's fields are
23762         initialized before control returns from the constructor.
23763         (UsageVector): Added support for struct members.  If a
23764         variable/parameter is a struct with N members, we reserve a slot
23765         in the usage vector for each member.  A struct is considered fully
23766         initialized if either the struct itself (slot 0) or all its
23767         members are initialized.
23769 2002-08-08  Martin Baulig  <martin@gnome.org>
23771         * driver.cs (Driver.MainDriver): Only report an error CS5001
23772         if there were no compilation errors.
23774         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23775         `UnsafeContext' property to determine whether the parent is in
23776         unsafe context rather than checking the parent's ModFlags:
23777         classes nested in an unsafe class are unsafe as well.
23779 2002-08-08  Martin Baulig  <martin@gnome.org>
23781         * statement.cs (UsageVector.MergeChildren): Distinguish between
23782         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23783         we return.  Added test17() and test18() to test-154.cs.
23785 2002-08-08  Martin Baulig  <martin@gnome.org>
23787         * typemanager.cs (TypeManager.FilterWithClosure): If we have
23788         Family access, make sure the invoking type isn't a subclass of the
23789         queried type (that'd be a CS1540).
23791         * ecore.cs (Expression.MemberLookup): Added overloaded version of
23792         this method which takes an additional `Type invocation_type'.
23794         * expression.cs (BaseAccess.DoResolve): Use the base type as
23795         invocation and query type.
23796         (MemberAccess.DoResolve): If the lookup failed and we're about to
23797         report a CS0122, try a lookup with the ec.ContainerType - if this
23798         succeeds, we must report a CS1540.
23800 2002-08-08  Martin Baulig  <martin@gnome.org>
23802         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23803         (MethodGroupExpr): Implement the IMemberExpr interface.
23805         * expression (MemberAccess.ResolveMemberAccess): No need to have
23806         any special code for MethodGroupExprs anymore, they're now
23807         IMemberExprs.   
23809 2002-08-08  Martin Baulig  <martin@gnome.org>
23811         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23812         Family, FamANDAssem and FamORAssem permissions.
23813         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23815 2002-08-08  Martin Baulig  <martin@gnome.org>
23817         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23818         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23819         or loop block.
23821 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23823         * driver.cs: implemented /resource option to embed managed resources.
23825 2002-08-07  Martin Baulig  <martin@gnome.org>
23827         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23828         (FieldBase.HasFieldInitializer): New public property.
23829         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23830         returns the field initializer and makes sure it is only resolved once.
23831         (TypeContainer.EmitFieldInitializers): Call
23832         FieldBase.GetInitializerExpression to get the initializer, this ensures
23833         that it isn't resolved multiple times.
23835         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23836         the resolving process (SimpleName/MemberLookup) that we're currently
23837         emitting a field initializer (which must not access any instance members,
23838         this is an error CS0236).
23840         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23841         argument, if the `IsFieldInitializer' flag is set, we must report and
23842         error CS0236 and not an error CS0120.   
23844 2002-08-07  Martin Baulig  <martin@gnome.org>
23846         * ecore.cs (IMemberExpr): New public interface.
23847         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23848         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23849         if the expression is an IMemberExpr.
23851         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23852         to be null, implicitly default to `this' if we're non-static in
23853         this case.  Simplified the code a lot by using the new IMemberExpr
23854         interface.  Also fixed bug #28176 here.
23856 2002-08-06  Martin Baulig  <martin@gnome.org>
23858         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23859         ParameterReferences during semantic analysis so that we can do a
23860         type-only search when resolving Cast, TypeOf and SizeOf.
23861         (block): Pass the `current_local_parameters' to the Block's
23862         constructor.
23864         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23865         argument to the constructor.
23866         (ConstructorInitializer.Resolve): Create a temporary implicit
23867         block with the parameters.
23869         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23870         references here if we aren't doing a type-only search.
23872         * statement.cs (Block): Added constructor which takes a
23873         `Parameters parameters' argument.
23874         (Block.Parameters): New public property.
23876         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23877         to `Parameters' and made it public readonly.
23879 2002-08-06  Martin Baulig  <martin@gnome.org>
23881         * ecore.cs (Expression.Warning): Made this public as well.
23883         * report.cs (Report.Debug): Print the contents of collections.
23885 2002-08-06  Martin Baulig  <martin@gnome.org>
23887         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23888         used to tell Resolve() which kinds of expressions it may return.
23889         (Expression.Resolve): Added overloaded version of this method which
23890         takes a `ResolveFlags flags' argument.  This can be used to tell
23891         Resolve() which kinds of expressions it may return.  Reports a
23892         CS0118 on error.
23893         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23894         ResolveFlags.SimpleName.
23895         (Expression.Error118): Added overloaded version of this method which
23896         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23897         which kinds of expressions are allowed.
23899         * expression.cs (Argument.ResolveMethodGroup): New public method.
23900         Resolves an argument, but allows a MethodGroup to be returned.
23901         This is used when invoking a delegate.
23903         * TODO: Updated a bit.
23905 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23907         Fixed compilation with csc.
23909         * ecore.cs: Expression.Error made public. Is this correct? Should
23910         Warning be made public too?
23912         * expression.cs: use ea.Location instead of ea.loc.
23913         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23915 2002-08-06  Martin Baulig  <martin@gnome.org>
23917         * ecore.cs (Expression.loc): Moved the location here instead of
23918         duplicating it in all derived classes.
23919         (Expression.Location): New public property.
23920         (Expression.Error, Expression.Warning): Made them non-static and
23921         removed the location argument.
23922         (Expression.Warning): Added overloaded version which takes an
23923         `int level' argument.
23924         (Expression.Error118): Make this non-static and removed the
23925         expression and location arguments.
23926         (TypeExpr): Added location argument to the constructor.
23928         * expression.cs (StaticCallExpr): Added location argument to
23929         the constructor.
23930         (Indirection, PointerArithmetic): Likewise.
23931         (CheckedExpr, UnCheckedExpr): Likewise.
23932         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23933         (StringPtr): Likewise.
23936 2002-08-05  Martin Baulig  <martin@gnome.org>
23938         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23940         * assign.cs (Assign.DoResolve): Check whether the source
23941         expression is a value or variable.
23943         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23944         while resolving the corresponding blocks.
23946         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23947         an error, don't silently return null.
23949         * statement.cs (Block.AddVariable): Do the error reporting here
23950         and distinguish between CS0128 and CS0136.
23951         (Block.DoResolve): Report all unused labels (warning CS0164).
23952         (LabeledStatement): Pass the location to the constructor.
23953         (LabeledStatement.HasBeenReferenced): New property.
23954         (LabeledStatement.Resolve): Set it to true here.
23956         * statement.cs (Return.Emit): Return success even after reporting
23957         a type mismatch error (CS0126 or CS0127), this is what csc does and
23958         it avoids confusing the users with any consecutive errors.
23960 2002-08-05  Martin Baulig  <martin@gnome.org>
23962         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23964         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23966         * expression.cs (MemberAccess.DoResolve): Silently return if an
23967         error has already been reported.
23969         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23970         error has already been reported.
23972 2002-08-05  Martin Baulig  <martin@gnome.org>
23974         * statement.cs (UsageVector): Only initialize the `parameters'
23975         vector if we actually have any "out" parameters.
23977 2002-08-05  Martin Baulig  <martin@gnome.org>
23979         * expression.cs (Binary.ResolveOperator): When combining delegates,
23980         they must have the same type.
23982 2002-08-05  Martin Baulig  <martin@gnome.org>
23984         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23985         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23986         work with the ms runtime and we also don't need it: if we're a
23987         PropertyBuilder and not in the `indexer_arguments' hash, then we
23988         are a property and not an indexer.
23990         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23991         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23992         since the latter one doesn't work with the ms runtime.
23994 2002-08-03  Martin Baulig  <martin@gnome.org>
23996         Fixed bugs #27998 and #22735.
23998         * class.cs (Method.IsOperator): New public field.
23999         (Method.CheckBase): Report CS0111 if there's already a method
24000         with the same parameters in the current class.  Report CS0508 when
24001         attempting to change the return type of an inherited method.
24002         (MethodData.Emit): Report CS0179 if a method doesn't have a body
24003         and it's not marked abstract or extern.
24004         (PropertyBase): New abstract base class for Property and Indexer.
24005         (PropertyBase.CheckBase): Moved here from Property and made it work
24006         for indexers.
24007         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
24008         the same so we can reuse it there.
24009         (Property, Indexer): Derive from PropertyBase.
24010         (MethodSignature.inheritable_property_signature_filter): New delegate
24011         to find properties and indexers.
24013         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
24014         argument and improved error reporting.
24016         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
24017         EmptyReadOnlyParameters and made it a property.
24019         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
24020         version of this method which takes a `PropertyInfo indexer'.
24021         (TypeManager.RegisterIndexer): New method.
24023         * class.cs: Added myself as author of this file :-)
24025 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24027         * class.cs: fixed compilation on windoze.
24029 2002-08-03  Martin Baulig  <martin@gnome.org>
24031         * interface.cs (Interface.GetInterfaceBases): Check whether all
24032         base interfaces are at least as accessible than the current one.
24034         * class.cs (TypeContainer.GetClassBases): Check whether base types
24035         are at least as accessible than the current type.
24036         (TypeContainer.AsAccessible): Implemented and made non-static.
24037         (MemberBase.CheckParameters): Report errors if the accessibility
24038         checks fail.
24040         * delegate.cs (Delegate.Delegate): The default visibility is
24041         internal for top-level types and private for nested types.
24042         (Delegate.Define): Report errors if the accessibility checks fail.
24044         * enum.cs (Enum.Enum): The default visibility is internal for
24045         top-level types and private for nested types.
24046         (Enum.DefineType): Compute the correct visibility.
24048         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
24049         function which takes a `bool is_toplevel' instead of a TypeContainer.
24051         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
24052         builtin type.
24054 2002-08-02  Martin Baulig  <martin@gnome.org>
24056         * expression.cs (LocalVariableReferenc): Added constructor which
24057         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
24058         (LocalVariableReference.IsReadOnly): New property.
24059         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
24060         variable is readonly, use our own readonly flag to do this; you can
24061         use the new constructor to get a writable reference to a read-only
24062         variable.
24064         * cs-parser.jay (foreach_statement, using_statement): Get a writable
24065         reference to the local variable.
24067 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
24069         * rootcontext.cs (ResolveCore): Also include System.Exception
24071         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
24072         we reach an EmptyStatement.
24074         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
24075         is also fine.
24077         * expression.cs (Binary.ResolveOperator): Check error result in
24078         two places.
24080         use brtrue/brfalse directly and avoid compares to null.
24082 2002-08-02  Martin Baulig  <martin@gnome.org>
24084         * class.cs (TypeContainer.Define): Define all nested interfaces here.
24085         Fixes bug #28407, added test-155.cs.
24087 2002-08-01  Martin Baulig  <martin@gnome.org>
24089         * class.cs (Event.EmitDefaultMethod): Make this work with static
24090         events.  Fixes #28311, added verify-3.cs.
24092 2002-08-01  Martin Baulig  <martin@gnome.org>
24094         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
24095         `is_disposable' fields.
24096         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
24097         `hm.is_disposable' if we're using the collection pattern.
24098         (Foreach.EmitCollectionForeach): Use the correct type for the
24099         enumerator's local variable, only emit the try/finally block if
24100         necessary (fixes #27713).
24102 2002-08-01  Martin Baulig  <martin@gnome.org>
24104         * ecore.cs (Expression.report118): Renamed to Error118 and made
24105         it public static.
24107         * statement.cs (Throw.Resolve): Check whether the expression is of
24108         the correct type (CS0118) and whether the type derives from
24109         System.Exception (CS0155).
24110         (Catch.Resolve): New method.  Do the type lookup here and check
24111         whether it derives from System.Exception (CS0155).
24112         (Catch.CatchType, Catch.IsGeneral): New public properties.
24114         * typemanager.cs (TypeManager.exception_type): Added.
24116 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
24118         * driver.cs: Updated About function.
24120 2002-07-31  Martin Baulig  <martin@gnome.org>
24122         Implemented Control Flow Analysis.
24124         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
24125         (EmitContext.CurrentBranching): Added.
24126         (EmitContext.StartFlowBranching): Added.
24127         (EmitContext.EndFlowBranching): Added.
24128         (EmitContext.KillFlowBranching): Added.
24129         (EmitContext.IsVariableAssigned): Added.
24130         (EmitContext.SetVariableAssigned): Added.
24131         (EmitContext.IsParameterAssigned): Added.
24132         (EmitContext.SetParameterAssigned): Added.
24133         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
24134         Added control flow analysis stuff here.
24136         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
24137         resolve the expression as lvalue.
24138         (LocalVariableReference.DoResolve): Check whether the variable has
24139         already been assigned.
24140         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
24141         the parameter as assigned here.
24142         (ParameterReference.DoResolve): Check whether the parameter has already
24143         been assigned.
24144         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
24145         expression as lvalue.
24147         * statement.cs (FlowBranching): New class for the flow analysis code.
24148         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
24149         (LabeledStatement.IsDefined): New public property.
24150         (LabeledStatement.AddUsageVector): New public method to tell flow
24151         analyis that the label may be reached via a forward jump.
24152         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
24153         flow analysis.
24154         (VariableInfo.Number): New public field.  This is used by flow analysis
24155         to number all locals of a block.
24156         (Block.CountVariables): New public property.  This is the number of
24157         local variables in this block (including the locals from all parent
24158         blocks).
24159         (Block.EmitMeta): Number all the variables.
24161         * statement.cs: Added flow analysis support to all classes.
24163 2002-07-31  Martin Baulig  <martin@gnome.org>
24165         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
24166         To get debugging messages, compile mcs with /define:MCS_DEBUG and
24167         then use this argument.
24169         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
24171         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
24172         use this to specify /define options.
24174 2002-07-29  Martin Baulig  <martin@gnome.org>
24176         * statement.cs (Fixed): Moved all code that does variable lookups
24177         and resolvings from Emit to Resolve.
24179         * statement.cs (For): Moved all code that does variable lookups
24180         and resolvings from Emit to Resolve.
24182         * statement.cs (Using): Moved all code that does variable lookups
24183         and resolvings from Emit to Resolve.
24185 2002-07-29  Martin Baulig  <martin@gnome.org>
24187         * attribute.cs (Attribute.Resolve): Explicitly catch a
24188         System.NullReferenceException when creating the
24189         CustromAttributeBuilder and report a different warning message.
24191 2002-07-29  Martin Baulig  <martin@gnome.org>
24193         * support.cs (ParameterData.ParameterName): Added method to
24194         get the name of a parameter.
24196         * typemanager.cs (TypeManager.IsValueType): New public method.
24198 2002-07-29  Martin Baulig  <martin@gnome.org>
24200         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
24201         is a flag which specifies that it's either ref or out.
24202         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
24203         the out parameter to `out Parameter.Modifier mod', also set the
24204         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
24206         * support.cs (InternalParameters.ParameterModifier): Distinguish
24207         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24208         Parameter.Modifier.ISBYREF flag if it's either ref or out.
24210         * expression.cs (Argument.GetParameterModifier): Distinguish
24211         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24212         Parameter.Modifier.ISBYREF flag if it's either ref or out.
24214 2002-07-29  Martin Baulig  <martin@gnome.org>
24216         * expression.cs (ParameterReference.ParameterReference): Added
24217         `Location loc' argument to the constructor.
24219         * cs-parser.jay: Pass location to ParameterReference.
24221 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
24223         * statement.cs (Try): Initialize the location.
24225         * cs-parser.jay: pass location to Try.
24227         * expression.cs (Unary.Reduce): Change the prototype to return
24228         whether a constant fold could be performed or not.  The result is
24229         returned in an out parameters.  In the case of Indirection and
24230         AddressOf, we want to perform the full tests.
24232 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
24234         * statement.cs (Statement.Emit): Flag dead code.
24236 2002-07-27  Andrew Birkett  <andy@nobugs.org>
24238         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24240 2002-07-27  Martin Baulig  <martin@gnome.org>
24242         * class.cs (MethodData.Define): Put back call to
24243         TypeManager.AddMethod(), accidentally commented this out.
24245         * report.cs (Debug): New public method to print debugging information,
24246         this is `[Conditional ("DEBUG")]'.
24248 2002-07-26  Martin Baulig  <martin@gnome.org>
24250         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24251         (switch_statement): Push the current_block to the switch_stack and
24252         pop it again when we're done with the switch.
24253         (switch_section): The new block is a child of the current_block.
24254         Fixes bug #24007, added test-152.cs.
24256 2002-07-27  Martin Baulig  <martin@gnome.org>
24258         * expression.cs (Invocation.EmitArguments): When calling a varargs
24259         function with only its fixed arguments, we need to pass an empty
24260         array.
24262 2002-07-27  Martin Baulig  <martin@gnome.org>
24264         Mono 0.13 has been released.
24266 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
24268         * driver.cs: Rename --resource to --linkres, because that is what
24269         we do currently, we dont support --resource yet.
24271         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24273 2002-07-25  Martin Baulig  <martin@gnome.org>
24275         * class.cs (MethodData): New public class.  This is a `method builder'
24276         class for a method or one accessor of a Property/Indexer/Event.
24277         (MethodData.GetMethodFlags): Moved here from MemberBase.
24278         (MethodData.ApplyAttributes): Likewise.
24279         (MethodData.ApplyObsoleteAttribute): Likewise.
24280         (MethodData.ApplyConditionalAttribute): Likewise.
24281         (MethodData.ApplyDllImportAttribute): Likewise.
24282         (MethodData.CheckAbstractAndExternal): Likewise.
24283         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24284         (MethodData.Emit): Formerly known as Method.Emit().
24285         (MemberBase): Moved everything which was specific to a single
24286         accessor/method to MethodData.
24287         (Method): Create a new MethodData and call Define() and Emit() on it.
24288         (Property, Indexer, Event): Create a new MethodData objects for each
24289         accessor and call Define() and Emit() on them.
24291 2002-07-25  Martin Baulig  <martin@gnome.org>
24293         Made MethodCore derive from MemberBase to reuse the code from there.
24294         MemberBase now also checks for attributes.
24296         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24297         (MemberBase.GetMethodFlags): Moved here from class Method and marked
24298         as virtual.
24299         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24300         `CallingConventions cc' and `Attributes opt_attrs' arguments.
24301         (MemberBase.ApplyAttributes): New virtual method; applies the
24302         attributes to a method or accessor.
24303         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24304         (MemberBase.ApplyConditionalAttribute): Likewise.
24305         (MemberBase.ApplyDllImportAttribute): Likewise.
24306         (MemberBase.CheckAbstractAndExternal): Likewise.
24307         (MethodCore.ParameterTypes): This is now a property instead of a
24308         method, it's initialized from DoDefineParameters().
24309         (MethodCore.ParameterInfo): Removed the set accessor.
24310         (MethodCore.DoDefineParameters): New protected virtual method to
24311         initialize ParameterTypes and ParameterInfo.
24312         (Method.GetReturnType): We can now simply return the MemberType.
24313         (Method.GetMethodFlags): Override the MemberBase version and add
24314         the conditional flags.
24315         (Method.CheckBase): Moved some code from Define() here, call
24316         DoDefineParameters() here.
24317         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24318         here to avoid some larger code duplication.
24319         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24320         ensure that abstract and external accessors don't declare a body.
24322         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24323         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24324         lookup in the attribute's parent classes, so we need to abort as soon
24325         as we found the first match.
24326         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24327         the attribute has no arguments.
24329         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24330         of a Method.
24332 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24334         * cs-parser.jay: reverted previous patch.
24336 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24338         * cs-parser.jay: fixed bug #22119.
24340 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24342         * attribute.cs: fixed compilation. The error was:
24343         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
24344         be assigned to before control leaves the current method."
24345         [FIXME:  Filed as bug #28186: MCS must report this error.]
24347 2002-07-25  Martin Baulig  <martin@gnome.org>
24349         * attribute.cs (Attribute.Conditional_GetConditionName): New static
24350         method to pull the condition name ouf of a Conditional attribute.
24351         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24352         the obsolete message and error flag out of an Obsolete attribute.
24354         * class.cs (Method.GetMethodFlags): New public method to get the
24355         TypeManager.MethodFlags for this method.
24356         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24357         private methods.
24358         (Method.Define): Get and apply the Obsolete and Conditional attributes;
24359         if we're overriding a virtual function, set the new private variable
24360         `parent_method'; call the new TypeManager.AddMethod().
24362         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
24363         the MethodBuilder and the Method in a PtrHashtable.
24364         (TypeManager.builder_to_method): Added for this purpose.
24365         (TypeManager.MethodFlags): Added IsObsoleteError.
24366         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
24367         Obsolete and Conditional arguments in MethodBuilders.  If we discover
24368         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24369         the message from the attribute.
24371 2002-07-24  Martin Baulig  <martin@gnome.org>
24373         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24374         preprocessor directives, ensure that the argument to #define/#undef is
24375         exactly one identifier and that it's actually an identifier.
24377         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24378         did not work ....
24380 2002-07-24  Martin Baulig  <martin@gnome.org>
24382         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24383         initialize it to TypeManager.object_type in the constructor.
24384         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24385         of the `hm.get_current' method if we're using the collection pattern.
24386         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24387         for the explicit conversion to make it work when we're using the collection
24388         pattern and the `Current' property has a different return type than `object'.
24389         Fixes #27713.
24391 2002-07-24  Martin Baulig  <martin@gnome.org>
24393         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24394         does not match, but don't report any errors.  This method is called in
24395         order for all methods in a MethodGroupExpr until a matching method is
24396         found, so we don't want to bail out if the first method doesn't match.
24397         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24398         matches, report the 123.  Fixes #28070.
24400 2002-07-24  Martin Baulig  <martin@gnome.org>
24402         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24403         TypeManager.TypeToCoreType() to the top of the method so the
24404         following equality checks will work.  Fixes #28107.
24406 2002-07-24  Martin Baulig  <martin@gnome.org>
24408         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24409         operand is of type uint, and the other operand is of type sbyte,
24410         short or int, the operands are converted to type long." -
24411         Actually do what this comment already told us.  Fixes bug #28106,
24412         added test-150.cs.
24414 2002-07-24  Martin Baulig  <martin@gnome.org>
24416         * class.cs (MethodBase): New abstract class.  This is now a base
24417         class for Property, Indexer and Event to avoid some code duplication
24418         in their Define() and DefineMethods() methods.
24419         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24420         generic methods for Define() and DefineMethods().
24421         (FieldBase): Derive from MemberBase, not MemberCore.
24422         (Property): Derive from MemberBase, not MemberCore.
24423         (Property.DefineMethod): Moved all the code from this method to the
24424         new MethodBase.DefineAccessor(), just call it with appropriate
24425         argumetnts.
24426         (Property.Define): Call the new Property.DoDefine(), this does some
24427         sanity checks and we don't need to duplicate the code everywhere.
24428         (Event): Derive from MemberBase, not MemberCore.
24429         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24430         accessors, this will also make them work with interface events.
24431         (Indexer): Derive from MemberBase, not MemberCore.
24432         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24433         (Indexer.Define): Use the new MethodBase functions.
24435         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24436         argument to the constructor.
24437         (Interface.FindMembers): Added support for interface events.
24438         (Interface.PopluateEvent): Implemented.
24440         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
24442 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
24444         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24445         but this is required to check for a method name being the same as
24446         the containing class.  
24448         Handle this now.
24450 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24452         * interface.cs: initialize variable.
24454 2002-07-23  Martin Baulig  <martin@gnome.org>
24456         Implemented the IndexerName attribute in interfaces.
24458         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24459         name if this is an explicit interface implementation.
24460         (Indexer.InterfaceIndexerName): New public variable.  If we're
24461         implementing an interface indexer, this is the IndexerName in that
24462         interface.  Otherwise, it's the IndexerName.
24463         (Indexer.DefineMethod): If we're implementing interface indexer,
24464         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
24465         and Pending.ImplementIndexer methods.
24466         (Indexer.Define): Also define the PropertyBuilder if we're
24467         implementing an interface indexer and this is neither an explicit
24468         interface implementation nor do the IndexerName match the one in
24469         the interface.
24471         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24472         If a method is defined here, then we always need to create a proxy
24473         for it.  This is used when implementing interface indexers.
24474         (Pending.IsInterfaceIndexer): New public method.
24475         (Pending.ImplementIndexer): New public method.
24476         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24477         This is used when implementing interface indexers to define a proxy
24478         if necessary.
24479         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24480         define a proxy if necessary.
24482         * interface.cs (Interface.IndexerName): New public variable.
24483         (Interface.PopulateIndexer): Set the IndexerName.
24484         (Interface.DefineIndexers): New private method.  Populate all the
24485         indexers and make sure their IndexerNames match.
24487         * typemanager.cs (IndexerPropertyName): Added support for interface
24488         indexers.
24490 2002-07-22  Martin Baulig  <martin@gnome.org>
24492         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24493         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24494         ret if HasReturnLabel.
24495         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24496         variables.
24498         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24499         and set the ec.LoopBeginTryCatchLevel.
24500         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24501         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24502         the current ec.TryCatchLevel, the branch goes out of an exception
24503         block.  In this case, we need to use Leave and not Br.
24505 2002-07-22  Martin Baulig  <martin@gnome.org>
24507         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24508         block unless the block does not always return or it is contained in
24509         another try { ... } catch { ... } block.  Fixes bug #26506.
24510         Added verify-1.cs to the test suite.
24512 2002-07-22  Martin Baulig  <martin@gnome.org>
24514         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24515         then we do not always return.  Fixes bug #24985.
24517 2002-07-22  Martin Baulig  <martin@gnome.org>
24519         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24520         lookup on a per-class level; ie. walk up the class hierarchy until we
24521         found at least one applicable method, then choose the best among them.
24522         Fixes bug #24463 and test-29.cs.
24524 2002-07-22  Martin Baulig  <martin@gnome.org>
24526         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24527         return types of the methods.  The return type is not part of the
24528         signature and we must not check it to make the `new' modifier work.
24529         Fixes bug #27999, also added test-147.cs.
24530         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24532         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24533         on the method's return type.
24535 2002-07-21  Martin Baulig  <martin@gnome.org>
24537         * assign.cs: Make this work if the rightmost source is a constant and
24538         we need to do an implicit type conversion.  Also adding a few more tests
24539         to test-38.cs which should have caught this.
24541         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24542         target in the makefile for this.  The makefile.gnu is primarily intended
24543         for end-users who don't want to debug the compiler.
24545 2002-07-21  Martin Baulig  <martin@gnome.org>
24547         * assign.cs: Improved the Assign class so it can now handle embedded
24548         assignments (X = Y = Z = something).  As a side-effect this'll now also
24549         consume less local variables.  test-38.cs now passes with MCS, added
24550         a few new test cases to that test.
24552 2002-07-20  Martin Baulig  <martin@gnome.org>
24554         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24555         instructions.  Fixes bug #27977, also added test-146.cs.
24557 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24559         * cs-tokenizer.cs: fixed getHex ().
24561 2002-07-19  Martin Baulig  <martin@gnome.org>
24563         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24564         not Type.GetType() to lookup the array type.  This is needed when
24565         we're constructing an array of a user-defined type.
24566         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24567         single-dimensional arrays, but also for single-dimensial arrays of
24568         type decimal.
24570 2002-07-19  Martin Baulig  <martin@gnome.org>
24572         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24573         this function is called, it's not allowed to share LocalBuilders
24574         among ILGenerators.
24576 2002-07-19  Martin Baulig  <martin@gnome.org>
24578         * expression.cs (Argument.Resolve): Report an error 118 when trying
24579         to pass a type as argument.
24581 2002-07-18  Martin Baulig  <martin@gnome.org>
24583         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24584         Conv_R_Un for the signed `long' type.
24586 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
24588         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24589         `expr' for the temporary result, as that will fail if we do
24590         multiple resolves on the same expression.
24592 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
24594         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24595         ec.TypeContainer for looking up aliases. 
24597         * class.cs (TypeContainer): Remove LookupAlias from here.
24599         * decl.cs (DeclSpace); Move here.
24601 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
24603         * class.cs (FindMembers): Only call filter if the constructor
24604         bulider is not null.
24606         Also handle delegates in `NestedTypes' now.  Now we will perform
24607         type lookups using the standard resolution process.  This also
24608         fixes a bug.
24610         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24611         This uses Expressions (the limited kind that can be parsed by the
24612         tree) instead of strings.
24614         * expression.cs (ComposedCast.ToString): Implement, used to flag
24615         errors since now we have to render expressions.
24617         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
24618         FormArrayType. 
24620         * ecore.cs (SimpleName.ToString): ditto.
24622         * cs-parser.jay: Instead of using strings to assemble types, use
24623         Expressions to assemble the type (using SimpleName, ComposedCast,
24624         MemberAccess).  This should fix the type lookups in declarations,
24625         because we were using a different code path for this.
24627         * statement.cs (Block.Resolve): Continue processing statements
24628         even when there is an error.
24630 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
24632         * class.cs (Event.Define): Also remove the `remove' method from
24633         the list of pending items.
24635         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24636         generate more compact code. 
24638 2002-07-17  Martin Baulig  <martin@gnome.org>
24640         * const.cs (Const.LookupConstantValue): Add support for constant
24641         `unchecked' and `checked' expressions.
24642         Also adding test case test-140.cs for this.
24644 2002-07-17  Martin Baulig  <martin@gnome.org>
24646         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24647         check whether mi.ReturnType implements the IEnumerator interface; the
24648         `==' and the IsAssignableFrom() will fail in this situation.
24650 2002-07-16  Ravi Pratap  <ravi@ximian.com>
24652         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
24653         here too.
24655 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24657         * expression.cs: fixed bug #27811.
24659 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
24661         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24662         Molaro: when we are a ref, the value already contains a pointer
24663         value, do not take the address of it.
24665 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24666         * removed mb-parser.jay and mb-tokenizer.cs
24668 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24670         * expression.cs: check against the building corlib void type.
24672 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24674         * ecore.cs: fix for valuetype static readonly fields: when 
24675         initializing them, we need their address, not the address of a copy.
24677 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24679         * typemanager.cs: register also enum_type in corlib.
24681 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24683         * class.cs: allow calling this (but not base) initializers in structs.
24685 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24687         * ecore.cs: make sure we compare against the building base types
24688         in GetTypeSize ().
24690 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24692         * typemanager.cs: fix TypeToCoreType() to handle void and object
24693         (corlib gets no more typerefs after this change).
24695 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
24697         * expression.cs (ArrayCreation.EmitArrayArguments): use
24698         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24700         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24701         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
24702         array indexes, the runtime actually forbids them.
24704         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24705         for array arguments here.
24707         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24708         instead of the default for ValueTypes.
24710         (New.DoEmit): Use IsValueType instead of
24711         IsSubclassOf (value_type)
24712         (New.DoResolve): ditto.
24713         (Invocation.EmitCall): ditto.
24715         * assign.cs (Assign): ditto.
24717         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24718         Statements *are* currently doing part of their resolution during
24719         Emit.  
24721         Expressions do always resolve during resolve, but statements are
24722         only required to propagate resolution to their children.
24724 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
24726         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24728         (LoadAssembly): Do not add the dll if it is already specified
24730         (MainDriver): Add the System directory to the link path at the end,
24731         after all the other -L arguments. 
24733         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24734         wrong opcode for loading bytes and bools (ldelem.i1 instead of
24735         ldelem.u1) and using the opposite for sbytes.
24737         This fixes Digger, and we can finally run it.
24739         * driver.cs (UnixParseOption): Move the option parsing here.  
24740         (CSCParseOption): Implement CSC-like parsing of options.
24742         We now support both modes of operation, the old Unix way, and the
24743         new CSC-like way.  This should help those who wanted to make cross
24744         platform makefiles.
24746         The only thing broken is that /r:, /reference: and /lib: are not
24747         implemented, because I want to make those have the same semantics
24748         as the CSC compiler has, and kill once and for all the confussion
24749         around this.   Will be doing this tomorrow.
24751         * statement.cs (Unsafe.Resolve): The state is checked during
24752         resolve, not emit, so we have to set the flags for IsUnsfe here.
24754 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24756         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24757         not catch the Error_ObjectRefRequired in SimpleName (as it is
24758         possible to have a class/instance variable name that later gets
24759         deambiguated), we have to check this here.      
24761 2002-07-10  Ravi Pratap  <ravi@ximian.com>
24763         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24764         make static and put into Expression.
24766         (Event.Define): Register the private field of the event with the 
24767         TypeManager so that GetFieldFromEvent can get at it.
24769         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24770         keep track of the private field associated with an event which
24771         has no accessors.
24773         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24774         private field.
24776         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24778 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24780         * expression.cs (Binary.EmitBranchable): this routine emits the
24781         Binary expression in a branchable context.  This basically means:
24782         we need to branch somewhere, not just get the value on the stack.
24784         This works together with Statement.EmitBoolExpression.
24786         * statement.cs (Statement.EmitBoolExpression): Use
24787         EmitBranchable. 
24789 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
24791         * statement.cs (For): Reduce the number of jumps in loops.
24793         (For): Implement loop inversion for the For statement.
24795         (Break): We can be breaking out of a Try/Catch controlled section
24796         (foreach might have an implicit try/catch clause), so we need to
24797         use Leave instead of Br.
24799         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24800         now).  If the instace expression supports IMemoryLocation, we use
24801         the AddressOf method from the IMemoryLocation to extract the
24802         address instead of emitting the instance.
24804         This showed up with `This', as we were emitting the instance
24805         always (Emit) instead of the Address of This.  Particularly
24806         interesting when This is a value type, as we dont want the Emit
24807         effect (which was to load the object).
24809 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24811         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24813         * statement.cs (Checked): Set the CheckedState during the resolve
24814         process too, as the ConvCast operations track the checked state on
24815         the resolve process, and not emit.
24817         * cs-parser.jay (namespace_member_declaration): Flag that we have
24818         found a declaration when we do.  This is used to flag error 1529
24820         * driver.cs: Report ok when we display the help only.
24822 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24824         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24826 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24828         * cs-tokenizer.cs (define): We also have to track locally the
24829         defines.  AllDefines is just used for the Conditional Attribute,
24830         but we also need the local defines for the current source code. 
24832 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24834         * statement.cs (While, For, Do): These loops can exit through a
24835         Break statement, use this information to tell whether the
24836         statement is the last piece of code.
24838         (Break): Flag that we break.
24840         * codegen.cs (EmitContexts): New `Breaks' state variable.
24842 2002-07-03  Martin Baulig  <martin@gnome.org>
24844         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24845         modifiers in method declarations in structs.  Otherwise, you won't
24846         be able to override things like Object.Equals().
24848 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24850         * class.cs (Method, Property, Indexer): Do not allow the public
24851         modifier to be used in explicit interface implementations.
24853         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24854         override modifiers in method declarations in structs
24856 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24858         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24859         integer or real overflow, report an error
24861 2002-07-02  Martin Baulig  <martin@gnome.org>
24863         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24864         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24865         to tell the runtime about our newly created System.Object and
24866         System.ValueType types.
24868 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24870         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24871         struct instead of Ldarg/Starg.
24873 2002-07-02  Martin Baulig  <martin@gnome.org>
24875         * expression.cs (Indirection.Indirection): Call
24876         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24878 2002-07-02  Martin Baulig  <martin@gnome.org>
24880         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24881         ValueType, call TypeManager.TypeToCoreType() on it.
24882         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24883         the OpCodes.Newarr argument.
24885 2002-07-02  Martin Baulig  <martin@gnome.org>
24887         * expression.cs (Invocation.EmitCall): When compiling corlib,
24888         replace all calls to the system's System.Array type to calls to
24889         the newly created one.
24891         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24892         System.Array methods.
24893         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24894         from the system's System.Array type which must be replaced.
24896 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24898         * typemanager.cs: load unverifiable_code_ctor so we can build
24899         corlib using the correct type. Avoid using GetTypeCode() with
24900         TypeBuilders.
24901         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24902         TypeManager.object_type to allow building corlib.
24904 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24906         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24908 2002-07-01  Martin Baulig  <martin@gnome.org>
24910         * class.cs: Make the last change actually work, we need to check
24911         whether `ifaces != null' to avoid a crash.
24913 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24915         * class.cs: when we build structs without fields that implement
24916         interfaces, we need to add the interfaces separately, since there is
24917         no API to both set the size and add the interfaces at type creation
24918         time.
24920 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24922         * expression.cs: the dimension arguments to the array constructors
24923         need to be converted if they are a long.
24925 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24927         * class.cs: don't emit ldarg.0 if there is no parent constructor
24928         (fixes showstopper for corlib).
24930 2002-06-29  Martin Baulig  <martin@gnome.org>
24932         MCS now compiles corlib on GNU/Linux :-)
24934         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24935         ie. check for MethodImplOptions.InternalCall.
24937         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24938         and TypeManager.attribute_type are null, so we must explicitly check
24939         whether parent is not null to find out whether it's an attribute type.
24940         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24941         and SetBuilder, not only if the property is neither abstract nor external.
24942         This is necessary to set the MethodImplOptions on the accessor methods.
24943         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24944         SetBuilder, see Property.Emit().
24946         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24947         populate "System.Object", "System.ValueType" and "System.Attribute" since
24948         they've already been populated from BootCorlib_PopulateCoreTypes().
24950 2002-06-29  Martin Baulig  <martin@gnome.org>
24952         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24953         is the NullLiteral, we also need to make sure that target_type is not
24954         an enum type.   
24956 2002-06-29  Martin Baulig  <martin@gnome.org>
24958         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24959         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24960         before calling BootstrapCorlib_ResolveDelegate ().
24962 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24964         * statement.cs: fixed build-breaker. All tests passed ok.
24966 2002-06-27  Martin Baulig  <martin@gnome.org>
24968         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24969         for System.Decimal when compiling corlib.
24971 2002-06-27  Martin Baulig  <martin@gnome.org>
24973         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24974         switch blocks which contain nothing but a default clause.
24976 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24978        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24980 2002-06-27  Martin Baulig  <martin@gnome.org>
24982         * ecore.cs (PropertyExpr.PropertyExpr): Call
24983         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24985         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24986         is already a TypeBuilder.
24988 2002-06-27  Martin Baulig  <martin@gnome.org>
24990         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24991         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24992         the "from an array-type to System.Array" case.  This makes it work
24993         when compiling corlib.
24995 2002-06-27  Martin Baulig  <martin@gnome.org>
24997         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24998         non-static PropertyExpr, set its InstanceExpression.  This makes
24999         the `ICollection.Count' property work in System/Array.cs.
25001 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
25003         * driver.cs: Made error handling more consistent.  Errors now
25004         tracked by Report class, so many methods which used to return int
25005         now return void.  Main() now prints success/failure and 
25006         errors/warnings message.
25008         Renamed '--probe' compiler argument to '--expect-error'.  Removed
25009         the magic number return values (123 and 124).  Now, if the
25010         expected error occurs, the compiler exits with success (exit value
25011         0).  If the compilation completes without seeing that particular
25012         error, the compiler exits with failure (exit value 1).  The
25013         makefile in mcs/errors has been changed to handle the new behaviour.
25015         * report.cs: Made 'expected error' number a property and renamed
25016         it from 'Probe' to 'ExpectedError'.
25018         * genericparser.cs: Removed error handling support, since it is
25019         now all done by Report class.
25021         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
25022         class, so parse() no longer returns an int.
25024         * namespace.cs: Use Report.Error instead of GenericParser.error
25026 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
25028         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
25029         TypeContainer.AddOperator): At the front of the list put the
25030         explicit implementations, so they get resolved/defined first. 
25032 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
25034         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
25035         interface type is implemented by this TypeContainer.  Used during
25036         explicit interface implementation.
25038         (Property.Define, Indexer.Define, Method.Define): Validate that
25039         the given interface in the explicit implementation is one of the
25040         base classes for the containing type.
25042         Also if we are explicitly implementing an interface, but there is
25043         no match in the pending implementation table, report an error.
25045         (Property.Define): Only define the property if we are
25046         not explicitly implementing a property from an interface.  Use the
25047         correct name also for those properties (the same CSC uses,
25048         although that is really not needed).
25050         (Property.Emit): Do not emit attributes for explicitly implemented
25051         properties, as there is no TypeBuilder.
25053         (Indexer.Emit): ditto.
25055         Hiding then means that we do not really *implement* a pending
25056         implementation, which makes code fail.
25058 2002-06-22  Martin Baulig  <martin@gnome.org>
25060         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
25061         the return value of Object.GetType().  [FIXME: we need to do this whenever
25062         we get a type back from the reflection library].
25064 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25066         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
25068 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
25070         * attribute.cs: Return null if we can not look up the type.
25072         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
25073         the interface types found.
25075         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
25076         interface types found.
25078         * typemanager.cs (GetInterfaces): Make this routine returns alll
25079         the interfaces and work around the lame differences between
25080         System.Type and System.Reflection.Emit.TypeBuilder in the results
25081         result for GetInterfaces.
25083         (ExpandInterfaces): Given an array of interface types, expand and
25084         eliminate repeated ocurrences of an interface.  This expands in
25085         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
25086         be IA, IB, IC.
25088 2002-06-21  Martin Baulig  <martin@gnome.org>
25090         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
25091         on System.Enum.
25093 2002-06-21  Martin Baulig  <martin@gnome.org>
25095         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
25096         and called with one of the core types, return the corresponding typebuilder for
25097         that type.
25099         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
25100         element type.
25102 2002-06-21  Martin Baulig  <martin@gnome.org>
25104         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
25105         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
25106         (Expression.ConvertReferenceExplicit): Likewise.
25108         * expression.cs (ElementAccess.DoResolve): Likewise.
25109         (ElementAccess.DoResolveLValue): Likewise.
25111 2002-06-10  Martin Baulig  <martin@gnome.org>
25113         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
25114         add the "value" parameter to the parameter list.
25116         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
25117         to our caller.
25119 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
25121         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
25122         the argument to an int, uint, long or ulong, per the spec.  Also
25123         catch negative constants in array creation.
25125 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
25127         * class.cs: do not allow the same interface to appear twice in
25128         the definition list.
25130 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
25132         * ecore.cs: don't use ldlen with System.Array.
25134 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25136         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
25138 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25140         * modifiers.cs: produce correct field attributes for protected
25141         internal. Easy fix so miguel can work on ther harder stuff:-)
25143 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
25145         * pending.cs: New file.  Move the code from class.cs here.
25146         Support clearning the pending flag for all methods (when not doing
25147         explicit interface implementation).
25149 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25151         * rootcontext.cs: added a couple more types needed to bootstrap.
25153 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
25155         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
25156         constructor in the type, instead of any constructor in the type
25157         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
25158         a bug in the Mono runtime when applying the params attribute). 
25160 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
25161         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
25163 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
25165         * expression.cs (Unary.ResolveOperator): Use TypeManager
25166         to resolve the type.
25168 2002-06-13  Ravi Pratap  <ravi@ximian.com>
25170         * cs-parser.jay (enum_member_declaration): Pass in the attributes
25171         attached.
25173         * enum.cs (AddEnumMember): Add support to store the attributes associated 
25174         with each member too.
25176         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
25177         field builders too - this takes care of the enum member case.
25179 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
25181         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
25182         address-of operator on both value types and pointers.
25184 2002-06-10  Martin Baulig  <martin@gnome.org>
25186         * interface.cs (Interface.PopulateIndexer): Add the indexer's
25187         PropertyBuilder to the `property_builders' list.
25189         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
25190         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
25191         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
25192         find any indexers which are inherited from an interface.
25194 2002-06-09  Martin Baulig  <martin@gnome.org>
25196         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
25197         the same type as the constant if necessary.  There's also a test-130.cs
25198         for this.
25200         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
25202         * typemanager.cs (TypeManager.ChangeType): Previously known as
25203         Enum.ChangeEnumType().
25205 2002-06-09  Martin Baulig  <martin@gnome.org>
25207         * expression.cs (Cast.TryReduce): Added support for consts.
25209 2002-06-08  Ravi Pratap  <ravi@ximian.com>
25211         * class.cs (Accessor): Hold attributes information so we can pass
25212         it along.
25214         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
25215         Modify to pass in attributes attached to the methods.
25217         (add_accessor_declaration, remove_accessor_declaration): Ditto.
25219         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
25220         to handle the Accessor kind :-)
25222         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
25224 2002-06-08  Martin Baulig  <martin@gnome.org>
25226         * expression.cs (Unary.TryReduceNegative): Added support for
25227         ULongConstants.
25229 2002-06-08  Martin Baulig  <martin@gnome.org>
25231         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25232         name can't be found in the `defined_names' - the caller will do a
25233         MemberLookup in this case and thus find methods in System.Enum
25234         such as Enum.IsDefined().
25236 2002-06-08  Martin Baulig  <martin@gnome.org>
25238         * enum.cs (Enum.ChangeEnumType): This is a custom version of
25239         Convert.ChangeType() which works with TypeBuilder created types.
25240         (Enum.LookupEnumValue, Enum.Define): Use it here.
25242         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25243         `TypeBuilder.BaseType != null' check.
25244         (TypeContainer.FindMembers): Only lookup parent members if we
25245         actually have a parent.
25246         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25247         (ConstructorInitializer.Resolve): Likewise.
25249         * interface.cs (Interface.FindMembers): Added
25250         `TypeBuilder.BaseType != null' check.
25252         * rootcontext.cs (RootContext.ResolveCore): Added
25253         "System.Runtime.CompilerServices.IndexerNameAttribute" to
25254         classes_second_stage.
25256         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25257         debug_type and trace_type when compiling with --nostdlib.       
25259 2002-06-07  Martin Baulig  <martin@gnome.org>
25261         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25262         (AddField): Set it to true when adding a non-static field.
25263         (DefineType): Use `have_nonstatic_fields' to find out whether we
25264         have non-static fields, not `Fields != null'.
25266 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
25268         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25269         dereferencing a null on the static-field code path)
25271 2002-05-30  Martin Baulig  <martin@gnome.org>
25273         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25274         to take command line arguments.  Use reflection to call the new
25275         custom `Initialize' function on the symbol writer and pass it the
25276         command line arguments.
25278         * driver.cs (--debug-args): New command line argument to pass command
25279         line arguments to the symbol writer.
25281 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
25283         * assign.cs (DoResolve): Forgot to do the implicit conversion to
25284         the target type for indexers and properties.  Thanks to Joe for
25285         catching this.
25287 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
25289         * typemanager.cs (MethodFlags): returns the method flags
25290         (Obsolete/ShouldIgnore) that control warning emission and whether
25291         the invocation should be made, or ignored. 
25293         * expression.cs (Invocation.Emit): Remove previous hack, we should
25294         not do this on matching a base type, we should do this based on an attribute
25296         Only emit calls to System.Diagnostics.Debug and
25297         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25298         on the command line.
25300         * rootcontext.cs: Global settings for tracing and debugging.
25302         * cs-tokenizer.cs (define): New utility function to track
25303         defines.   Set the global settings for TRACE and DEBUG if found.
25305 2002-05-25  Ravi Pratap  <ravi@ximian.com>
25307         * interface.cs (Populate*): Pass in the TypeContainer as well as
25308         the DeclSpace as parameters so that we can create EmitContexts and
25309         then use that to apply attributes etc.
25311         (PopulateMethod, PopulateEvent, PopulateProperty)
25312         (PopulateIndexer): Apply attributes everywhere.
25314         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25315         etc.
25317         (ApplyAttributes): Update accordingly.
25319         We now apply interface attributes for all members too.
25321 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
25323         * class.cs (Indexer.Define); Correctly check if we are explicit
25324         implementation (instead of checking the Name for a ".", we
25325         directly look up if the InterfaceType was specified).
25327         Delay the creation of the PropertyBuilder.
25329         Only create the PropertyBuilder if we are not an explicit
25330         interface implementation.   This means that explicit interface
25331         implementation members do not participate in regular function
25332         lookups, and hence fixes another major ambiguity problem in
25333         overload resolution (that was the visible effect).
25335         (DefineMethod): Return whether we are doing an interface
25336         implementation. 
25338         * typemanager.cs: Temporary hack until we get attributes in
25339         interfaces (Ravi is working on that) and we get IndexerName
25340         support in interfaces.
25342         * interface.cs: Register the indexers as properties.
25344         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25345         warning, I have verified that this is a bug in the .NET runtime
25346         (JavaScript suffers of the same problem).
25348         * typemanager.cs (MemberLookup): When looking up members for
25349         interfaces, the parent of an interface is the implicit
25350         System.Object (so we succeed in searches of Object methods in an
25351         interface method invocation.  Example:  IEnumerable x;  x.ToString
25352         ()) 
25354 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
25356         * class.cs (Event): Events should also register if they do
25357         implement the methods that an interface requires.
25359         * typemanager.cs (MemberLookup); use the new GetInterfaces
25360         method. 
25362         (GetInterfaces): The code used to lookup interfaces for a type is
25363         used in more than one place, factor it here. 
25365         * driver.cs: Track the errors at the bottom of the file, we kept
25366         on going.
25368         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25369         instance if the method we are calling is static!
25371 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
25373         * attribute.cs (ApplyAttributes): Make this function filter out
25374         the IndexerName attribute (as that attribute in reality is never
25375         applied) and return the string constant for the IndexerName
25376         attribute. 
25378         * class.cs (TypeContainer.Emit): Validate that all the indexers
25379         have the same IndexerName attribute, and if so, set the
25380         DefaultName attribute on the class. 
25382         * typemanager.cs: The return value might contain other stuff (not
25383         only methods).  For instance, consider a method with an "Item"
25384         property and an Item method.
25386         * class.cs: If there is a problem with the parameter types,
25387         return. 
25389 2002-05-24  Ravi Pratap  <ravi@ximian.com>
25391         * ecore.cs (ImplicitConversionExists): Wrapper function which also
25392         looks at user defined conversion after making a call to 
25393         StandardConversionExists - we need this for overload resolution.
25395         * expression.cs : Update accordingly the various method calls.
25397         This fixes 2 bugs filed against implicit user defined conversions 
25399 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
25401         * statement.cs: Track the result of the assignment.
25403 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
25405         * expression.cs (MemberAccess): Improved error reporting for
25406         inaccessible members.
25408 2002-05-22  Martin Baulig  <martin@gnome.org>
25410         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
25411         itself with debugging support.
25413 2002-05-22  Martin Baulig  <martin@gnome.org>
25415         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25416         Removed, this isn't needed anymore.
25418 2002-05-20  Martin Baulig  <martin@gnome.org>
25420         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25421         be underlying type for an enum.
25423 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
25425         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25426         that splits out the loading of just the core types.
25428         * rootcontext.cs (ResolveCore): Split the struct resolution in
25429         two, so we can load the enumeration underlying types before any
25430         enums are used.
25432         * expression.cs (Is): Bandaid until we fix properly Switch (see
25433         bug #24985 for details).
25435         * typemanager.cs (ImplementsInterface): The hashtable will contain
25436         a null if there are no interfaces implemented.
25438 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
25440         * cs-parser.jay (indexer_declarator): It is fine to have array
25441         parameters
25443 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25445         * typemanager.cs: (RegisterBuilder): New function used to register
25446         TypeBuilders that implement interfaces.  Since
25447         TypeBuilder.GetInterfaces (as usual) does not work with lame
25448         Reflection.Emit. 
25449         (AddUserType): register interfaces.
25451         (ImplementsInterface): Use the builder_to_ifaces hash if we are
25452         dealing with TypeBuilder.  Also, arrays are showing up as
25453         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25454         methods can not be invoked on them!
25456         * ecore.cs (ExplicitReferenceConversionExists): Made public.
25457         (ImplicitReferenceConversionExists): Split out from
25458         StandardConversionExists. 
25460         * expression.cs (As): We were only implementing one of the three
25461         cases for the as operator.  We now implement them all.
25462         (Is): Implement the various other cases for Is as well.
25464         * typemanager.cs (CACHE): New define used to control if we want or
25465         not the FindMembers cache.  Seems to have a negative impact on
25466         performance currently
25468         (MemberLookup): Nested types have full acess to
25469         enclosing type members
25471         Remove code that coped with instance/static returns for events, we
25472         now catch this in RealFindMembers.
25474         (RealFindMembers): only perform static lookup if the instance
25475         lookup did not return a type or an event.  
25477 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25479         * assign.cs (CompoundAssign): We pass more semantic information
25480         now to Compound Assignments than we did before: now we have all
25481         the information at hand, and now we resolve the target *before* we
25482         do the expression expansion, which allows the "CacheValue" method
25483         to have the effect we intended (before, a [x] += 1 would generate
25484         two differen ArrayAccess expressions from the ElementAccess,
25485         during the resolution process).
25487         (CompoundAssign.DoResolve): Resolve target and original_source here.
25489 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
25491         * expression.cs (ArrayAccess): dropped debugging information. 
25493         * typemanager.cs: Small bug fix: I was always returning i_members,
25494         instead of one of i_members or s_members (depending on which had
25495         the content).
25497         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
25498         method is invoked before any code generation takes place, and it
25499         is a mechanism to inform that the expression will be invoked more
25500         than once, and that the method should use temporary values to
25501         avoid having side effects
25503         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25505         * ecore.cs (Expression.CacheTemporaries): Provide empty default
25506         implementation.
25508         * expression.cs (Indirection, ArrayAccess): Add support for
25509         CacheTemporaries in these two bad boys. 
25511         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25512         ldobj or ldind_ref.  
25513         (StoreFromPtr): Handle stobj as well.
25515         * expression.cs (UnaryMutator): Share more code.
25517         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25518         down: I was not tracking the Filter function as well, which
25519         was affecting the results of the cache.
25521 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
25523         * attribute.cs: Remove the hack to handle the CharSet property on
25524         StructLayouts. 
25526 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
25528         * attribute.cs (DoResolve): More uglyness, we now only try to
25529         resolve the attribute partially, to extract the CharSet
25530         information (only if we are a StructLayout attribute).  Otherwise 
25532         (GetExtraTypeInfo): Add some code to conditionally kill in the
25533         future this.   I am more and more convinced that the .NET
25534         framework has special code to handle the attribute setting on
25535         certain elements.
25537         * expression.cs (IsParamsMethodApplicable): Revert my previous
25538         foreach change here, it was wrong.
25540 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
25542         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25543         (pp_expr): do not abort on unknown input, just return.
25544         (eval): abort if there are pending chars.
25546         * attribute.cs (Attribute.Resolve): Positional parameters are
25547         optional.  Deal with that case.
25549         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25550         the Ansi/Unicode/Auto information for the type.
25552         (TypeContainer.DefineType): instantiate the EmitContext here, as
25553         we will be using it during the type definition (to resolve
25554         attributes) and during the emit phase.
25556         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25557         to pull type information out of the attributes
25559         (Attribute.Resolve): track the constructor builder, and allow for
25560         multiple invocations (structs and classes will use this).
25562         * ecore.cs (MemberLookupFinal): new version with all the
25563         parameters customizable.
25565         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25566         constructors.  Return if the result value is null (as the error
25567         would have been flagged already by MemberLookupFinal)
25569         Do not allow instances of abstract classes or interfaces to be
25570         created.
25572         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25573         We have to compare the assembly property here when dealing with
25574         FamANDAssem and Assembly access modifiers, because we might be
25575         creating an assembly from *modules* (that means that we are not
25576         getting TypeBuilders for types defined in other modules that are
25577         part of this assembly).
25579         (Method.Emit): If the method is marked abstract and has a body,
25580         emit an error. 
25582         (TypeContainer.DefineMembers): If both the defined member and the
25583         parent name match are methods, then do not emit any warnings: let
25584         the Method.Define routine take care of flagging warnings.  But if
25585         there is a mismatch (method overrides something else, or method is
25586         overriwritten by something, then emit warning).
25588         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25589         set to null, this means `do not check for the return type on the
25590         signature'. 
25592         (Method.Define): set the return type for the method signature to
25593         null, so that we get methods with the same name and parameters and
25594         different return types.  This is used to flag warning 114 (you are
25595         hiding a method, and you probably want to use the new/override
25596         keywords instead).
25598         * typemanager.cs (MemberLookup): Implemented proper access
25599         control, closing a long standing set of bug reports.  The problem
25600         was that the Framework only has two bits: Public and NonPublic,
25601         and NonPublic includes private and protected methods, but we need
25602         to enforce the FamANDAssem, FamOrAssem and Family. 
25604 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
25606         * statement.cs (GotoCase): Return true: Ammounts to giving up
25607         knowledge on whether we return or not, and letting the other case
25608         be responsible for it.
25610 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
25612         * driver.cs: Do not load directories for each file processed, only
25613         do it if there is a pattern.
25615         * ecore.cs: Report readonly assigns here as well, as we might have
25616         been resolved only by MemberAccess.
25618         (SimpleName.SimpleNameResolve): Also be useful for LValue
25619         resolution.   We need this to propagate assign to local readonly variables
25621         * typemanager.cs: Use a ptrhashtable for the criteria, because we
25622         do not want to reuse potential criteria memory.
25624         * class.cs (MyEventBuilder): Set reflected_type;
25626         * ecore.cs (Constantify): Added support for constifying bools.
25628         (RootContext.LookupType): Added a cache for values looked up in
25629         the declaration space.
25631         * typemanager.cs (FindMembers): Now is a front-end to
25632         RealFindMembers, and provides a two-level hashtable-based cache to
25633         the request.  
25635         15% performance improvement: from 22.5 to 19.2 seconds.
25637         * expression.cs (IsParamsMethodApplicable): use foreach.
25638         (Invocation.DoResolve): ditto.
25639         (New.DoResolve): ditto.
25640         (ArrayCreation.DoResolve): ditto.
25642         * ecore.cs (FindMostEncompassingType): use foreach.
25644         * delegate.cs (NewDelegate.DoResolve): Use foreach
25646         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25647         (RemoveMethods): use foreach.
25649         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25650         nested foreach statements instead of for, and also break out of
25651         the inner loop once a match is found.
25653         (Invocation.OverloadResolve): Use foreach, simplify the code. 
25655 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
25657         * cfold.cs (BinaryFold): During an enumeration evaluation context,
25658         we actually unwrap the expression to allow for extra information
25659         to be extracted. 
25661         * expression.cs: Use Shr_Un on unsigned operations. 
25663 2002-05-08  Ravi Pratap  <ravi@ximian.com>
25665         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
25666         applicable operators was not being considered correctly. This closes
25667         the bug Miguel reported.
25669 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25671         * attribute.cs: check that the type derives from System.Attribute
25672         and report the correct error in that case (moved the duplicate code to
25673         its own method, too).
25675 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25677         * attribute.cs: lookup attribute type name as the spec says: first the
25678         bare attribute name and then name + "Attribute" (nant compiles with
25679         mcs after this fix).
25681 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
25683         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
25684         Because of the way we parse things, we should try to see if a
25685         UIntConstant can fit in an integer.
25687 2002-05-07  Ravi Pratap  <ravi@ximian.com>
25689         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25690         when we are in an explicit context.
25692         (ConvertReferenceExplicit): When converting from Iface type S to Class
25693         T make sure the rules are implemented as an OR.
25695         * parameter.cs (ParameterType): Make it a property for now although the
25696         purpose really isn't anything immediate.
25698         * expression.cs (Is*Applicable): Do better checking on the parameter type
25699         of a ref/out parameter. The ones from the system assemblies are already 
25700         marked with the correct type so we don't need to do any correction.
25702         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
25703         the object type is standard too so include that.
25705 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25707         * ecore.cs (StandardConversionExists): Augment with missing code:
25708         deal with IntConstant, LongConstants and Enumerations.
25710         * assign.cs: Report the error, instead of failing silently
25712         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25713         typecontainer that they are declared, because the
25714         typecontainer/namespace will have the list of using clauses that
25715         need to be applied.
25717         Assembly Attributes were escaping the normal registration
25718         mechanism. 
25720         (EmitCode): Apply attributes within an EmitContext that represents
25721         the container they were declared on.
25723         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
25725 2002-05-06  Ravi Pratap  <ravi@ximian.com>
25727         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25728         Revamp completely - make much cleaner as we now operate only
25729         on a set of Types.
25731         (FindMostSpecificSource, FindMostSpecificTarget): New methods
25732         to implement the logic detailed in the spec more correctly.
25734         (UserDefinedConversion): Update accordingly.
25736 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25738         * statement.cs: Return flow analysis information up.
25740         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25741         and the default.
25743         (token): Do not consume an extra character before calling
25744         decimal_digits.
25746 2002-05-06  Piers Haken <piersh@friskit.com>
25748         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25750 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25752         * class.cs (Constructor.Emit): Set the IsStatic flag in the
25753         EmitContext during the instance constructor initializer
25754         resolution, to stop access to instance variables.
25756         This is mandated by the spec, last paragraph of the `constructor
25757         initializers' section. 
25759 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
25761         * cs-parser.jay, class.cs (Accessor): new class used to represent
25762         an accessor (get or set).  In the past we used `null' to represent
25763         a missing accessor.  But this is ambiguous because there was no
25764         way to tell in abstract indexers/properties if one of them was
25765         specified.
25767         Now there is a way of addressing that.
25769         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25770         instead of FindMembers.
25772         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25773         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25775         * attribute.cs: Treat indexers and properties as the same in terms
25776         of applying attributes
25778         * ecore.cs (FindMostEncompassedType): Use statically initialized
25779         EmptyExpressions()s like we do elsewhere to avoid creating useless
25780         objects (and we take this out of the tight loop).
25782         (GetConversionOperators): Move the code to extract the actual
25783         operators to a separate routine to clean things up.
25785 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
25787         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25788         events are always registered FieldBuilders.
25790         * class.cs (FieldBase): New class shared by Fields 
25792         * delegate.cs: If we are a toplevel delegate, use our full name.
25793         If we are a nested delegate, then only use our tail name.
25795 2002-05-02  Ravi Pratap  <ravi@ximian.com>
25797         * expression.cs (IsApplicable): Ensure that we add the "&" to
25798         ref/out types before comparing it with the type of the argument.
25800         (IsParamsMethodApplicable): Ditto.
25802         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
25803         silly me ;-)
25805         * delegate.cs : Handle the case when we have more than one applicable
25806         method. Flag an error only when we finish checking all.
25808 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25810         * expression.cs: Add support for boolean static initializers.
25812 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25814         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25816         * parameter.cs (ComputeParameterTypes,
25817         ComputeAndDefineParameterTypes): Better error handling: now we
25818         clear the `types' cache if we fail during any of the type lookups.
25819         We also return the status code correctly to our caller
25821         * delegate.cs: If we fail to define a delegate, abort the extra
25822         steps. 
25824         * expression.cs (Binary.ResolveOperator): for
25825         operator==(object,object) and operator !=(object, object) we also
25826         have to verify that there is an implicit conversion from one to
25827         the other.
25829         (ArrayAccess.DoResolve): Array Access can operate on
25830         non-variables. 
25832 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25834         * assign.cs (CompoundAssign): A new class used as a "flag" that
25835         the assignment actually is happening as part of a compound
25836         assignment operator.
25838         During compound assignment, a few new rules exist to enable things
25839         like:
25841         byte b |= 1 + 2
25843         From the spec:
25845         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25846         to the type of x) if y is implicitly convertible to the type of x,
25847         and the operator is a builtin operator and the return type of the
25848         operator is explicitly convertible to the type of x. 
25850         * rootcontext.cs: Reset warning level to 2.  4 catches various
25851         "interesting" features in mcs, we must clean this up at some
25852         point, but currently am trying to kill other bugs ;-)
25854         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25855         in container classes as well.  
25857         * expression.cs (Binary.ResolveOperator): Handle string case
25858         before anything else (as operator overloading does emit an error
25859         before doing anything else).
25861         This code could go away when we move to a table driven model, but
25862         i could not come up with a good plan last night.
25864 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25866         * typemanager.cs (CSharpName): reimplementation using regex.
25867         * class.cs: added null check for fields in Emit
25868         * rootcontext.cs: set warninglevel to 4
25870 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25872         * typemanager.cs (CSharpName): reimplemented with Lupus
25873         suggestion.
25875 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25877         * statement.cs (If): correclty implement Resolve, because we were
25878         not catching sem errors in there.  The same process is needed
25879         everywhere else. 
25880         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25883         (Statement.Warning_DeadCodeFound): Factorize code.
25884         (While): Report dead code here too.
25886         (Statement): Added Resolve virtual method to allow
25887         for resolution split from the emit code.
25889 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25891         * statement.cs (EmitBoolExpression): No longer try to resolve the
25892         expression here.    
25893         (MakeBoolean): New utility function that resolve, implicitly
25894         converts to boolean and tags the expression. 
25897         (If, Do): Implement dead code elimination.
25898         (While): Implement loop inversion
25900         (Do, While, For, If): Resolve the expression prior to calling our
25901         code generation.
25903 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25905         * class.cs:
25906           - added method Report28 (warning: program has more than one entry point)
25907           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25908           - modified method Method.Define, the part at the end of the method
25910         * rootcontext.cs: added static public Location EntryPointLocation;
25911           
25912         * ../errors/cs0028.cs : Add test case for the above warning.              
25914         * typemanager.cs:
25915           - modified method CSharpName to allow arrays of primitive type to
25916             be printed nicely (e.g. instead of System.Int32[][] it now prints
25917             int[][])
25918           - added method CSharpSignature: returns the signature of a method
25919             in string format to be used in reporting errors, warnings, etc.
25921         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25922         with String.Empty.
25924 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25926         * delegate.cs (Define): Fix extremely silly bug where I was
25927         setting the type of the 'object' parameter of the BeginInvoke
25928         method to System.IAsyncResult instead of System.Object ;-)
25930 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25932         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25933         here. 
25935         (Constructor.Emit): return if we fail to initialize the
25936         constructor.  Another door closed!  
25938         * expression.cs (New.DoResolve): Improve error message (from -6 to
25939         1501).  Use DeclaredOnly lookup to find the exact constructor.
25941         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25942         loop.  This is useful.
25944         * cs-parser.jay: Adjust the default parameters so that destructors
25945         have the proper signature.
25947 2002-04-26  Martin Baulig  <martin@gnome.org>
25949         * driver.cs (LoadAssembly): If `assembly' contains any characters
25950         which are only valid in path names and not in assembly names
25951         (currently slash, backslash and point), use Assembly.LoadFrom ()
25952         instead of Assembly.Load () on the `assembly' (before iteration
25953         over the link_paths).
25955 2002-04-26  Martin Baulig  <martin@gnome.org>
25957         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25959 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25961         * class.cs (Property): use the new typemanager.MemberLookup
25963         (TypeContainer.MemberLookup): Implement using the
25964         TypeManager.MemberLookup now. 
25966         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25967         and return MemberInfos, so that these can be used without an
25968         EmitContext (what we had before).
25970 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25972         * expression.cs: Fix the case where the argument to params if the
25973         type of the params.  I omitted handling this before.   Fixed
25975 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25977         * driver.cs: Call BootCorlib_PopulateCoreType
25979         * class.cs (Property.CheckBase): Check for properties only, not
25980         for all members. 
25982         * interface.cs: Temporary hack: try/catch around the
25983         CustomAttributeBuilder, because I am getting an exception that I
25984         do not understand.
25986         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25987         types whose definitions are required to be there (attributes are
25988         defined before standard types).
25990         Compute definitions as we boot the various types, as they are used
25991         immediately (value_type class will need object_type, but if we do
25992         not initialize object_type, we will pass a null, which will let
25993         the runtime pick the System.Object from the existing corlib, which
25994         is not what we want).
25996 2002-04-22  Patrik Torstensson <totte@labs2.com>
25998         * cs-tokenizer.cs: fixed a number of trim() issues.
26000 2002-04-22  Ravi Pratap  <ravi@ximian.com>
26002         * expression.cs (Argument.Type): Ensure that we return the correct
26003         type when we have out or ref parameters [in which case we 
26004         append a "&"].
26006 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
26008         * class.cs (Property, Indexer): Allow extern modifier in there. 
26010         * typemanager.cs (InitBaseTypes): Initializes object_type and
26011         value_type, since those will be used early on during the bootstrap
26012         process to compile corlib.
26014         (InitCoreTypes): Move code from here to InitBaseTypes.
26016 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
26018         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
26019         single-dimension arrays as using the ldlen opcode.  
26021         Daniel Lewis discovered this optimization.  
26023         * typemanager.cs: Add signature for System.Array::get_Length
26025 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26027         * statement.cs: report the error when the foreach does not apply to an
26028         array nor a collection.
26030 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
26032         * expression.cs: Add implicit conversions to the operator ~.
26034         * constant.cs (DecimalConstant.Emit): Emit decimal value.
26036         * typemanager.cs: Locate the decimal constructor.
26038 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26040         * attribute.cs: use the new property of TypeOf.
26041         * expression.cs: added 'get' property around typearg.
26043         These changes fix a build breaker reported by NickD. Is this the
26044         correct way to fix?  If not, please, revert my changes and make it
26045         work :-).
26047 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
26049         * attribute.cs: Add support for typeof in attribute invocations.
26050         I am not sure that this is right though.
26052 2002-04-14  Duncan Mak  <duncan@ximian.com>
26054         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
26055         Binary.Operator.Division case.
26057 2002-04-13  Ravi Pratap  <ravi@ximian.com>
26059         * class.cs (DefineType): Ensure that we do a proper check on
26060         attribute types and also register it with the TypeManager.
26062         (TypeContainer.Targets): The default for attribute types is
26063         AttributeTargets.All.
26065         * attribute.cs (ApplyAttributes): Registering the attribute type
26066         is done elsewhere, not when we discover we have a Usage attribute.
26068 2002-04-12  Ravi Pratap  <ravi@ximian.com>
26070         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
26071         and get rid of is_delegate parameter.
26073         * everywhere : update.
26075 2002-04-12  Ravi Pratap  <ravi@ximian.com>
26077         * cs-parser.jay (compilation_unit): Revamp completely to use
26078         some new ideas that I got from Rhys' grammar to solve the problems
26079         with assembly level attributes.
26081         (outer_declaration): New grammar production.
26083         (attribute_sections): Add.
26085         (opt_attributes): Base on attribute_sections
26087         (namespace_declaration): Allow opt_attributes to tackle the case
26088         when we have assembly level attributes - we are clever in this
26089         regard now ;-)
26091         * attribute.cs (ApplyAttributes): Do not worry about assembly 
26092         attributes in the non-global context.
26094         * rootcontext.cs (AddGlobalAttributes): Go back to using this
26095         instead of SetGlobalAttributes.
26097         * class.cs, rootcontext.cs : Ensure we define and generate 
26098         attribute types before anything else.
26100         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
26101         and flag the new error -20 for the case when the attribute type
26102         does not have valid targets specified. csc does not catch this.
26104         * ../errors/errors.txt : update for error # -20
26106 2002-04-11  Ravi Pratap  <ravi@ximian.com>
26108         * support.cs (InternalParameters.ParameterModifier): Do some null
26109         checking and return sane values.
26111         * class.cs (Method.Define): If we are a PInvoke method, ensure
26112         that we are static and extern. Report error # 601
26114         * ../errors/cs0601.cs : Add test case for the above error.
26116 2002-04-07  Ravi Pratap  <ravi@ximian.com>
26118         * rootcontext.cs (attribute_types): We need to keep type of
26119         all attribute types separately and emit code for them first.
26121         (RegisterAttribute) : Implement.
26123         * class.cs (DefineType): Check if the current Type is a custom
26124         attribute type and register it accordingly.
26126         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
26127         adding the first attribute twice and rename to
26129         (SetGlobalAttributes): this.
26131         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
26132         lookups.
26134         * attribute.cs (ApplyAttributes): Take an additional argument telling us
26135         if we are processing global arguments. Hmm, I am unsure of this.
26137 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26139         * expression.cs: added static array of strings to avoid calling
26140         Enum.ToString () for Operator in Binary. Significant recover of
26141         performance.
26143 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
26145         * class.cs (FindMembers): Allow the Builders of the various
26146         members to be null.  If they are skip them.  This only happens
26147         during the PInvoke declaration.
26149 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
26151         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
26152         failure, so we do not keep going afterwards.
26154         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
26155         wanted to pass `false' as the `is_delegate' argument.  If this is
26156         the case, why not use delegate_type == null to mean `is_delegate =
26157         false' and anything else as is_delegate = true.
26159 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
26161         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
26162         code for the section, not the beginning of the tests.
26164 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
26166         * cfold.cs: Handle operator + (Enum x, Underlying x) 
26168         * expression.cs (Binary): same.  Warn about errors where we have
26169         Enum/Enum in operator + as well.
26171 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
26173         * statement.cs:
26174                 - added support for switch(bool)
26175                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
26176                 - add TableSwitchEmit() to handle table-based switch statements
26178 2002-04-05  Ravi Pratap  <ravi@ximian.com>
26180         * expression.cs (Invocation.OverloadResolve): Factor out code which
26181         does parameter compatibility checking with arguments so that we can 
26182         re-use the code even from Delegate.VerifyApplicability
26184         (VerifyArgumentsCompat): Move above code here.
26186         * delegate.cs (VerifyApplicability): Get rid of duplicate code
26187         and instead make a call to the above method.
26189 2002-03-31  Ravi Pratap  <ravi@ximian.com>
26191         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
26192         We use it to keep track of classes which are attribute types.
26194 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
26196         * delegate.cs (Delegate.Define): Correctly define the types in the
26197         presence of fixed and array parameters.
26199         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
26200         doing FindMembers.
26202         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
26203         include NonPublic after the first iteration.
26205         * class.cs (Indexer.CheckBase): Only check if both parents are
26206         non-null. 
26208         * cs-parser.jay (accessor_body): If empty, set to null.
26210         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
26211         same code path here to resolve constants names that we did have in
26212         MemberAccess.DoResolve.  There is too much code duplicated here.
26214 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
26216         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
26218         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
26219         to MakeUnionSet.
26221         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
26222         tokens, numbers and strings.
26224         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26225         parenthesis.
26227         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26228         asyncronous parameters and the regular parameters.  
26230         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26231         specify the target directory.
26233         * expression.cs: (This.DoResolve): Simplify
26234         (As.Emit): Optimize, do not generate IsInst if the expression is
26235         always of the given type.
26237         (Is.DoResolve): Bug fix, we were reporting both always/never for
26238         the is expression.
26240         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26241         creating too many unnecessary arrays.
26243 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
26245         * class.cs (EmitFieldInitializer): Use Assign expression to assign
26246         fields instead of rolling our own initializer.   Takes care of all
26247         implicit conversions, and drops unnecessary static checks/argument.
26249 2002-03-31  Dick Porter  <dick@ximian.com>
26251         * driver.cs: use the GetDirectories() return values properly, and
26252         use "/" as path separator.
26254 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
26256         * expression.cs (Unary): Optimize - - expr into expr.
26257         (Binary): Optimize a + (-b) into a -b.
26259         * codegen.cs (CodeGen): Made all methods static.
26261 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
26263         * rootcontext.cs: 
26265         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26266         TypeBuilder property.
26268         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26269         instead. 
26271         * tree.cs: Removed the various RecordXXXX, and replaced with a
26272         single RecordDecl.  Removed all the accessor methods, and just
26273         left a single access point Type 
26275         * enum.cs: Rename DefineEnum to DefineType.
26277         * decl.cs: New abstract method `DefineType' used to unify the
26278         Defines for Enumerations, Interfaces, TypeContainers and
26279         Delegates.
26281         (FindType): Moved LookupInterfaceOrClass here.  Moved the
26282         LookupBaseClasses method that used to live in class.cs and
26283         interface.cs here, and renamed to FindType.
26285         * delegate.cs: Implement DefineType.  Take advantage of the
26286         refactored pattern for locating the parent builder without taking
26287         the parent_builder argument (which we know does not work if we are
26288         nested, and triggering a toplevel definition).
26290 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26292         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26293         accessibility of a member has changed during override and report
26294         an error if so.
26296         * class.cs (Method.Define, Property.Define): Only complain on
26297         overrides if the method is private, any other accessibility is
26298         fine (and since we just checked the permission is the same, we are
26299         good to go).
26301         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26302         and elif are processed always.  The other pre-processing
26303         directives are only processed if we are "taking" the path
26305 2002-03-29  Martin Baulig  <martin@gnome.org>
26307         * class.cs (Method.Emit): Only emit symbolic debugging info if the
26308         current location is not Null.
26310         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26311         a separate method so we can profile it.
26313         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26314         `span.Seconds' are just seconds, but no minutes or hours.
26315         (MainDriver): Profile the CodeGen.SaveSymbols calls.
26317 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26319         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26320         Remove the gratuitous set of Final:
26322                                 // If an interface implementation, then we can set Final.
26323                                 if (((flags & MethodAttributes.Abstract) == 0) &&
26324                                     implementing.DeclaringType.IsInterface)
26325                                         flags |= MethodAttributes.Final;
26327         I do not know what I was smoking when I used that.
26330         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26331         step into fixing the name resolution issues for delegates and
26332         unifying the toplevel name resolution.
26334 2002-03-28  Martin Baulig  <martin@gnome.org>
26336         * class.cs (Method.Emit): If we have a symbol writer, call its
26337         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26338         tell it about the current method.
26340         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26341         writer that we're going to emit the first byte of IL code for a new
26342         statement (a new source line).
26343         (EmitContext.EmitTopBlock): If we have a symbol writer, call
26344         EmitContext.Mark() before emitting any code.
26346         * location.cs (SymbolDocument): Return null when we're Null.
26348         * statement.cs (Statement): Moved the `Location loc' variable here.
26349         (Statement.EmitBoolExpression): If we have a symbol writer, call
26350         ec.Mark() before emitting any code to tell it that we're at the
26351         beginning of a new statement.
26352         (StatementExpression): Added `Location' argument to the constructor.
26353         (Block): Added public readonly variable `StartLocation' and public
26354         variable `EndLocation'.  The latter is to be set using SetEndLocation().
26355         (Block): Added constructor which takes a start and end location.
26356         (Block.SetEndLocation): New method. This sets the end location.
26357         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26358         local variables we create.
26359         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26360         each statement and do also mark the begin and end of the block.
26362         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26363         tell it the current lexer.Location, use Location.Null for the end of the
26364         block.
26365         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26366         current block, set its end location using SetEndLocation().
26367         (statement_expression): StatementExpression constructor now takes the
26368         lexer.Location as additional argument.
26369         (for_statement, declare_local_variables): Likewise.
26370         (declare_local_variables): When creating a new implicit block, use the
26371         new Block constructor and pass it the lexer.Location.
26373 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26375         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26376         members also on the parent interfaces recursively.
26378 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
26380         * report.cs: Use new formats, since Gonzalo finished the missing
26381         bits. 
26383         * expression.cs (Binary.ResolveOperator): added missing operator|
26384         operator& and operator^ for bool/bool.
26386         * cs-parser.jay: CheckDef now takes a Location argument that is
26387         used to report errors more precisly (instead of reporting the end
26388         of a definition, we try to track something which is a lot closer
26389         to the source of the problem).
26391         * cs-tokenizer.cs: Track global token use, so we can properly flag
26392         the use of #define/#undef after the first token has been seen.
26394         Also, rename the reportXXXX to Error_DescriptiveName
26396         * decl.cs (DeclSpace.IsTopLevel): Move property here from
26397         TypeContainer, so that Enum and Interface can use this too.
26399         * class.cs (TypeContainer.LookupInterfaceOrClass,
26400         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26401         `builder' argument.  Typically this was used to pass the parent
26402         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26403         the definition).  
26405         The problem is that a nested class could trigger the definition of
26406         a toplevel class, and the builder would be obviously wrong in that
26407         case. 
26409         So we drop this argument, and we compute dynamically the
26410         TypeBuilder/ModuleBuilder (the correct information was available
26411         to us anyways from DeclSpace.Parent)
26413         * interface.cs (Interface.DefineInterface): Drop builder
26414         parameter cleanup like class.cs
26416         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
26417         like class.cs
26419         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26420         values. 
26422         (Try.Emit): Propagate the returns value from the statement.
26424         (Return.Emit): Even if we are leavning 
26426         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26428         * modifiers.cs: Fix the computation of MethodAttributes flags.
26430 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26432         * driver.cs: allow compilation of files that start with '/'.
26433         Add a default case when checking the argument of --target.
26435 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
26437         * interface.cs: Implement the same search algorithm for types in
26438         the interface code.
26440         * delegate.cs: Do not allow multiple definition.
26442         * Recovered ChangeLog that got accidentally amputated
26444         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26446         * rootcontext.cs: Load manually enum to allow core classes to
26447         contain enumerations.
26449         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26450         Update to new static methods in TypeManager.
26452         * typemanager.cs (GetMethod, GetConstructor): Use our
26453         implementation of FindMembers to find the members, since during
26454         corlib compilation, the types are TypeBuilders and GetMethod and
26455         GetConstructor do not work.
26457         Make all methods in TypeManager static.
26459         (InitCodeHelpers): Split the functionality from
26460         the InitCodeTypes function.
26462         * driver.cs: Call InitCodeHelpers after we have populated the
26463         types. 
26465         * cs-parser.jay (delegate_declaration): we did not used to compute
26466         the delegate name correctly for void delegates.
26468 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
26470         * rootcontext.cs (RootContext): Init the interface_resolve_order
26471         and type_container_resolve_order always.
26473         (ResolveCore, BootstrapCorlib_ResolveClass,
26474         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26475         compiler when compiling with --nostdlib
26477         * class.cs (TypeContainer.DefineType): Check that our parent is
26478         not null.  This test is most important when we are bootstraping
26479         the core types.
26481         * codegen.cs: Split out the symbol writing code.
26483 2002-03-25  Martin Baulig  <martin@gnome.org>
26485         * driver.cs (-g): Made -g an alias for --debug.
26487 2002-03-24  Martin Baulig  <martin@gnome.org>
26489         * codegen.cs (SymbolWriter): New public variable. Returns the
26490         current symbol writer.
26491         (CodeGen): Added `bool want_debugging_support' argument to the
26492          constructor. If true, tell the ModuleBuild that we want debugging
26493         support and ask it for the ISymbolWriter.
26494         (Save): If we have a symbol writer, call it's Close() method after
26495         saving the assembly.
26497         * driver.c (--debug): New command line argument to create a
26498         debugger information file.
26500         * location.cs (SymbolDocument): New public property. Returns an
26501         ISymbolDocumentWriter object for the current source file or null
26502         if we don't have a symbol writer.
26504 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
26506         * driver.cs (LoadAssembly): Correctly return when all the paths
26507         have been tried and not before.
26509         * statement.cs (Switch.Emit): return the actual coverage for this
26510         statement (returns/not-returns)
26512         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26513         switch of the statement if we are the last switch section.  That
26514         kills two problems: try/catch problems (we used to emit an empty
26515         nop at the end) and switch statements where all branches would
26516         return. 
26518 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
26520         * driver.cs: Add default assemblies (the equivalent to the
26521         Microsoft CSC.RSP file)
26523         * cs-tokenizer.cs: When updating `cols and setting it to zero,
26524         also update tokens_seen and set it to false.
26526         * driver.cs: Implement --recurse for Mike.
26528         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26529         correctly splitting out the paths.
26531 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
26533         * interface.cs (Interface.PopulateProperty): Instead of using
26534         `parent' as the declaration space for the set parameters, use
26535         `this' 
26537         * support.cs (InternalParameters): InternalParameters constructor
26538         takes a DeclSpace instead of a TypeContainer.
26540         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26541         types are being initialized, load the address of it before calling
26542         the function.  
26544         (New): Provide a mechanism to disable the generation of local
26545         value type temporaries when the caller will be providing us with
26546         an address to store it.
26548         (ArrayCreation.EmitDynamicInitializers): Use it.
26550 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
26552         * expression.cs (Invocation.EmitArguments): Only probe for array
26553         property if there is more than one argument.  Sorry about that.
26555         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26556         empty param arrays.
26558         * class.cs (Method.LabelParameters): Fix incorrect code path that
26559         prevented the `ParamArrayAttribute' from being applied to the
26560         params attribute.
26562 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
26564         * support.cs (ReflectionParameters): Correctly compute whether the
26565         last argument is a params array.  Fixes the problem with
26566         string.Split ('a')
26568         * typemanager.cs: Make the assemblies array always be non-null
26569         (empty, but non-null)
26571         * tree.cs (RecordDecl): New function that abstracts the recording
26572         of names.  This reports error 101, and provides a pointer to the
26573         previous declaration.  Fixes a crash in the compiler.
26575         * cs-parser.jay (constructor_declaration): Update to new grammar,
26576         and provide a constructor_body that can be empty.
26578 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
26580         * driver.cs: Add support for --resources.
26582         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26583         Make all types for the various array helper methods be integer.
26585         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26586         CheckState to ConvCast.
26588         (ConvCast): Now it takes a `checked' state argument, to avoid
26589         depending on the emit context for the conversion, and just using
26590         the resolve time setting.
26592         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26593         instead of Invocation.EmitArguments.  We do not emit the original
26594         arguments, instead we emit those which have been converted to
26595         unsigned int expressions.
26597         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26599         * codegen.cs: ditto.
26601         * expression.cs (LocalVariableReference): Drop the use of the
26602         Store function that depended on the variable index.
26604         * statement.cs (VariableInfo): Drop the `Idx' property from this
26605         class, as this is not taking into account the indexes for
26606         temporaries tat we generate during the execution, getting the
26607         indexes wrong.
26609         * class.cs: First emit class initializers, then call the parent
26610         constructor. 
26612         * expression.cs (Binary): Fix opcode emision.
26613         (UnaryMutator.EmitCode): Support checked code generation
26615         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26616         matches for events for both the Static and Instance scans,
26617         pointing to the same element.   Fix that.
26619 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
26621         * rootcontext.cs (ResolveTree): Always set the
26622         interface_resolve_order, because nested interfaces will be calling
26623         into us.
26625         * class.cs (GetInterfaceOrClass): Track the same resolution
26626         process used by TypeManager.LookupType.  This fixes the nested
26627         type lookups in class declarations (separate path from
26628         LookupType). 
26630         (TypeContainer.DefineType): Also define nested interfaces.
26631         (TypeContainer.RegisterOrder): New public function used to
26632         register the order in which child interfaces need to be closed.
26634         Nested interfaces need to be closed after their parents have been
26635         created. 
26637         * interface.cs (InterfaceAttr): Put all the logic for computing
26638         the interface attribute here. 
26640         (DefineInterface): Register our interface order with the
26641         RootContext or with the TypeContainer depending on the case.
26643 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26645         * cs-parser.jay: rework foreach statement to work with the new
26646         changes to the policy on SimpleNames.
26648         * report.cs: support Stacktrace on warnings as well.
26650         * makefile: drop --unsafe and /unsafe from the compile.
26652 2002-03-13  Ravi Pratap  <ravi@ximian.com>
26654         * ecore.cs (StandardConversionExists): Modify to take an Expression
26655         as the first parameter. Ensure we do null -> reference type conversion
26656         checking.
26658         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26659         temporary Expression objects.
26661 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26663         * interface.cs: workaround bug in method overloading resolution
26664         (there is already a bugzilla bug for it).
26666 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26668         We could also solve this problem by having a separate path for
26669         performing type lookups, instead of DoResolve, we could have a
26670         ResolveType entry point, and only participating pieces of the
26671         production (simplename, deref, array) would implement this. 
26673         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26674         signal SimpleName to only resolve type names and not attempt to
26675         resolve anything else.
26677         * expression.cs (Cast): Set the flag.
26679         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26681         * class.cs: Only report 108 if there is no `new' modifier.
26683         * cs-parser.jay: rework foreach statement to work with the new
26684         changes to the policy on SimpleNames.
26686         * report.cs: support Stacktrace on warnings as well.
26688         * makefile: drop --unsafe and /unsafe from the compile.
26690 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
26692         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26693         lookups here, instead of doing that at parse time.  This means
26694         that our grammar will not introduce `LocalVariableReferences' as
26695         expressions at this point.  That solves the problem of code like
26696         this:
26698         class X {
26699            static void Main ()
26700            { int X = 1;
26701             { X x = null }}}
26703         This is only half the fix.  The full fix requires parameters to
26704         also be handled in this way.
26706         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26707         makes the use more obvious of the DeclSpace.  The
26708         ec.TypeContainer.TypeBuilder is now only used to pull the
26709         TypeBuilder for it.
26711         My theory is that I can get rid of the TypeBuilder completely from
26712         the EmitContext, and have typecasts where it is used (from
26713         DeclSpace to where it matters).  
26715         The only pending problem is that the code that implements Aliases
26716         is on TypeContainer, and probably should go in DeclSpace.
26718         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26719         lookups here, instead of doing that at parse time.  This means
26720         that our grammar will not introduce `LocalVariableReferences' as
26721         expressions at this point.  That solves the problem of code like
26722         this:
26724         class X {
26725            static void Main ()
26726            { int X = 1;
26727             { X x = null }}}
26729         This is only half the fix.  The full fix requires parameters to
26730         also be handled in this way.
26732         * class.cs (Property.DefineMethod): When implementing an interface
26733         method, set newslot, when implementing an abstract method, do not
26734         set the flag (before we tried never setting it, or always setting
26735         it, which is the difference).
26736         (Indexer.DefineMethod): same.
26737         (Method.DefineMethod): same.
26739         * ecore.cs: Only set the status used flag if we get back a Field.
26741         * attribute.cs: Temporary hack, so Paolo can keep working.
26743 2002-03-08  Ravi Pratap  <ravi@ximian.com>
26745         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26746         the unmanaged type in the case we have a MarshalAs attribute.
26748         (Resolve): Handle the case when we are parsing the special MarshalAs
26749         attribute [we need to store the unmanaged type to use later]
26751         * typemanager.cs (marshal_as_attr_type): Built in type for the 
26752         MarshalAs Attribute.
26754         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
26755         on parameters and accordingly set the marshalling info.
26757 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
26759         * class.cs: Optimizing slightly by removing redundant code after
26760         we switched to the `NoTypes' return value.
26761         (Property.DefineMethod): use NoTypes here too.
26763         This fixes the bug I introduced in my last batch of changes.
26765 2002-03-05  Ravi Pratap  <ravi@ximian.com>
26767         * tree.cs (RecordEnum): Add. We now keep track of enums too.
26769         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26770         Enums since those are types too. 
26772         * cs-parser.jay (enum_declaration): Record enums as we parse them.
26774         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
26775         thanks to a call during the lookup process.
26777 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
26779         * statement.cs (Foreach): Lots of work to accomodate a particular
26780         kind of foreach statement that I had not kept in mind.  It is
26781         possible to have foreachs on classes that provide a GetEnumerator
26782         method that return objects that implement the "pattern" for using
26783         a foreach, there is no need to support GetEnumerator
26784         specifically. 
26786         This is needed to compile nant.
26788         * decl.cs: Only report 114 if the member is not `Finalize' and if
26789         the warning level is at least 2.
26791         * class.cs: Moved the compare function from Method to
26792         MethodSignature. 
26794         (MethodSignature.InheritableMemberSignatureCompare): Add new
26795         filter function that is used to extract inheritable methods from a
26796         class. 
26798         (Method.Define): Use the new `inheritable_method_signature_filter'
26799         delegate
26801         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26802         command. 
26804 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
26806         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26808         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26810         * expression.cs: Pass location information to
26811         ConvertImplicitStandard. 
26813         * class.cs: Added debugging code to track return values from
26814         interfaces. 
26816 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26818         * expression.cs (Is.DoResolve): If either side of the `is' is an
26819         interface, do not flag the warning.
26821         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26822         for interfaces
26824         * report.cs: Allow for --fatal to be used with --probe.
26826         * typemanager.cs (NoTypes): Move the definition for the empty Type
26827         array here. 
26829         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26830         properties. 
26831         (TypeContainer.DefineProxy): New function used to proxy to parent
26832         implementations when implementing interfaces.
26833         (TypeContainer.ParentImplements): used to lookup if our parent
26834         implements a public function that is required by an interface.
26835         (TypeContainer.VerifyPendingMethods): Hook this up.
26837         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26838         `modules' and `assemblies' arraylists into arrays.  We only grow
26839         these are the very early start up of the program, so this improves
26840         the speedof LookupType (nicely measured).
26842         * expression.cs (MakeByteBlob): Replaced unsafe code with
26843         BitConverter, as suggested by Paolo.
26845         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26846         folding of string concatenation, but if either side is a string,
26847         and the other is not, then return null, and let the runtime use
26848         the concatenation on the string plus the object (using
26849         `Object.ToString'). 
26851 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26853         Constant Folding has been implemented now.
26855         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26856         the error instead on types that are not supported in one's
26857         complement. 
26859         * constant.cs (Constant and all children): New set of functions to
26860         perform implict and explicit conversions.
26862         * ecore.cs (EnumConstant): Implement the new functions to perform
26863         conversion by proxying to the child expression.
26865         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26866         own separate setting that can not be turned off from the command
26867         line using --unchecked or --checked and is only controlled using
26868         the checked/unchecked statements and expressions.  This setting is
26869         used by the constant folder to flag errors.
26871         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26872         ConstantCheckState as well.   
26874         During Resolve, they also have to flag the state, because the
26875         constant folder runs completely in the Resolve phase.
26877         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26878         well.
26880 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26882         * cfold.cs: New file, this file contains the constant folder.
26884         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26885         argument to track whether we are using the resulting address to
26886         load or store a value and provide better error messages. 
26888         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26889         new AddressOf arguments.
26891         * statement.cs (Foreach.EmitCollectionForeach): Update
26893         * expression.cs (Argument.Emit): Call AddressOf with proper
26894         arguments to track usage.
26896         (New.DoEmit): Call AddressOf with new arguments.
26898         (Unary.Emit): Adjust AddressOf call.
26900 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26902         * cs-parser.jay (member_access): Change the case for pre-defined types
26903         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26904         this suggestion.
26906         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26907         a method body.
26909         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26910         essentially like methods and apply attributes like MethodImplOptions to them too.
26912         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26913         not being null.
26915         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26916         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26917         is the DeclSpace.
26919         * Update code everywhere accordingly.
26921         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26923         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26925 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26927         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26928         try performing lookups against those instead of jumping straight into using
26929         the 'using' clauses.
26931         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26933         (LookupType): Perform lookups in implicit parents too.
26935         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26936         sequence as RootContext.LookupType. 
26938         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26939         the various cases of namespace lookups into this method.
26941 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26943         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26944         in positional arguments)
26946         * class.cs (Operator): Update the AllowedModifiers to contain
26947         extern. 
26949         * cs-parser.jay: Update operator declaration to allow for the
26950         operator body to be empty.
26952         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26953         values. 
26955 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26957         * class.cs (Method.Emit): Label parameters.
26959         * driver.cs: Return 1 or 0 as the program exit code.
26961 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26963         * expression.cs: Special case the `null' object when trying to
26964         auto-compute the type, as anything can be explicitly converted to
26965         that. 
26967         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26968         spotting this Paolo.
26970         (Expression.ImplicitNumericConversion): Perform comparissions of
26971         the type using the underlying type in the case of an enumeration
26972         rather than using the enumeration type for the compare.
26974         Cope with the underlying == type case, which is not possible to
26975         catch before. 
26977         (Expression.ConvertNumericExplicit): Perform comparissions of
26978         the type using the underlying type in the case of an enumeration
26979         rather than using the enumeration type for the compare.
26981         * driver.cs: If the user does not supply an extension, assume .exe
26983         * cs-parser.jay (if_statement): Rewrote so that we can track the
26984         location for the if statement.
26986         * expression.cs (Binary.ConstantFold): Only concat strings when
26987         the operation is "+", not everything ;-)
26989         * statement.cs (Statement.EmitBoolExpression): Take a location
26990         argument. 
26991         (If, While, Do): Track location.
26993         * expression.cs (Binary.ResolveOperator): In the object + string
26994         case, I was missing a call to ConvertImplicit
26996 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26998         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26999         Location arguments. Ensure we use RootContext.LookupType to do our work
27000         and not try to do a direct Type.GetType and ModuleBuilder.GetType
27002         * interface.cs (PopulateMethod): Handle the type of the parameter being
27003         null gracefully.
27005         * expression.cs (Invocation.BetterFunction): Handle the case when we 
27006         have a params method with no fixed arguments and a call is made with no
27007         arguments.
27009 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
27011         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
27012         the verbatim-string-literal
27014         * support.cs (InternalParameters.ParameterModifier): handle null
27015         fixed parameters.
27016         (InternalParameters.ParameterType): ditto.
27018         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
27019         duplicating the name of the variable parameter.
27020         (GetParameterByName): Fix bug where we were not looking up array
27021         paramters if they were the only present (thanks Paolo!).
27022         (GetParameterInfo): We only have an empty set of types if both
27023         fixed and array are set to null.
27024         (GetParameterInfo-idx): Handle FixedParameter == null
27026         * cs-parser.jay: Handle the case where there is no catch
27027         statements (missing null test).
27029 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
27031         * driver.cs (MainDriver): Be conservative on our command line
27032         handling.
27034         Catch DirectoryNotFoundException when calling GetFiles.
27036         (SplitPathAndPattern): Used to split the input specification into
27037         a path and a pattern that we can feed to Directory.GetFiles.
27039 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
27041         * statement.cs (Fixed): Implement the last case of the Fixed
27042         statement (string handling).
27044         * expression.cs (StringPtr): New class used to return a char * to
27045         a string;  Used by the Fixed statement.
27047         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
27049         * expression.cs (Binary.ResolveOperator): Remove redundant
27050         MemberLookup pn parent type.
27051         Optimize union call, we do not need a union if the types are the same.
27052         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
27053         type.
27055         Specialize the use of MemberLookup everywhere, instead of using
27056         the default settings. 
27058         (StackAlloc): Implement stackalloc keyword.
27060         * cs-parser.jay: Add rule to parse stackalloc.
27062         * driver.cs: Handle /h, /help, /?
27064         * expression.cs (MakeByteBlob): Removed the hacks we had in place
27065         before we supported unsafe code.
27067         * makefile: add --unsafe to the self compilation of mcs.
27069 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
27071         * expression.cs (PointerArithmetic): New class that is used to
27072         perform pointer arithmetic.
27073         (Binary.Resolve): Handle pointer arithmetic
27074         Handle pointer comparission.
27075         (ArrayPtr): Utility expression class that is used to take the
27076         address of an array.
27078         (ElementAccess): Implement array access for pointers
27080         * statement.cs (Fixed): Implement fixed statement for arrays, we
27081         are missing one more case before we are done.
27083         * expression.cs (Indirection): Implement EmitAssign and set the
27084         ExprClass to Variable.  This allows pointer dereferences to be
27085         treated as variables, and to have values assigned to them.
27087         * ecore.cs (Expression.StoreFromPtr): New utility function to
27088         store values dereferencing.
27090 2002-02-20  Ravi Pratap  <ravi@ximian.com>
27092         * expression.cs (Binary.ResolveOperator): Ensure that we are
27093         not trying to operate on a void type - this fixes the reported
27094         bug.
27096         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
27097         the parent implementation is sealed.
27099         * ../errors/cs0239.cs : Add.
27101         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
27103         * typemanager.cs (unverifiable_code_type): Corresponds to 
27104         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
27105         which have unsafe code in them.
27107         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
27108         unsafe context.
27110 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
27112         * cs-tokenizer.cs: Add support for @"litreal strings"
27114         Make tokenizer accept pre-processor directives
27115         on any column (remove the old C-like limitation). 
27117         * rootcontext.cs (EmitCode): Emit any global attributes.
27118         (AddGlobalAttributes): Used to keep track of assembly attributes. 
27120         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
27122         * cs-parser.jay: Add support for global attributes.  
27124 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
27126         * expression.cs (Indirection): New helper class.  Unary will
27127         create Indirection classes to be able to implement the
27128         IMemoryLocation interface on it.
27130 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
27132         * cs-parser.jay (fixed_statement): reference the right statement.
27134         * statement.cs (Fixed.Emit): Finish implementing the fixed
27135         statement for the &x case.
27137 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
27139         * class.cs (Property.Define, Method.Define): Remove newslot when
27140         `implementing'.  
27142         * modifiers.cs: My use of NewSlot when `Abstract' was set was
27143         wrong.  NewSlot should only be used if the `new' keyword is present.
27145         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
27146         locating our system dir.  Sorry about this.
27148 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
27150         * driver.cs (GetSystemDir): Compute correctly the location of our
27151         system assemblies.  I was using the compiler directory instead of
27152         the library directory.
27154 2002-02-13  Ravi Pratap  <ravi@ximian.com>
27156         * expression.cs (BetterFunction): Put back in what Miguel commented out
27157         since it is the correct fix. The problem is elsewhere ;-)
27159         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
27160         parameters of the parms method are themselves compatible or not !
27162         (StandardConversionExists): Fix very dangerous bug where we were forgetting
27163         to check that a class implements an interface before saying that an implicit
27164         conversion was allowed. Use ImplementsInterface to do the checking.
27166 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
27168         * class.cs (Method.Define): Track whether we are an explicit
27169         implementation or not.  And only call DefineMethodOverride if we
27170         are an explicit implementation.
27172         (Property.DefineMethod): Ditto.
27174 2002-02-11  Ravi Pratap  <ravi@ximian.com>
27176         * expression.cs (BetterFunction): Catch hideous bug which was
27177          preventing us from detecting ambiguous calls due to implicit casts i.e
27178         cs0121.
27180 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
27182         * support.cs (Pair): Remove un-needed method.  I figured why I was
27183         getting the error in cs-parser.jay, the variable in a foreach loop
27184         is readonly, and the compiler does not really treat this as a variable.
27186         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
27187         instead of EQUALS in grammar.  
27189         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
27191         * expression.cs (Unary.DoResolve): Check whether the argument is
27192         managed or not.
27194 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
27196         * support.cs: Api for Pair to set a value.  Despite the fact that
27197         the variables are public the MS C# compiler refuses to compile
27198         code that accesses the field if the variable is part of a foreach
27199         statement. 
27201         * statement.cs (Fixed): Begin implementation of the fixed
27202         statement.
27204         (Block.AddVariable): Return the VariableInfo on success and null
27205         on failure instead of true/false. 
27207         * cs-parser.jay (foreach): Catch errors on variables already
27208         defined (we were ignoring this value before) and properly unwind
27209         the block hierarchy
27211         (fixed_statement): grammar for the fixed statement.
27213 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
27215         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
27216         pointer types to be incretemented.
27218         (SizeOf): Implement.
27220         * cs-parser.jay (pointer_member_access): Implement
27221         expr->IDENTIFIER production.
27223         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
27224         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27225         on safe contexts.
27227         (Unary): Implement indirection.
27229         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27230         use in non-unsafe context).
27232         (SimpleName.DoResolve): Check for pointers in field access on safe
27233         contexts. 
27235         (Expression.LoadFromPtr): Factor the load-indirect code in this
27236         function.  This was duplicated in UnboxCast and ParameterReference
27238 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
27240         * expression.cs (ComposedCast): report an error if a pointer cast
27241         is used in a safe region.
27243         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27244         pointer type casts in unsafe context.
27246         * codegen.cs (EmitContext): Set up IsUnsafe.
27248         * cs-parser.jay (non_expression_type): Add productions for pointer
27249         casts. 
27251         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27252         code.  We should not use force into static mode if the method is
27253         not virtual.  Fixes bug in MIS
27255         * statement.cs (Do.Emit, While.Emit, For.Emit,
27256         Statement.EmitBoolExpression): Add support to Do and While to
27257         propagate infinite loop as `I do return' semantics.
27259         Improve the For case to also test for boolean constants.
27261         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27262         to the list of attributes we can add.
27264         Remove `EmitContext' argument.
27266         * class.cs (Method.Define): Apply parameter attributes.
27267         (Constructor.Define): Apply parameter attributes.
27268         (MethodCore.LabelParameters): Move here the core of labeling
27269         parameters. 
27271         * support.cs (ReflectionParameters.ParameterModifier,
27272         InternalParameters.ParameterModifier): Use IsByRef on the type and
27273         only return the OUT bit for these parameters instead of in/out/ref
27274         flags.
27276         This is because I miss-understood things.  The ParameterInfo.IsIn
27277         and IsOut represent whether the parameter has the [In] and [Out]
27278         attributes set.  
27280 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
27282         * ecore.cs (FieldExpr.Emit): Release temporaries.
27284         * assign.cs (LocalTemporary.Release): new function.
27286         * codegen.cs (EmitContext.GetTemporaryStorage,
27287         EmitContext.FreeTemporaryStorage): Rework the way we deal with
27288         temporary storage.  Now we can "put back" localbuilders when we
27289         are done with them
27291 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
27293         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27294         need to make a copy of the variable to generate verifiable code.
27296 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
27298         * driver.cs: Compute dynamically the system directory.
27300         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27301         Slower, but more generally useful.  Used by the abstract
27302         registering implementation. 
27304         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27305         the rules for the special rule on Type/instances.  First check if
27306         we have the same name, and if so, try that special static path
27307         rather than the instance path.
27309 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
27311         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27312         for, while and if.
27314         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27315         Enum, ValueType, Delegate or Array for non-corlib compiles.
27317         * cs-tokenizer.cs: Catch long identifiers (645)
27319         * typemanager.cs (IndexerPropetyName): Ravi never tested this
27320         piece of code.
27322         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27323         fix, we were returning too early, so we were not registering
27324         pending methods from abstract classes.
27326         Do not register pending methods if the class is abstract.
27328         * expression.cs (Conditional.DoResolve): Report circular implicit
27329         conversions when we neecd to compute it for conditional
27330         expressions. 
27332         (Is.DoResolve): If the expression is always of the provided type,
27333         flag warning 183.  If the expression can not ever be of the
27334         provided type flag warning 184.
27336         * class.cs: Catch 169 as well.
27338         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27339         read. 
27341 2002-01-18  Nick Drochak  <ndrochak@gol.com>
27343         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
27345 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
27347         * interface.cs: (PopulateMethod): Check for pointers being defined
27348         only if the unsafe context is active.
27349         (PopulateProperty): ditto.
27350         (PopulateIndexer): ditto.
27352         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27353         specified.  If pointers are present, make sure that they are
27354         present in an unsafe context.
27355         (Constructor, Constructor.Define): ditto.
27356         (Field, Field.Define): ditto.
27357         (Property, Property.Define): ditto.
27358         (Event, Event.Define): ditto.
27360         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27361         hashtable if there are classes or structs defined.
27363         * expression.cs (LocalVariableReference.DoResolve): Simplify this
27364         code, as the constant resolution moved.
27366         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27367         the metadata, so we can flag error 133. 
27369         * decl.cs (MemberCore.UnsafeOK): New function to test that a
27370         pointer is being declared in an unsafe context.
27372 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
27374         * modifiers.cs (Modifiers.Check): Require a Location argument.
27375         Report error 227 for Unsafe use.
27377         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27379         * statement.cs (For.Emit): If the test is null, then report that
27380         we do `return', as we wont reach anything afterwards.
27382         (Switch.SwitchGoverningType): Track the expression that matched
27383         the conversion.
27385         * driver.cs: Allow negative numbers as an error code to flag.
27387         * cs-parser.jay: Handle 1551.
27389         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27391 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27393         * cs-parser.jay: Report 1518 (type declaration can only contain
27394         class, struct, interface, enum or delegate)
27396         (switch_label): Report 1523 (keywords `case' or `default' must
27397         preced code)
27399         (opt_switch_sections): Report 1522 (empty switch)
27401         * driver.cs: Report 1515 (response file specified multiple times)
27402         Report 1516 (Source file specified multiple times).
27404         * expression.cs (Argument.Resolve): Signal 1510
27406         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27407         access not allowed in static code)
27409 2002-01-11  Ravi Pratap  <ravi@ximian.com>
27411         * typemanager.cs (IsPointerType): Utility method which we are going
27412         to need a lot.
27414         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27415         the object type, so we take care of that.
27417         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27419         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27420         added to non-params parameters :-)
27422         * typemanager.cs (CSharpName): Include 'void' type too. 
27424         (void_ptr_type): Include in the set of core types.
27426         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
27427         duplicating code.
27429         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
27430         an unsafe context.
27432         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
27433         completely forgotten about it.
27435 2002-01-10  Ravi Pratap  <ravi@ximian.com>
27437         * cs-parser.jay (pointer_type): Add. This begins our implementation
27438         of parsing rules for unsafe code.
27440         (unsafe_statement): Implement.
27442         (embedded_statement): Modify to include the above.
27444         * statement.cs (Unsafe): Implement new class for unsafe blocks.
27446         * codegen.cs (EmitContext.InUnsafe): Add. This determines
27447         if the current context is an unsafe one.
27449         * cs-parser.jay (local_variable_pointer_type): Since local variable types
27450         are handled differently, we need separate rules for them.
27452         (local_variable_declaration): Update to use local_variable_pointer_type
27453         to allow variable declarations of unmanaged pointer types.
27455         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27456         in unsafe contexts.
27458         * ../errors/cs0214.cs : Add.
27460 2002-01-16  Nick Drochak  <ndrochak@gol.com>
27462         * makefile: remove 'response' file when cleaning.
27464 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27466         * cs-parser.jay: Report 1524.
27468 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
27470         * typemanager.cs (RegisterMethod): drop checking if we have
27471         registered this from here
27473 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
27475         * class.cs (Method.EmitDestructor): Implement calling our base
27476         destructor. 
27478         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27479         value of InFinally.
27481         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27482         this routine and will wrap the call in a try/catch block.  Deal
27483         with the case.
27485 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
27487         * ecore.cs (Expression.MemberLookup): instead of taking a
27488         parameter `same_type' that was used to tell whether we could
27489         access private members we compute our containing type from the
27490         EmitContext.
27492         (FieldExpr): Added partial support for volatile fields.  This does
27493         not work for volatile fields exposed from assemblies, as I can not
27494         figure out how to extract the modreq from it.
27496         Updated all the source files to use this.
27498         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27499         because it is referenced by MemberLookup very often. 
27501 2002-01-09  Ravi Pratap  <ravi@ximian.com>
27503         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27504         TypeBuilder.GetCustomAttributes to retrieve what we need.
27506         Get rid of redundant default_member_attr_type as this is the same as
27507         default_member_type which already exists.
27509         * interface.cs, attribute.cs : Update accordingly.
27511 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
27513         * typemanager.cs: Enable IndexerPropertyName again.  It does not
27514         work for TYpeBuilders though.  Ravi, can you please fix this?
27516         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27518         * expression.cs (Argument.Emit): Handle the case of ref objects
27519         being passed to ref functions;  
27521         (ParameterReference.EmitLoad): Loads the content of the pointer
27522         without dereferencing.
27524 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27526         * cs-tokenizer.cs: Implemented the pre-processing expressions.
27528 2002-01-08  Ravi Pratap  <ravi@ximian.com>
27530         * class.cs (Indexer.DefineMethod): Incorporate the interface
27531         type in the name of the method if we are doing explicit interface
27532         implementation.
27534         * expression.cs (ConversionExists): Remove as it is completely obsolete.
27536         (BetterConversion): Fix extremely trivial bug where we were referring to
27537         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27538         again !
27540         * ../errors/bug16.cs : Add although we have fixed it.
27542 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27544         * expression.cs (BaseIndexer): Begin implementation.
27546         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27548         * cs-parser.jay (indexer_declarator): Use qualified_identifier
27549         production directly to remove a shift/reduce, and implement
27550         explicit interface implementation.
27552         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27553         after a floating point suffix.
27555         * expression.cs (DoNumericPromotions): Improved the conversion for
27556         uint/uint.  If we have a constant, we avoid doing a typecast to a
27557         larger type.
27559         * class.cs (Indexer): Implement explicit interface implementation
27560         for indexers.
27562 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27564         * class.cs: make the default instance constructor public and hidebysig.
27566 2001-01-03  Ravi Pratap  <ravi@ximian.com>
27568         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27569         so we can call it from elsewhere.
27571         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27572         we emit it internally if the class has a defined indexer; otherwise the user
27573         emits it by decorating the class definition with the DefaultMemberAttribute.
27575         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27576         attribute is not used on a type which defines an indexer.
27578         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27579         character when we skip whitespace.
27581         * ../errors/cs0646.cs : Add.
27583 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
27585         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27586         again. 
27588         * makefile: Add practical target `mcs3.exe' which builds the third
27589         generation compiler. 
27591         * expression.cs (New): Fix structures constructor calling.
27593         * class.cs (Property, Method, Indexer): Emit Final flag on the
27594         method if we are an interface implementation and we are not
27595         abstract. 
27597         * ecore.cs (PropertyExpr): New public field `IsBase', tells
27598         whether this property is referencing a `base' method.
27600         * expression.cs (Invocation.EmitCall): take an extra argument:
27601         is_base, this is used to determine whether the `call' or
27602         `callvirt' opcode should be used.
27605         * delegate.cs: update EmitCall.
27607         * class.cs (Method.Define): Set NewSlot for the cases where we are
27608         not implementing an interface method.
27610         (Property.Define): ditto.
27612 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
27614         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27615         'r'.  Allows mcs to parse itself fully.
27617 2002-01-02  Ravi Pratap  <ravi@ximian.com>
27619         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27620         of the number of initializers that require the InitializeArray method.
27622         (CheckIndices): Store the Expression in all cases - not the plain value. Also
27623         update the above field where necessary.
27625         (MakeByteBlob): Update accordingly.
27627         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
27628         greater than 2.
27630         (EmitDynamicInitializers): Update in accordance with the new optimization.
27632         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27633         same OpCode applies.
27635         * cs-parser.jay : Fix some glaring errors I introduced.
27637 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
27639         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27640         so that we can check for name clashes there too.
27642         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27643         for interface indexers.
27645         * interfaces.cs (Define): Emit the default member attribute.
27647         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27648         variable was being referred to while setting the value ;-)
27650 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
27652         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27653         byte-by-byte information when we know the data is zero.
27655         Make the block always a multiple of 4, because
27656         DefineInitializedData has a bug.
27658         * assign.cs: Fix, we should assign from the temporary, not from
27659         the source. 
27661         * expression.cs (MakeByteBlob): Fix my incorrect code.
27663 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
27665         * typemanager.cs (EnumToUnderlying): This function is used to get
27666         the underlying type from an enumeration, because it does not
27667         always work. 
27669         * constant.cs: Use the I4_S form for values between -128 and 127.
27671         * statement.cs (Block.LookupLabel): Looks up a label.
27672         (Block): Drop support for labeled blocks.
27674         (LabeledStatement): New kind of statement that represents a label
27675         only.
27677         (Goto): Finally implement this bad boy.
27679         * cs-parser.jay: Update to reflect new mechanism to implement
27680         labels.
27682 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
27684         * codegen.cs (EmitContext.This): a codegen property that keeps the
27685         a single instance of this instead of creating many different this
27686         instances. 
27688         * delegate.cs (Delegate.DoResolve): Update to use the property;
27690         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27692         * expression.cs (BaseAccess.DoResolve): Ditto.
27694 2001-12-29  Ravi Pratap  <ravi@ximian.com>
27696         * typemanager.cs (methodimpl_attr_type): Add to hold the type
27697         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27699         (InitCoreTypes): Update accordingly.
27701         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27702         so we can quickly store the state.
27704         (ApplyAttributes): Set the correct implementation flags
27705         for InternalCall methods.
27707 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
27709         * expression.cs (EmitCall): if a method is not virtual, then do
27710         not use callvirt on it.
27712         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27713         user defined stuff) requires the use of stobj, which takes an
27714         address on the stack instead of an array and an index.  So emit
27715         the Ldelema operation for it.
27717         (EmitStoreOpcode): Use stobj for valuetypes.
27719         (UnaryMutator.EmitCode): Use the right 1 value depending on
27720         whether we are dealing with int64/uint64, float or doubles.
27722         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27723         constructors that I implemented last night.
27725         (Constructor.IsDefault): Fix to work properly for static
27726         constructors.
27728         * cs-parser.jay (CheckDef): report method signature errors.
27729         Update error number 103 to be 132.
27731         * decl.cs: New AdditionResult enumeration value: MethodExists.
27732         Although we do this check for methods later on in the semantic
27733         analysis, catching repeated default constructors is so easy that
27734         we catch these here. 
27736         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27737         promotions code.
27739         (ParameterReference.EmitAssign, Emit): handle
27740         bools as bytes.
27742         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27743         (ArrayAccess.EmitStoreOpcode): ditto.
27745         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27747         * expression.cs (MakeByteBlob): Complete all the missing types
27748         (uint, short, ushort, byte, sbyte)
27750         * class.cs: Only init instance field initializers on instance
27751         constructors. 
27753         Rename `constructors' to instance_constructors. 
27755         (TypeContainer.AddConstructor): Only add constructors to the list
27756         if it is not static.
27758         Make sure that we handle default_static_constructor independently
27759         everywhere where we handle instance_constructors
27761 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
27763         * class.cs: Do not lookup or create a base initializer for a
27764         static constructor.
27766         (ConstructorInitializer.Resolve): use the proper type to lookup
27767         for constructors.
27769         * cs-parser.jay: Report error 1585 (modifiers between type and name).
27771         * enum.cs, interface.cs: Remove CloseType, this is taken care by
27772         in DeclSpace. 
27774         * decl.cs: CloseType is now an virtual method, the default
27775         implementation just closes this type.
27777 2001-12-28  Ravi Pratap  <ravi@ximian.com>
27779         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27780         to PreserveSig by default. Also emit HideBySig on such methods.
27782         Basically, set the defaults to standard values.
27784         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27785         argument, if candidate is better, it can't be worse than the best !
27787         (Invocation): Re-write bits to differentiate between methods being
27788         applicable in their expanded form and their normal form - for params
27789         methods of course.
27791         Get rid of use_standard everywhere as only standard conversions are allowed
27792         in overload resolution. 
27794         More spec conformance.
27796 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27798         * driver.cs: Add --timestamp, to see where the compiler spends
27799         most of its time.
27801         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27802         `this' in static code.
27804         (SimpleName.DoResolve): Implement in terms of a helper function
27805         that allows static-references to be passed upstream to
27806         MemberAccess.
27808         (Expression.ResolveWithSimpleName): Resolve specially simple
27809         names when called by MemberAccess to implement the special
27810         semantics. 
27812         (Expression.ImplicitReferenceConversion): Handle conversions from
27813         Null to reference types before others, as Null's type is
27814         System.Object. 
27816         * expression.cs (Invocation.EmitCall): Handle the special case of
27817         calling methods declared on a reference type from a ValueType
27818         (Base classes System.Object and System.Enum)
27820         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27821         the left hand side is a TypeExpr, not on every enumeration. 
27823         (Binary.Resolve): If types are reference types, then do a cast to
27824         object on operators != and == of both arguments.
27826         * typemanager.cs (FindMembers): Extract instance and static
27827         members if requested.
27829         * interface.cs (PopulateProperty): Use void_type instead of null
27830         as the return type for the setter method.
27832         (PopulateIndexer): ditto.
27834 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27836         * support.cs (ReflectionParameters): Fix minor bug where we
27837         were examining the wrong parameter for the ParamArray attribute.
27839         Cope with requests for the type of the parameter at position
27840         greater than the params parameter's. We now return the element
27841         type of the params array as that makes more sense.
27843         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27844         accordingly as we no longer have to extract the element type
27845         ourselves.
27847         (Invocation.OverloadResolve): Update.
27849 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27851         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27852         against IEnumerator, test whether the return value is a descendant
27853         of the IEnumerator interface.
27855         * class.cs (Indexer.Define): Use an auxiliary method to implement
27856         the other bits of the method definition.  Begin support for
27857         explicit interface implementation.
27859         (Property.DefineMethod): Use TypeManager.void_type instead of null
27860         for an empty return value.
27862 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27864         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27865         dealing with a FieldExpr which is composed of a FieldBuilder, in
27866         the code path we did extract the constant, but we should have
27867         obtained the underlying value to be able to cast it (otherwise we
27868         end up in an infinite loop, this is what Ravi was running into).
27870         (ArrayCreation.UpdateIndices): Arrays might be empty.
27872         (MemberAccess.ResolveMemberAccess): Add support for section
27873         14.5.4.1 that deals with the special case of E.I when E is a type
27874         and something else, that I can be a reference to a static member.
27876         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27877         handle a particular array type to create byte blobs, it is just
27878         something we dont generate byteblobs for.
27880         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27881         arguments. 
27883         * location.cs (Push): remove the key from the hashtable that we
27884         are about to add.   This happens for empty files.
27886         * driver.cs: Dispose files after we have parsed them.
27888         (tokenize): new function that only runs the tokenizer on its
27889         input, for speed testing.
27891 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27893         * class.cs (Event.Define): Define the private field only if there
27894         are no accessors defined.
27896         * expression.cs (ResolveMemberAccess): If there is no associated
27897         field with the event, that means we have an event defined with its
27898         own accessors and we should flag error cs0070 since transforming
27899         ourselves into a field is not valid in that case.
27901         * ecore.cs (SimpleName.DoResolve): Same as above.
27903         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27904         and charset to sane values.
27906 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27908         * assign.cs (DoResolve): Perform check on events only if they 
27909         are being accessed outside the declaring type.
27911         * cs-parser.jay (event_declarations): Update rules to correctly
27912         set the type of the implicit parameter etc.
27914         (add_accessor, remove_accessor): Set current local parameters.
27916         * expression.cs (Binary): For delegate addition and subtraction,
27917         cast the return value from the method into the appropriate delegate
27918         type.
27920 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27922         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27923         of these as the workaround is unnecessary.
27925         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27926         delegate data - none of that is needed at all.
27928         Re-write bits to extract the instance expression and the delegate method
27929         correctly.
27931         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27932         on delegates too.
27934         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27935         of attaching attributes instead of duplicating code everywhere.
27937         * everywhere : Update code to do attribute emission using the above method.
27939 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27941         * expression.cs (IsParamsMethodApplicable): if there are not
27942         parameters, return immediately.
27944         * ecore.cs: The 0 literal can be implicity converted to an enum
27945         type. 
27947         (SimpleName.DoResolve): First lookup the type, then lookup the
27948         members. 
27950         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27951         want to get its address.  If the InstanceExpression is not
27952         addressable, store the result in a temporary variable, then get
27953         the address of it.
27955         * codegen.cs: Only display 219 errors on warning level or above. 
27957         * expression.cs (ArrayAccess): Make it implement the
27958         IMemoryLocation interface.
27960         (Binary.DoResolve): handle the operator == (object a, object b)
27961         and operator != (object a, object b) without incurring into a
27962         BoxedCast (because 5 != o should never be performed).
27964         Handle binary enumerator operators.
27966         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27967         value type, otherwise use Ldelem_ref.
27969         Use precomputed names;
27971         (AddressOf): Implement address of
27973         * cs-parser.jay (labeled_statement): Fix recursive block
27974         addition by reworking the production.
27976         * expression.cs (New.DoEmit): New has a special case:
27977                 
27978                  If we are dealing with a ValueType, we have a few
27979                  situations to deal with:
27980                 
27981                     * The target of New is a ValueType variable, that is
27982                       easy, we just pass this as the variable reference
27983                 
27984                     * The target of New is being passed as an argument,
27985                       to a boxing operation or a function that takes a
27986                       ValueType.
27987                 
27988                       In this case, we need to create a temporary variable
27989                       that is the argument of New.
27992 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27994         * rootcontext.cs (LookupType): Check that current_type is not null before
27995         going about looking at nested types.
27997         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27998         not implement the IAssignMethod interface any more.
28000         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
28001         where we tranform them into FieldExprs if they are being resolved from within
28002         the declaring type.
28004         * ecore.cs (SimpleName.DoResolve): Do the same here.
28006         * assign.cs (DoResolve, Emit): Clean up code considerably. 
28008         * ../errors/bug10.cs : Add.
28010         * ../errors/cs0070.cs : Add.
28012         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
28014         * assign.cs : Get rid of EventIsLocal everywhere.
28016 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
28018         * ecore.cs (ConvertIntLiteral): finished the implementation.
28020         * statement.cs (SwitchLabel): Convert the value we are using as a
28021         key before looking up the table.
28023 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
28025         * codegen.cs (EmitTopBlock): Require a Location argument now.
28027         * cs-parser.jay (constructor_declarator): We need to setup
28028         current_local_parameters before we parse the
28029         opt_constructor_initializer, to allow the variables to be bound
28030         to the constructor arguments.
28032         * rootcontext.cs (LookupType): First lookup nested classes in our
28033         class and our parents before we go looking outside our class.
28035         * expression.cs (ConstantFold): Extract/debox the values at the
28036         beginnning. 
28038         * rootcontext.cs (EmitCode): Resolve the constants first before we
28039         resolve the types.  This is not really needed, but it helps debugging.
28041         * statement.cs: report location.
28043         * cs-parser.jay: pass location to throw statement.
28045         * driver.cs: Small bug fix.
28047         * report.cs: Updated format to be 4-zero filled digits.
28049 2001-12-22  Ravi Pratap  <ravi@ximian.com>
28051         * expression.cs (CheckIndices): Fix minor bug where the wrong
28052         variable was being referred to ;-)
28054         (DoEmit): Do not call EmitStaticInitializers when the 
28055         underlying type is System.Object.
28057 2001-12-21  Ravi Pratap  <ravi@ximian.com>
28059         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
28060         and do the usual workaround for SRE.
28062         * class.cs (MyEventBuilder.EventType): New member to get at the type
28063         of the event, quickly.
28065         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
28067         * assign.cs (Assign.DoResolve): Handle the case when the target
28068         is an EventExpr and perform the necessary checks.
28070         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
28071         interface.
28073         (SimpleName.MemberStaticCheck): Include check for EventExpr.
28075         (EventExpr): Set the type in the constructor itself since we 
28076         are meant to be born fully resolved.
28078         (EventExpr.Define): Revert code I wrote earlier.
28079                 
28080         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
28081         instance expression is null. The instance expression is a This in that case
28082         or a null, depending on whether it is a static method or not.
28084         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
28085         refers to more than one method.
28087         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
28088         and accordingly flag errors.
28090 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
28092         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
28094 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
28096         * location.cs (ToString): Provide useful rutine.
28098 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
28100         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
28101         objects, return the actual integral boxed.
28103         * statement.cs (SwitchLabel): define an ILLabel for each
28104         SwitchLabel. 
28106         (Switch.CheckSwitch): If the value is a Literal, extract
28107         the underlying literal.
28109         Also in the unused hashtable we had, add the SwitchLabel so we can
28110         quickly look this value up.
28112         * constant.cs: Implement a bunch of new constants.  Rewrite
28113         Literal based on this.  Made changes everywhere to adapt to this.
28115         * expression.cs (Expression.MakeByteBlob): Optimize routine by
28116         dereferencing array only once, and also copes with enumrations.
28118         bytes are two bytes wide, not one.
28120         (Cast): Perform constant conversions.
28122         * ecore.cs (TryImplicitIntConversion): Return literals instead of
28123         wrappers to the literals here.
28125         * expression.cs (DoNumericPromotions): long literals can converted
28126         to ulong implicity (this is taken care of elsewhere, but I was
28127         missing this spot).
28129         * ecore.cs (Expression.Literalize): Make the return type Literal,
28130         to improve type checking.
28132         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
28134 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
28136         * literal.cs: Revert code from ravi that checked the bounds.  The
28137         bounds are sane by the definition of the type itself. 
28139         * typemanager.cs: Fix implementation of ImplementsInterface.  We
28140         need to actually look up in our parent hierarchy for interfaces
28141         implemented. 
28143         * const.cs: Use the underlying type for enumerations
28145         * delegate.cs: Compute the basename for the delegate creation,
28146         that should fix the delegate test case, and restore the correct
28147         Type Lookup semantics in rootcontext
28149         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
28150         referencing a nested type with the Reflection API is using the "+"
28151         sign. 
28153         * cs-parser.jay: Do not require EOF token at the end.
28155 2001-12-20  Ravi Pratap  <ravi@ximian.com>
28157         * rootcontext.cs (LookupType): Concatenate type names with
28158         a '.' instead of a '+' The test suite passes again.
28160         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
28161         field of the enumeration.
28163         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
28164         the case when the member is an EventExpr.
28166         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
28167         static has an associated instance expression.
28169         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
28171         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
28173         * class.cs (Event.Define): Register event and perform appropriate checks
28174         for error #111.
28176         We define the Add and Remove methods even if the use provides none because
28177         in that case, we provide default implementations ourselves.
28179         Define a private field of the type of the event. This is done by the CSC compiler
28180         and we should be doing it too ;-)
28182         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
28183         More methods we use in code we generate.
28185         (multicast_delegate_type, delegate_type): Two separate types since the distinction
28186         is important.
28188         (InitCoreTypes): Update accordingly for the above.
28190         * class.cs (Event.Emit): Generate code for default accessors that we provide
28192         (EmitDefaultMethod): Do the job in the above.
28194         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
28195         appropriate place.
28197 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
28199         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
28200         builders even if we were missing one.
28202         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
28203         pass the Basename as our class name instead of the Name.  The
28204         basename will be correctly composed for us.
28206         * parameter.cs (Paramters): Now takes a Location argument.
28208         * decl.cs (DeclSpace.LookupType): Removed convenience function and
28209         make all the code call directly LookupType in RootContext and take
28210         this chance to pass the Location information everywhere.
28212         * Everywhere: pass Location information.
28214 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
28216         * class.cs (Constructor.Define): Updated way of detecting the
28217         length of the parameters.
28219         (TypeContainer.DefineType): Use basename as the type name for
28220         nested types.
28222         (TypeContainer.Define): Do not recursively define types here, as
28223         definition is taken care in order by the RootContext.
28225         * tree.cs: Keep track of namespaces in a per-file basis.
28227         * parameter.cs (Parameter.ComputeSignature): Update to use
28228         DeclSpace. 
28230         (Parameters.GetSignature): ditto.
28232         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28233         instead of a TypeContainer.
28235         (Interface.SemanticAnalysis): Use `this' instead of our parent to
28236         resolve names.  Because we need to be resolve in our context, not
28237         our parents.
28239         * driver.cs: Implement response files.
28241         * class.cs (TypeContainer.DefineType): If we are defined, do not
28242         redefine ourselves.
28244         (Event.Emit): Emit the code for add/remove handlers.
28245         (Event.Define): Save the MethodBuilders for add/remove.
28247         * typemanager.cs: Use pair here too.
28249         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28250         DictionaryEntry requires the first argument to be non-null.  
28252         (enum_declaration): Compute full name for registering the
28253         enumeration.
28255         (delegate_declaration): Instead of using
28256         formal_parameter_list, use opt_formal_parameter_list as the list
28257         can be empty.
28259         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28260         (EventParsing): New property that controls whether `add' and
28261         `remove' are returned as tokens or identifiers (for events);
28263 2001-12-19  Ravi Pratap  <ravi@ximian.com>
28265         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28266         use MyEventBuilder only and let it wrap the real builder for us.
28268         (MyEventBuilder): Revamp constructor etc.
28270         Implement all operations that we perform on EventBuilder in precisely the same
28271         way here too.
28273         (FindMembers): Update to use the EventBuilder member.
28275         (Event.Emit): Update accordingly.
28277 2001-12-18  Ravi Pratap  <ravi@ximian.com>
28279         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28280         by calling the appropriate methods.
28282         (GetCustomAttributes): Make stubs as they cannot possibly do anything
28283         useful.
28285         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28287 2001-12-17  Ravi Pratap  <ravi@ximian.com>
28289         * delegate.cs (Delegate.Populate): Check that the return type
28290         and various parameters types are indeed accessible.
28292         * class.cs (Constructor.Define): Same here.
28294         (Field.Define): Ditto.
28296         (Event.Define): Ditto.
28298         (Operator.Define): Check that the underlying Method defined itself
28299         correctly - so it's MethodBuilder should not be null.
28301         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28302         expression happens to be null.
28304         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28305         members but as of now we don't seem to be able to do anything really useful with it.
28307         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28308         not the EventBuilder.
28310 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
28312         * cs-tokenizer.cs: Add support for defines.
28313         Add support for #if, #elif, #else, #endif
28315         (eval_var): evaluates a variable.
28316         (eval): stubbed for evaluating functions.
28318         * cs-parser.jay: Pass the defines information
28320         * driver.cs: Add --define command line option.
28322         * decl.cs: Move MemberCore here.
28324         Make it the base class for DeclSpace.  This allows us to catch and
28325         report 108 and 109 for everything now.
28327         * class.cs (TypeContainer.Define): Extract all the members
28328         before populating and emit the warning 108 (new keyword required
28329         to override) instead of having each member implement this.
28331         (MemberCore.Define): New abstract method, we will be using this in
28332         the warning reporting engine in Populate.
28334         (Operator.Define): Adjust to new MemberCore protocol. 
28336         * const.cs (Const): This does not derive from Expression, it is a
28337         temporary object we use to create fields, it is a MemberCore. 
28339         * class.cs (Method.Define): Allow the entry point to be in a
28340         specific class.
28342         * driver.cs: Rewrite the argument handler to clean it up a bit.
28344         * rootcontext.cs: Made it just an auxiliary namespace feature by
28345         making everything static.
28347         * driver.cs: Adapt code to use RootContext type name instead of
28348         instance variable.
28350         * delegate.cs: Remove RootContext argument.
28352         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28353         argument. 
28355         * class.cs (Event.Define): The lookup can fail.
28357         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
28359         * expression.cs: Resolve the this instance before invoking the code.
28361 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
28363         * cs-parser.jay: Add a production in element_access that allows
28364         the thing to become a "type" reference.  This way we can parse
28365         things like "(string [])" as a type.
28367         Note that this still does not handle the more complex rules of
28368         casts. 
28371         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
28373         * ecore.cs: (CopyNewMethods): new utility function used to
28374         assemble the list of methods from running FindMembers.
28376         (MemberLookup): Rework FindMembers so that 
28378 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
28380         * class.cs (TypeContainer): Remove Delegates who fail to be
28381         defined.
28383         * delegate.cs (Populate): Verify that we dont get null return
28384         values.   TODO: Check for AsAccessible.
28386         * cs-parser.jay: Use basename to emit error 574 (destructor should
28387         have the same name as container class), not the full name.
28389         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28390         possible representation.  
28392         Also implements integer type suffixes U and L.
28394 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
28396         * expression.cs (ArrayCreation.DoResolve): We need to do the
28397         argument resolution *always*.
28399         * decl.cs: Make this hold the namespace.  Hold the root context as
28400         well.
28401         (LookupType): Move here.
28403         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28405         * location.cs (Row, Name): Fixed the code, it was always returning
28406         references to the first file.
28408         * interface.cs: Register properties defined through interfaces.
28410         * driver.cs: Add support for globbing on the command line
28412         * class.cs (Field): Make it derive from MemberCore as well.
28413         (Event): ditto.
28415 2001-12-15  Ravi Pratap  <ravi@ximian.com>
28417         * class.cs (Event::Define): Check that the type of the event is a delegate
28418         type else flag error #66.
28420         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28421         same.
28423         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28424         values of EntryPoint, CharSet etc etc.
28426         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28428         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28429         be null and we should ignore this. I am not sure if this is really clean. Apparently,
28430         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28431         which needs this to do its work.
28433         * ../errors/cs0066.cs : Add.
28435 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
28437         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28438         helper functions.
28440         * class.cs: (MethodSignature.MethodSignature): Removed hack that
28441         clears out the parameters field.
28442         (MemberSignatureCompare): Cleanup
28444         (MemberCore): New base class used to share code between MethodCore
28445         and Property.
28447         (RegisterRequiredImplementations) BindingFlags.Public requires
28448         either BindingFlags.Instace or Static.  Use instance here.
28450         (Property): Refactored code to cope better with the full spec.
28452         * parameter.cs (GetParameterInfo): Return an empty array instead
28453         of null on error.
28455         * class.cs (Property): Abstract or extern properties have no bodies.
28457         * parameter.cs (GetParameterInfo): return a zero-sized array.
28459         * class.cs (TypeContainer.MethodModifiersValid): Move all the
28460         method modifier validation to the typecontainer so we can reuse
28461         this on properties.
28463         (MethodCore.ParameterTypes): return an empty sized array of types.
28465         (Property.Define): Test property modifier validity.
28467         Add tests for sealed/override too.
28469         (Method.Emit): abstract or extern methods have no bodies.
28471 2001-12-14  Ravi Pratap  <ravi@ximian.com>
28473         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28474         thing.
28476         (Method::Define, ::Emit): Modify accordingly.
28478         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28480         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28482         * makefile: Pass in /unsafe.
28484 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
28486         * class.cs (MakeKey): Kill routine.
28488         * class.cs (TypeContainer.Define): Correctly define explicit
28489         method implementations (they require the full interface name plus
28490         the method name).
28492         * typemanager.cs: Deply the PtrHashtable here and stop using the
28493         lame keys.  Things work so much better.
28495         This of course broke everyone who depended on `RegisterMethod' to
28496         do the `test for existance' test.  This has to be done elsewhere.
28498         * support.cs (PtrHashtable): A hashtable that avoid comparing with
28499         the object stupid Equals method (because, that like fails all over
28500         the place).  We still do not use it.
28502         * class.cs (TypeContainer.SetRequiredInterface,
28503         TypeContainer.RequireMethods): Killed these two routines and moved
28504         all the functionality to RegisterRequiredImplementations.
28506         (TypeContainer.RegisterRequiredImplementations): This routine now
28507         registers all the implementations required in an array for the
28508         interfaces and abstract methods.  We use an array of structures
28509         which can be computed ahead of time to reduce memory usage and we
28510         also assume that lookups are cheap as most classes will not
28511         implement too many interfaces.
28513         We also avoid creating too many MethodSignatures.
28515         (TypeContainer.IsInterfaceMethod): Update and optionally does not
28516         clear the "pending" bit if we find that there are problems with
28517         the declaration.
28519         (TypeContainer.VerifyPendingMethods): Update to report errors of
28520         methods that look like implementations but are not.
28522         (TypeContainer.Define): Add support for explicit interface method
28523         implementation. 
28525 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
28527         * typemanager.cs: Keep track of the parameters here instead of
28528         being a feature of the TypeContainer.
28530         * class.cs: Drop the registration of parameters here, as
28531         InterfaceMethods are also interface declarations.
28533         * delegate.cs: Register methods with the TypeManager not only with
28534         the TypeContainer.  This code was buggy.
28536         * interface.cs: Full registation here.
28538 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
28540         * expression.cs: Remove reducer for binary expressions, it can not
28541         be done this way.
28543         * const.cs: Put here the code that used to go into constant.cs
28545         * constant.cs: Put here the code for constants, this is a new base
28546         class for Literals.
28548         * literal.cs: Make Literal derive from Constant.
28550 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
28552         * statement.cs (Return.Emit): Report error 157 if the user
28553         attempts to return from a finally block.
28555         (Return.Emit): Instead of emitting a return, jump to the end of
28556         the function.
28558         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28559         LocalBuilder to store the result of the function.  ReturnLabel is
28560         the target where we jump.
28563 2001-12-09  Radek Doulik  <rodo@ximian.com>
28565         * cs-parser.jay: remember alias in current namespace
28567         * ecore.cs (SimpleName::DoResolve): use aliases for types or
28568         namespaces
28570         * class.cs (LookupAlias): lookup alias in my_namespace
28572         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28573         aliases hashtable
28574         (LookupAlias): lookup alias in this and if needed in parent
28575         namespaces
28577 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
28579         * support.cs: 
28581         * rootcontext.cs: (ModuleBuilder) Made static, first step into
28582         making things static.  I need this to avoid passing the
28583         TypeContainer when calling ParameterType.
28585         * support.cs (InternalParameters.ParameterType): Remove ugly hack
28586         that did string manipulation to compute the type and then call
28587         GetType.  Use Parameter.ParameterType instead.
28589         * cs-tokenizer.cs: Consume the suffix for floating values.
28591         * expression.cs (ParameterReference): figure out whether this is a
28592         reference parameter or not.  Kill an extra variable by computing
28593         the arg_idx during emission.
28595         * parameter.cs (Parameters.GetParameterInfo): New overloaded
28596         function that returns whether a parameter is an out/ref value or not.
28598         (Parameter.ParameterType): The type of the parameter (base,
28599         without ref/out applied).
28601         (Parameter.Resolve): Perform resolution here.
28602         (Parameter.ExternalType): The full type (with ref/out applied).
28604         * statement.cs (Using.Emit, Using.EmitExpression): Implement
28605         support for expressions on the using statement.
28607 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
28609         * statement.cs (Using.EmitLocalVariableDecls): Split the
28610         localvariable handling of the using statement.
28612         (Block.EmitMeta): Keep track of variable count across blocks.  We
28613         were reusing slots on separate branches of blocks.
28615         (Try.Emit): Emit the general code block, we were not emitting it. 
28617         Check the type of the declaration to be an IDisposable or
28618         something that can be implicity converted to it. 
28620         Emit conversions if required.
28622         * ecore.cs (EmptyExpression): New utility class.
28623         (Expression.ImplicitConversionExists): New utility function.
28625 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
28627         * statement.cs (Using): Implement.
28629         * expression.cs (LocalVariableReference): Support read only variables.
28631         * statement.cs: Remove the explicit emit for the Leave opcode.
28632         (VariableInfo): Add a readonly field.
28634 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
28636         * ecore.cs (ConvCast): new class used to encapsulate the various
28637         explicit integer conversions that works in both checked and
28638         unchecked contexts.
28640         (Expression.ConvertNumericExplicit): Use new ConvCast class to
28641         properly generate the overflow opcodes.
28643 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28645         * statement.cs: The correct type for the EmptyExpression is the
28646         element_type, not the variable type.  Ravi pointed this out.
28648 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28650         * class.cs (Method::Define): Handle PInvoke methods specially
28651         by using DefinePInvokeMethod instead of the usual one.
28653         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28654         above to do the task of extracting information and defining the method.
28656 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28658         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28659         of the condition for string type.
28661         (Emit): Move that here. 
28663         (ArrayCreation::CheckIndices): Keep string literals in their expression
28664         form.
28666         (EmitDynamicInitializers): Handle strings appropriately.
28668 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28670         * codegen.cs (EmitContext): Replace multiple variables with a
28671         single pointer to the current Switch statement.
28673         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28674         EmitContext.
28676 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28678         * statement.cs 
28680         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28681         default'.
28683         (Foreach.Emit): Foreach on arrays was not setting
28684         up the loop variables (for break/continue).
28686         (GotoCase): Semi-implented.
28688 2001-12-03  Ravi Pratap  <ravi@ximian.com>
28690         * attribute.cs (CheckAttribute): Handle system attributes by using
28691         Attribute.GetAttributes to examine information we need.
28693         (GetValidPlaces): Same here.
28695         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28697         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28699         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28701         (Method::Define): Set appropriate flags if we have a DllImport attribute.
28703         (Method::Emit): Handle the case when we are a PInvoke method.
28705 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28707         * expression.cs: Use ResolveWithSimpleName on compound names.
28709 2001-12-02  Ravi Pratap  <ravi@ximian.com>
28711         * constant.cs (EmitConstant): Make sure we resolve the associated expression
28712         before trying to reduce it.
28714         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28716         * constant.cs (LookupConstantValue): Implement.
28718         (EmitConstant): Use the above in emitting the constant.
28720         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28721         that are user-defined by doing a LookupConstantValue on them.
28723         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28724         too, like above.
28726 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
28728         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28730         (BaseAccess.DoResolve): Implement.
28732         (MemberAccess.DoResolve): Split this routine into a
28733         ResolveMemberAccess routine that can be used independently
28735 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
28737         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28738         As that share bits of the implementation.  Is returns a boolean,
28739         while As returns the Type that is being probed.
28741 2001-12-01  Ravi Pratap  <ravi@ximian.com>
28743         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28744         instead of a Literal - much easier.
28746         (EnumInTransit): Remove - utterly useless :-)
28748         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28750         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28752         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28753         chain when we have no associated expression.
28755 2001-11-30  Ravi Pratap  <ravi@ximian.com>
28757         * constant.cs (Define): Use Location while reporting the errror.
28759         Also emit a warning when 'new' is used and there is no inherited
28760         member to hide.
28762         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
28763         populated.
28765         (LookupEnumValue): Implement to lookup an enum member's value and define it
28766         if necessary.
28768         (Populate): Re-write accordingly to use the above routine.
28770 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
28772         * expression.cs (This): Fix prototype for DoResolveLValue to
28773         override the base class DoResolveLValue.
28775         * cs-parser.cs: Report errors cs574 and cs575 (destructor
28776         declarations) 
28778         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28779         (we need to load the address of the field here).  This fixes
28780         test-22. 
28782         (FieldExpr.DoResolveLValue): Call the DoResolve
28783         function to initialize the Instance expression.
28785         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28786         correctly the GetEnumerator operation on a value type.
28788         * cs-parser.jay: Add more simple parsing error catches.
28790         * statement.cs (Switch): Add support for string switches.
28791         Handle null specially.
28793         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
28795 2001-11-28  Ravi Pratap  <ravi@ximian.com>
28797         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28799         (declare_local_constant): New helper function.
28801         * statement.cs (AddConstant): Keep a separate record of constants
28803         (IsConstant): Implement to determine if a variable is a constant.
28805         (GetConstantExpression): Implement.
28807         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28809         * statement.cs (IsVariableDefined): Re-write.
28811 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28813         * class.cs (TypeContainer::FindMembers): Look for constants
28814         in the case when we are looking for MemberTypes.Field
28816         * expression.cs (MemberAccess::DoResolve): Check that in the
28817         case we are a FieldExpr and a Literal, we are not being accessed
28818         by an instance reference.
28820         * cs-parser.jay (local_constant_declaration): Implement.
28822         (declaration_statement): Implement for constant declarations.
28824 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28826         * statement.cs (Switch): Catch double defaults.
28828         (Switch): More work on the switch() statement
28829         implementation.  It works for integral values now, need to finish
28830         string support.
28833 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28835         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28836         integer literals into other integer literals.  To be used by
28837         switch. 
28839 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28841         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28842         some memory.
28844         (EmitDynamicInitializers): Cope with the above since we extract data
28845         directly from ArrayData now.
28847         (ExpectInitializers): Keep track of whether initializers are mandatory
28848         or not.
28850         (Bounds): Make it a hashtable to prevent the same dimension being 
28851         recorded for every element in that dimension.
28853         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28854         from being found.
28856         Also fix bug which was causing the indices to be emitted in the reverse
28857         order.
28859 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28861         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28862         unfinished.  They do not work, because the underlying code is
28863         sloppy.
28865 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28867         * cs-parser.jay: Remove bogus fixme.
28869         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28870         on Switch statement.
28872 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28874         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28875         the same. 
28877         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28878         parameter. Apparently, any expression is allowed. 
28880         (ValidateInitializers): Update accordingly.
28882         (CheckIndices): Fix some tricky bugs thanks to recursion.
28884         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28885         I was being completely brain-dead.
28887         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28888         and re-write acordingly.
28890         (DelegateInvocation): Re-write accordingly.
28892         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28894         (MakeByteBlob): Handle types more correctly.
28896         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28897         initialization from expressions but it is incomplete because I am a complete
28898         Dodo :-|
28900 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28902         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28903         on If.  Basically, we have to return `true' (ie, we do return to
28904         our caller) only if both branches of the if return.
28906         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28907         short-circuit operators, handle them as short circuit operators. 
28909         (Cast.DoResolve): Resolve type.
28910         (Cast.Cast): Take an expression as the target type.
28912         * cs-parser.jay (cast_expression): Remove old hack that only
28913         allowed a limited set of types to be handled.  Now we take a
28914         unary_expression and we resolve to a type during semantic
28915         analysis.
28917         Use the grammar productions from Rhys to handle casts (this is
28918         not complete like Rhys syntax yet, we fail to handle that corner
28919         case that C# has regarding (-x), but we will get there.
28921 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28923         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28924         field which is an array type.
28926         * cs-parser.jay (declare_local_variables): Support array initialization too.
28928         * typemanager.cs (MakeKey): Implement.
28930         (everywhere): Use the above appropriately.
28932         * cs-parser.jay (for_statement): Update for array initialization while
28933         declaring variables.
28935         * ecore.cs : The error message was correct, it's the variable's names that
28936         were misleading ;-) Make the code more readable.
28938         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28939         the correct type etc.
28941         (ConvertExplicit): Handle Enum types by examining the underlying type.
28943 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28945         * parameter.cs (GetCallingConvention): Always return
28946         CallingConventions.Standard for now.
28948 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28950         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28951         and `r' after calling DoNumericPromotions.
28953         * ecore.cs: Fix error message (the types were in the wrong order).
28955         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28956         BindingFlags.Instance as well 
28958         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28959         implicit int literal conversion in an empty cast so that we
28960         propagate the right type upstream.
28962         (UnboxCast): new class used to unbox value types.
28963         (Expression.ConvertExplicit): Add explicit type conversions done
28964         by unboxing.
28966         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28967         the target type before applying the implicit LongLiterals to ULong
28968         literal cast.
28970 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28972         * cs-parser.jay (for_statement): Reworked the way For works: now
28973         we declare manually any variables that are introduced in
28974         for_initializer to solve the problem of having out-of-band code
28975         emition (that is what got for broken).
28977         (declaration_statement): Perform the actual variable declaration
28978         that used to be done in local_variable_declaration here.
28980         (local_variable_declaration): Do not declare anything, just pass
28981         the information on a DictionaryEntry
28983 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28985         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28986         re-write of the logic to now make it recursive.
28988         (UpdateIndices): Re-write accordingly.
28990         Store element data in a separate ArrayData list in the above methods.
28992         (MakeByteBlob): Implement to dump the array data into a byte array.
28994 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28996         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28997         into CheckIndices.
28999         * constant.cs (Define): Implement.
29001         (EmitConstant): Re-write fully.
29003         Pass in location info.
29005         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
29006         respectively.
29008         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
29009         DictionaryEntry since we need location info too.
29011         (constant_declaration): Update accordingly.
29013         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
29014         code into another method : UpdateIndices.
29016 2001-11-18  Ravi Pratap  <ravi@ximian.com>
29018         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
29019         some type checking etc.
29021 2001-11-17  Ravi Pratap  <ravi@ximian.com>
29023         * expression.cs (ArrayCreation::ValidateInitializers): Implement
29024         bits to provide dimension info if the user skips doing that.
29026         Update second constructor to store the rank correctly.
29028 2001-11-16  Ravi Pratap  <ravi@ximian.com>
29030         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
29031         and try to implement.
29033         * ../errors/cs0150.cs : Add.
29035         * ../errors/cs0178.cs : Add.
29037 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
29039         * statement.cs: Implement foreach on multi-dimensional arrays. 
29041         * parameter.cs (Parameters.GetParameterByName): Also lookup the
29042         name of the params argument.
29044         * expression.cs: Use EmitStoreOpcode to get the right opcode while
29045         initializing the array.
29047         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
29048         we can use this elsewhere.
29050         * statement.cs: Finish implementation of foreach for single
29051         dimension arrays.
29053         * cs-parser.jay: Use an out-of-band stack to pass information
29054         around, I wonder why I need this.
29056         foreach_block: Make the new foreach_block the current_block.
29058         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
29059         function used to return a static Parameters structure.  Used for
29060         empty parameters, as those are created very frequently.
29062         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
29064 2001-11-15  Ravi Pratap  <ravi@ximian.com>
29066         * interface.cs : Default modifier is private, not public. The
29067         make verify test passes again.
29069 2001-11-15  Ravi Pratap  <ravi@ximian.com>
29071         * support.cs (ReflectionParameters): Fix logic to determine
29072         whether the last parameter is a params one. Test 9 passes again.
29074         * delegate.cs (Populate): Register the builders we define with
29075         RegisterParameterForBuilder. Test 19 passes again.
29077         * cs-parser.jay (property_declaration): Reference $6 instead
29078         of $$ to get at the location.
29080         (indexer_declaration): Similar stuff.
29082         (attribute): Ditto.
29084         * class.cs (Property): Register parameters for the Get and Set methods
29085         if they exist. Test 23 passes again.
29087         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
29088         call to EmitArguments as we are sure there aren't any params arguments. 
29089         Test 32 passes again.
29091         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
29092         IndexOutOfRangeException. 
29094         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
29095         Test 33 now passes again.
29097 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
29099         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
29100         broke a bunch of things.  Will have to come up with a better way
29101         of tracking locations.
29103         * statement.cs: Implemented foreach for single dimension arrays.
29105 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29107         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
29108         an error.  This removes the lookup from the critical path.
29110         * cs-parser.jay: Removed use of temporary_loc, which is completely
29111         broken. 
29113 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
29115         * support.cs (ReflectionParameters.ParameterModifier): Report
29116         whether the argument is a PARAMS argument or not.
29118         * class.cs: Set the attribute `ParamArrayAttribute' on the
29119         parameter argument.
29121         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
29122         and cons_param_array_attribute (ConstructorInfo for
29123         ParamArrayAttribute)., 
29125         * codegen.cs: Emit the return using the `Return' statement, that
29126         way we can report the error correctly for missing return values. 
29128         * class.cs (Method.Emit): Clean up.
29130         * expression.cs (Argument.Resolve): Take another argument: the
29131         location where this argument is used.  Notice that this is not
29132         part of the "Argument" class as to reduce the size of the
29133         structure (we know the approximate location anyways).
29135         Test if the argument is a variable-reference, if not, then
29136         complain with a 206.
29138         (Argument.Emit): Emit addresses of variables.
29140         (Argument.FullDesc): Simplify.
29142         (Invocation.DoResolve): Update for Argument.Resolve.
29144         (ElementAccess.DoResolve): ditto.
29146         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
29147         method should be virtual, as this method is always virtual.
29149         (NewDelegate.DoResolve): Update for Argument.Resolve.
29151         * class.cs (ConstructorInitializer.DoResolve): ditto.
29153         * attribute.cs (Attribute.Resolve): ditto.
29155 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
29157         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
29159         * expression.cs (ParameterReference): Drop IStackStorage and implement
29160         IAssignMethod instead. 
29162         (LocalVariableReference): ditto.
29164         * ecore.cs (FieldExpr): Drop IStackStorage and implement
29165         IAssignMethod instead. 
29167 2001-11-13  Miguel de Icaza <miguel@ximian.com>
29169         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
29170         enumerations that are used in heavily used structures derive from
29171         byte in a laughable and pathetic attempt to reduce memory usage.
29172         This is the kind of pre-optimzations that you should not do at
29173         home without adult supervision.
29175         * expression.cs (UnaryMutator): New class, used to handle ++ and
29176         -- separatedly from the other unary operators.  Cleans up the
29177         code, and kills the ExpressionStatement dependency in Unary.
29179         (Unary): Removed `method' and `Arguments' from this class, making
29180         it smaller, and moving it all to SimpleCall, so I can reuse this
29181         code in other locations and avoid creating a lot of transient data
29182         strucutres when not required.
29184         * cs-parser.jay: Adjust for new changes.
29186 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
29188         * enum.cs (Enum.Populate): If there is a failure during
29189         definition, return
29191         * cs-parser.jay (opt_enum_base): we used to catch type errors
29192         here, but this is really incorrect.  The type error should be
29193         catched during semantic analysis.
29195 2001-12-11  Ravi Pratap  <ravi@ximian.com>
29197         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
29198         current_local_parameters as expected since I, in my stupidity, had forgotten
29199         to do this :-)
29201         * attribute.cs (GetValidPlaces): Fix stupid bug.
29203         * class.cs (Method::Emit): Perform check on applicability of attributes.
29205         (Constructor::Emit): Ditto.
29207         (Field::Emit): Ditto.
29209         (Field.Location): Store location information.
29211         (Property, Event, Indexer, Operator): Ditto.
29213         * cs-parser.jay (field_declaration): Pass in location for each field.
29215         * ../errors/cs0592.cs : Add.
29217 2001-11-12  Ravi Pratap  <ravi@ximian.com>
29219         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
29221         (InitCoreTypes): Update accordingly.
29223         (RegisterAttrType, LookupAttr): Implement.
29225         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
29226         info about the same.
29228         (Resolve): Update to populate the above as necessary.
29230         (Error592): Helper.
29232         (GetValidPlaces): Helper to the above.
29234         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29236         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29238 2001-11-12  Ravi Pratap  <ravi@ximian.com>
29240         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29242         * ../errors/cs0617.cs : Add.
29244 2001-11-11  Ravi Pratap  <ravi@ximian.com>
29246         * enum.cs (Emit): Rename to Populate to be more consistent with what
29247         we expect it to do and when exactly it is called.
29249         * class.cs, rootcontext.cs : Update accordingly.
29251         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29252         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29254         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29256         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29257         of a fieldinfo using the above, when dealing with a FieldBuilder.
29259 2001-11-10  Ravi Pratap  <ravi@ximian.com>
29261         * ../errors/cs0031.cs : Add.
29263         * ../errors/cs1008.cs : Add.
29265         * ../errrors/cs0543.cs : Add.
29267         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29268         enum type.
29270         (FindMembers): Implement.
29272         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29273         enums and delegates too.
29275         (enum_types): Rename to builder_to_enum.
29277         (delegate_types): Rename to builder_to_delegate.
29279         * delegate.cs (FindMembers): Implement.
29281 2001-11-09  Ravi Pratap  <ravi@ximian.com>
29283         * typemanager.cs (IsEnumType): Implement.
29285         * enum.cs (Emit): Re-write parts to account for the underlying type
29286         better and perform checking etc.
29288         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29289         of the underlying type.
29291         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29292         value
29294         * enum.cs (error31): Helper to report error #31.
29296         * cs-parser.jay (enum_declaration): Store location of each member too.
29298         * enum.cs (member_to_location): New hashtable. 
29300         (AddEnumMember): Update location hashtable.
29302         (Emit): Use the location of each member while reporting errors.
29304 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29306         * cs-parser.jay: A for_initializer if is a
29307         local_variable_declaration really ammount to have an implicit
29308         block with the variable declaration and no initializer for for.
29310         * statement.cs (For.Emit): Cope with null initializers.
29312         This fixes the infinite loop on for initializers.
29314 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
29316         * enum.cs: More cleanup.
29318         * ecore.cs: Remove dead code.
29320         * class.cs (Property.Emit): More simplification.
29321         (Event.Emit): ditto.
29323         Reworked to have less levels of indentation.
29325 2001-11-08  Ravi Pratap  <ravi@ximian.com>
29327         * class.cs (Property): Emit attributes.
29329         (Field): Ditto.
29331         (Event): Ditto.
29333         (Indexer): Ditto.
29335         (Operator): Ditto.
29337         * enum.cs (Emit): Ditto.
29339         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29340         Enums too.
29342         * class.cs (Field, Event, etc.): Move attribute generation into the
29343         Emit method everywhere.
29345         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29346         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29347         as we had no way of defining nested enums !
29349         * rootcontext.cs : Adjust code accordingly.
29351         * typemanager.cs (AddEnumType): To keep track of enum types separately.
29353 2001-11-07  Ravi Pratap  <ravi@ximian.com>
29355         * expression.cs (EvalConstantExpression): Move into ecore.cs
29357         * enum.cs (Enum): Rename some members and make them public and readonly
29358         according to our convention.
29360         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29361         nothing else.
29363         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29365         (Enum::Emit): Write a simple version for now which doesn't try to compute
29366         expressions. I shall modify this to be more robust in just a while.
29368         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29370         (TypeContainer::CloseType): Create the Enum types too.
29372         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29374         * expression.cs (EvalConstantExpression): Get rid of completely.
29376         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29377         user-defined values and other cases.
29379         (IsValidEnumLiteral): Helper function.
29381         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
29382         out there in the case we had a literal FieldExpr.
29384         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29386         (Literalize): Revamp a bit to take two arguments.
29388         (EnumLiteral): New class which derives from Literal to wrap enum literals.
29390 2001-11-06  Ravi Pratap  <ravi@ximian.com>
29392         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29394         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29396         (Resolve): Use the above to ensure we have proper initializers.
29398 2001-11-05  Ravi Pratap  <ravi@ximian.com>
29400         * expression.cs (Expression::EvalConstantExpression): New method to 
29401         evaluate constant expressions.
29403         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29405 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
29407         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29408         in an array.
29410         (Binary.ResolveOperator): Handle operator != (object a, object b)
29411         and operator == (object a, object b);
29413         (Binary.DoNumericPromotions): Indicate whether the numeric
29414         promotion was possible.
29416         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29417         Implement.  
29419         Made the ArrayAccess implement interface IAssignMethod instead of
29420         IStackStore as the order in which arguments are passed reflects
29421         this.
29423         * assign.cs: Instead of using expr.ExprClass to select the way of
29424         assinging, probe for the IStackStore/IAssignMethod interfaces.
29426         * typemanager.cs: Load InitializeArray definition.
29428         * rootcontext.cs (RootContext.MakeStaticData): Used to define
29429         static data that can be used to initialize arrays. 
29431 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
29433         * expression.cs: Handle operator== and operator!= for booleans.
29435         (Conditioal.Reduce): Implement reducer for the ?: operator.
29437         (Conditional.Resolve): Implement dead code elimination.
29439         (Binary.Resolve): Catch string literals and return a new
29440         concatenated string.
29442         (Unary.Reduce): Implement reduction of unary expressions.
29444         * ecore.cs: Split out the expression core handling here.
29446         (Expression.Reduce): New method used to perform constant folding
29447         and CSE.  This is needed to support constant-expressions. 
29449         * statement.cs (Statement.EmitBoolExpression): Pass true and false
29450         targets, and optimize for !x.
29452 2001-11-04  Ravi Pratap  <ravi@ximian.com>
29454         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29455         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29456         set custom atttributes.
29458         * literal.cs (Literal::GetValue): New abstract method to return the actual
29459         value of the literal, cast as an object.
29461         (*Literal): Implement GetValue method.
29463         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29464         expressions to the arraylist but objects of type Argument.
29466         * class.cs (TypeContainer::Emit): Emit our attributes too.
29468         (Method::Emit, Constructor::Emit): Ditto.
29470         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29471         to be ignoring earlier.
29473 2001-11-03  Ravi Pratap  <ravi@ximian.com>
29475         * attribute.cs (AttributeSection::Define): Implement to do the business
29476         of constructing a CustomAttributeBuilder.
29478         (Attribute): New trivial class. Increases readability of code.  
29480         * cs-parser.jay : Update accordingly.
29482         (positional_argument_list, named_argument_list, named_argument): New rules
29484         (attribute_arguments): Use the above so that we are more correct.
29486 2001-11-02  Ravi Pratap  <ravi@ximian.com>
29488         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29489         to perform all checks for a method with a params parameter.
29491         (Invocation::OverloadResolve): Update to use the above method and therefore
29492         cope correctly with params method invocations.
29494         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
29495         params too.
29497         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29498         constructors in our parent too because we can't afford to miss out on 
29499         protected ones ;-)
29501         * attribute.cs (AttributeSection): New name for the class Attribute
29503         Other trivial changes to improve readability.
29505         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29506         use the new class names.
29508 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29510         * class.cs (Method::Define): Complete definition for params types too
29512         (Indexer::Define): Ditto.
29514         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29515         Cope everywhere with a request for info about the array parameter.
29517 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29519         * tree.cs (RecordNamespace): Fix up to check for the correct key.
29521         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
29522         local_variable_type to extract the string corresponding to the type.
29524         (local_variable_type): Fixup the action to use the new helper method.
29526         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
29527         go.
29529         * expression.cs : Clean out code which uses the above.
29531 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29533         * typemanager.cs (RegisterMethod): Check if we already have an existing key
29534         and bale out if necessary by returning a false.
29536         (RegisterProperty): Ditto.
29538         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29539         and print out appropriate error messages.
29541         * interface.cs (everywhere): Ditto.
29543         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29544         location to constructor.
29546         * class.cs (Property, Event, Indexer): Update accordingly.
29548         * ../errors/cs111.cs : Added.
29550         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29551         of a method, as laid down by the spec.
29553         (Invocation::OverloadResolve): Use the above method.
29555 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29557         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29558         now take a TypeContainer and a Parameters object.
29560         (ParameterData): Modify return type of ParameterModifier method to be 
29561         Parameter.Modifier and not a string.
29563         (ReflectionParameters, InternalParameters): Update accordingly.
29565         * expression.cs (Argument::GetParameterModifier): Same here.
29567         * support.cs (InternalParameters::ParameterType): Find a better way of determining
29568         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29569         symbol in it at all so maybe this is only for now.
29571 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29573         * support.cs (InternalParameters): Constructor now takes an extra argument 
29574         which is the actual Parameters class.
29576         (ParameterDesc): Update to provide info on ref/out modifiers.
29578         * class.cs (everywhere): Update call to InternalParameters to pass in
29579         the second argument too.
29581         * support.cs (ParameterData): Add ParameterModifier, which is a method 
29582         to return the modifier info [ref/out etc]
29584         (InternalParameters, ReflectionParameters): Implement the above.
29586         * expression.cs (Argument::ParameterModifier): Similar function to return
29587         info about the argument's modifiers.
29589         (Invocation::OverloadResolve): Update to take into account matching modifiers 
29590         too.
29592         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29593         a new SetFormalParameters object which we pass to InternalParameters.
29595 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29597         * expression.cs (NewArray): Merge into the ArrayCreation class.
29599 2001-10-29  Ravi Pratap  <ravi@ximian.com>
29601         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
29602         NewUserdefinedArray into one as there wasn't much of a use in having
29603         two separate ones.
29605         * expression.cs (Argument): Change field's name to ArgType from Type.
29607         (Type): New readonly property which returns the proper type, taking into 
29608         account ref/out modifiers.
29610         (everywhere): Adjust code accordingly for the above.
29612         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29613         whether we are emitting for a ref or out parameter.
29615         * expression.cs (Argument::Emit): Use the above field to set the state.
29617         (LocalVariableReference::Emit): Update to honour the flag and emit the
29618         right stuff.
29620         * parameter.cs (Attributes): Set the correct flags for ref parameters.
29622         * expression.cs (Argument::FullDesc): New function to provide a full desc.
29624         * support.cs (ParameterData): Add method ParameterDesc to the interface.
29626         (ReflectionParameters, InternalParameters): Implement the above method.
29628         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29629         reporting errors.
29631         (Invocation::FullMethodDesc): Ditto. 
29633 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
29635         * cs-parser.jay: Add extra production for the second form of array
29636         creation. 
29638         * expression.cs (ArrayCreation): Update to reflect the above
29639         change. 
29641         * Small changes to prepare for Array initialization.
29643 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
29645         * typemanager.cs (ImplementsInterface): interface might be null;
29646         Deal with this problem;
29648         Also, we do store negative hits on the cache (null values), so use
29649         this instead of calling t.GetInterfaces on the type everytime.
29651 2001-10-28  Ravi Pratap  <ravi@ximian.com>
29653         * typemanager.cs (IsBuiltinType): New method to help determine the same.
29655         * expression.cs (New::DoResolve): Get rid of array creation code and instead
29656         split functionality out into different classes.
29658         (New::FormArrayType): Move into NewBuiltinArray.
29660         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29661         quite useless.
29663         (NewBuiltinArray): New class to handle creation of built-in arrays.
29665         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29666         account creation of one-dimensional arrays.
29668         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29670         (NewUserdefinedArray::DoResolve): Implement.
29672         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29674         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29675         we maintain inside the TypeManager. This is necessary to perform lookups on the
29676         module builder.
29678         (LookupType): Update to perform GetType on the module builders too.     
29680         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29682         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29684 2001-10-23  Ravi Pratap  <ravi@ximian.com>
29686         * expression.cs (New::DoResolve): Implement guts of array creation.
29688         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29690 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
29692         * expression.cs: Fix bug I introduced lsat night that broke
29693         Delegates. 
29695         (Expression.Resolve): Report a 246 error (can not resolve name)
29696         if we find a SimpleName in the stream.
29698         (Expression.ResolveLValue): Ditto.
29700         (Expression.ResolveWithSimpleName): This function is a variant of
29701         ResolveName, this one allows SimpleNames to be returned without a
29702         warning.  The only consumer of SimpleNames is MemberAccess
29704 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
29706         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29707         might arrive here.  I have my doubts that this is correct.
29709         * statement.cs (Lock): Implement lock statement.
29711         * cs-parser.jay: Small fixes to support `lock' and `using'
29713         * cs-tokenizer.cs: Remove extra space
29715         * driver.cs: New flag --checked, allows to turn on integer math
29716         checking. 
29718         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29719         Threading.Monitor.Exit 
29721 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
29723         * expression.cs (IndexerAccess::DoResolveLValue): Set the
29724         Expression Class to be IndexerAccess.
29726         Notice that Indexer::DoResolve sets the eclass to Value.
29728 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
29730         * class.cs (TypeContainer::Emit): Emit code for indexers.
29732         * assign.cs (IAssignMethod): New interface implemented by Indexers
29733         and Properties for handling assignment.
29735         (Assign::Emit): Simplify and reuse code. 
29737         * expression.cs (IndexerAccess, PropertyExpr): Implement
29738         IAssignMethod, clean up old code. 
29740 2001-10-22  Ravi Pratap  <ravi@ximian.com>
29742         * typemanager.cs (ImplementsInterface): New method to determine if a type
29743         implements a given interface. Provides a nice cache too.
29745         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29746         method.
29748         (ConvertReferenceExplicit): Ditto.
29750         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
29751         various methods, with correct names etc.
29753         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
29754         Operator.UnaryNegation.
29756         * cs-parser.jay (operator_declarator): Be a little clever in the case where
29757         we have a unary plus or minus operator.
29759         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
29760         UnaryMinus.
29762         * everywhere : update accordingly.
29764         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29765         respectively.
29767         * class.cs (Method::Define): For the case where we are implementing a method
29768         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
29769         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29771 2001-10-21  Ravi Pratap  <ravi@ximian.com>
29773         * interface.cs (FindMembers): Implement to work around S.R.E
29774         lameness.
29776         * typemanager.cs (IsInterfaceType): Implement.
29778         (FindMembers): Update to handle interface types too.
29780         * expression.cs (ImplicitReferenceConversion): Re-write bits which
29781         use IsAssignableFrom as that is not correct - it doesn't work.
29783         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29784         and accordingly override EmitStatement.
29786         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29787         using the correct logic :-)
29789 2001-10-19  Ravi Pratap  <ravi@ximian.com>
29791         * ../errors/cs-11.cs : Add to demonstrate error -11 
29793 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
29795         * assign.cs (Assign::Resolve): Resolve right hand side first, and
29796         then pass this as a hint to ResolveLValue.
29798         * expression.cs (FieldExpr): Add Location information
29800         (FieldExpr::LValueResolve): Report assignment to readonly
29801         variable. 
29803         (Expression::ExprClassFromMemberInfo): Pass location information.
29805         (Expression::ResolveLValue): Add new method that resolves an
29806         LValue. 
29808         (Expression::DoResolveLValue): Default invocation calls
29809         DoResolve. 
29811         (Indexers): New class used to keep track of indexers in a given
29812         Type. 
29814         (IStackStore): Renamed from LValue, as it did not really describe
29815         what this did.  Also ResolveLValue is gone from this interface and
29816         now is part of Expression.
29818         (ElementAccess): Depending on the element access type
29820         * typemanager.cs: Add `indexer_name_type' as a Core type
29821         (System.Runtime.CompilerServices.IndexerNameAttribute)
29823         * statement.cs (Goto): Take a location.
29825 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29827         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29828         if two delegates are compatible.
29830         (NewDelegate::DoResolve): Update to take care of the case when
29831         we instantiate a delegate from another delegate.
29833         * typemanager.cs (FindMembers): Don't even try to look up members
29834         of Delegate types for now.
29836 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29838         * delegate.cs (NewDelegate): New class to take care of delegate
29839         instantiation.
29841         * expression.cs (New): Split the delegate related code out into 
29842         the NewDelegate class.
29844         * delegate.cs (DelegateInvocation): New class to handle delegate 
29845         invocation.
29847         * expression.cs (Invocation): Split out delegate related code into
29848         the DelegateInvocation class.
29850 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29852         * expression.cs (New::DoResolve): Implement delegate creation fully
29853         and according to the spec.
29855         (New::DoEmit): Update to handle delegates differently.
29857         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29858         because of which we were printing out arguments in reverse order !
29860         * delegate.cs (VerifyMethod): Implement to check if the given method
29861         matches the delegate.
29863         (FullDelegateDesc): Implement.
29865         (VerifyApplicability): Implement.
29867         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29868         delegate invocations too.
29870         (Invocation::Emit): Ditto.
29872         * ../errors/cs1593.cs : Added.
29874         * ../errors/cs1594.cs : Added.
29876         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29878 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29880         * typemanager.cs (intptr_type): Core type for System.IntPtr
29882         (InitCoreTypes): Update for the same.
29884         (iasyncresult_type, asynccallback_type): Ditto.
29886         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29887         correct.
29889         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29890         too.
29892         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29893         the builders for the 4 members of a delegate type :-)
29895         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29896         type.
29898         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29900         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29902 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29904         * statement.cs (Break::Emit): Implement.   
29905         (Continue::Emit): Implement.
29907         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29908         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29909         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29910         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29911         end loop
29913         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29914         properties that track the label for the current loop (begin of the
29915         loop and end of the loop).
29917 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29919         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29920         use of emitting anything at all.
29922         * class.cs, rootcontext.cs : Get rid of calls to the same.
29924         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29926         (Populate): Define the constructor correctly and set the implementation
29927         attributes.
29929         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29930         have been defined.
29932         (AddDelegateType): Implement.
29934         (IsDelegateType): Implement helper method.
29936         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29938         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29939         and accordingly handle it.
29941         * delegate.cs (Populate): Take TypeContainer argument.
29942         Implement bits to define the Invoke method. However, I still haven't figured out
29943         how to take care of the native int bit :-(
29945         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29946         Qualify the name of the delegate, not its return type !
29948         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29949         conversion.
29951         (StandardConversionExists): Checking for array types turns out to be recursive.
29953         (ConvertReferenceExplicit): Implement array conversion.
29955         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29957 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29959         * cs-parser.jay (delegate_declaration): Store the fully qualified
29960         name as it is a type declaration.
29962         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29963         readonly.
29965         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29966         as TypeContainer::DefineType.
29968         (Populate): Method in which all the definition of the various methods (Invoke)
29969         etc is done.
29971         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29972         see.
29974         (CloseDelegate): Finally creates the delegate.
29976         * class.cs (TypeContainer::DefineType): Update to define delegates.
29977         (Populate, Emit and CloseType): Do the same thing here too.
29979         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29980         delegates in all these operations.
29982 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29984         * expression.cs: LocalTemporary: a new expression used to
29985         reference a temporary that has been created.
29987         * assign.cs: Handle PropertyAccess back here, so that we can
29988         provide the proper semantic access to properties.
29990         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29991         a few more explicit conversions. 
29993         * modifiers.cs: `NEW' modifier maps to HideBySig.
29995         * expression.cs (PropertyExpr): Make this into an
29996         ExpressionStatement, and support the EmitStatement code path. 
29998         Perform get/set error checking, clean up the interface.
30000         * assign.cs: recognize PropertyExprs as targets, and if so, turn
30001         them into toplevel access objects.
30003 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
30005         * expression.cs: PropertyExpr::PropertyExpr: use work around the
30006         SRE.
30008         * typemanager.cs: Keep track here of our PropertyBuilders again to
30009         work around lameness in SRE.
30011 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
30013         * expression.cs (LValue::LValueResolve): New method in the
30014         interface, used to perform a second resolution pass for LValues. 
30016         (This::DoResolve): Catch the use of this in static methods.
30018         (This::LValueResolve): Implement.
30020         (This::Store): Remove warning, assigning to `this' in structures
30021         is 
30023         (Invocation::Emit): Deal with invocation of
30024         methods on value types.  We need to pass the address to structure
30025         methods rather than the object itself.  (The equivalent code to
30026         emit "this" for structures leaves the entire structure on the
30027         stack instead of a pointer to it). 
30029         (ParameterReference::DoResolve): Compute the real index for the
30030         argument based on whether the method takes or not a `this' pointer
30031         (ie, the method is static).
30033         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
30034         value types returned from functions when we need to invoke a
30035         method on the sturcture.
30038 2001-10-11  Ravi Pratap  <ravi@ximian.com>
30040         * class.cs (TypeContainer::DefineType): Method to actually do the business of
30041         defining the type in the Modulebuilder or Typebuilder. This is to take
30042         care of nested types which need to be defined on the TypeBuilder using
30043         DefineNestedMethod.
30045         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
30046         methods in RootContext, only ported to be part of TypeContainer.
30048         (TypeContainer::GetInterfaceOrClass): Ditto.
30050         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
30052         * interface.cs (Interface::DefineInterface): New method. Does exactly
30053         what RootContext.CreateInterface did earlier, only it takes care of nested types 
30054         too.
30056         (Interface::GetInterfaces): Move from RootContext here and port.
30058         (Interface::GetInterfaceByName): Same here.
30060         * rootcontext.cs (ResolveTree): Re-write.
30062         (PopulateTypes): Re-write.
30064         * class.cs (TypeContainer::Populate): Populate nested types too.
30065         (TypeContainer::Emit): Emit nested members too.
30067         * typemanager.cs (AddUserType): Do not make use of the FullName property,
30068         instead just use the name argument passed in as it is already fully
30069         qualified.
30071         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
30072         to TypeContainer mapping to see if a type is user-defined.
30074         * class.cs (TypeContainer::CloseType): Implement. 
30076         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
30077         the default constructor.
30079         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
30080         twice.
30082         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
30084         * interface.cs (CloseType): Create the type here.
30086         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
30087         the hierarchy.
30089         Remove all the methods which are now in TypeContainer.
30091 2001-10-10  Ravi Pratap  <ravi@ximian.com>
30093         * delegate.cs (Define): Re-write bits to define the delegate
30094         correctly.
30096 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
30098         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
30100         * expression.cs (ImplicitReferenceConversion): handle null as well
30101         as a source to convert to any reference type.
30103         * statement.cs (Return): Perform any implicit conversions to
30104         expected return type.  
30106         Validate use of return statement.  
30108         * codegen.cs (EmitContext): Pass the expected return type here.
30110         * class.cs (Method, Constructor, Property): Pass expected return
30111         type to EmitContext.
30113 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
30115         * expression.cs: Make DoResolve take an EmitContext instead of a
30116         TypeContainer.
30118         Replaced `l' and `location' for `loc', for consistency.
30120         (Error, Warning): Remove unneeded Tc argument.
30122         * assign.cs, literal.cs, constant.cs: Update to new calling
30123         convention. 
30125         * codegen.cs: EmitContext now contains a flag indicating whether
30126         code is being generated in a static method or not.
30128         * cs-parser.jay: DecomposeQI, new function that replaces the old
30129         QualifiedIdentifier.  Now we always decompose the assembled
30130         strings from qualified_identifier productions into a group of
30131         memberaccesses.
30133 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
30135         * rootcontext.cs: Deal with field-less struct types correctly now
30136         by passing the size option to Define Type.
30138         * class.cs: Removed hack that created one static field. 
30140 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
30142         * statement.cs: Moved most of the code generation here. 
30144 2001-10-09  Ravi Pratap  <ravi@ximian.com>
30146         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
30147         seem very right.
30149         (ElementAccess): Remove useless bits for now - keep checks as the spec
30150         says.
30152 2001-10-08  Ravi Pratap  <ravi@ximian.com>
30154         * expression.cs (ElementAccess::DoResolve): Remove my crap code
30155         and start performing checks according to the spec.
30157 2001-10-07  Ravi Pratap  <ravi@ximian.com>
30159         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
30160         rank_specifiers instead.
30162         (rank_specifiers): Change the order in which the rank specifiers are stored
30164         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
30166         * expression.cs (ElementAccess): Implement the LValue interface too.
30168 2001-10-06  Ravi Pratap  <ravi@ximian.com>
30170         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
30171         except that user defined conversions are not included.
30173         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
30174         perform the conversion of the return type, if necessary.
30176         (New::DoResolve): Check whether we are creating an array or an object
30177         and accordingly do the needful.
30179         (New::Emit): Same here.
30181         (New::DoResolve): Implement guts of array creation.
30183         (New::FormLookupType): Helper function.
30185 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
30187         * codegen.cs: Removed most of the code generation here, and move the
30188         corresponding code generation bits to the statement classes. 
30190         Added support for try/catch/finalize and throw.
30192         * cs-parser.jay: Added support for try/catch/finalize.
30194         * class.cs: Catch static methods having the flags override,
30195         virtual or abstract.
30197         * expression.cs (UserCast): This user cast was not really doing
30198         what it was supposed to do.  Which is to be born in fully resolved
30199         state.  Parts of the resolution were being performed at Emit time! 
30201         Fixed this code.
30203 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
30205         * expression.cs: Implicity convert the result from UserCast.
30207 2001-10-05  Ravi Pratap  <ravi@ximian.com>
30209         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
30210         prevented it from working correctly. 
30212         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
30213         merely ConvertImplicit.
30215 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
30217         * typemanager.cs: Make the LookupTypeContainer function static,
30218         and not per-instance.  
30220         * class.cs: Make static FindMembers (the one that takes a Type
30221         argument). 
30223         * codegen.cs: Add EmitForeach here.
30225         * cs-parser.jay: Make foreach a toplevel object instead of the
30226         inline expansion, as we need to perform semantic analysis on it. 
30228 2001-10-05  Ravi Pratap  <ravi@ximian.com>
30230         * expression.cs (Expression::ImplicitUserConversion): Rename to
30231         UserDefinedConversion.
30233         (Expression::UserDefinedConversion): Take an extra argument specifying 
30234         whether we look for explicit user conversions too.
30236         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30238         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30240         (ExplicitUserConversion): Make it a call to UserDefinedConversion
30241         with the appropriate arguments.
30243         * cs-parser.jay (cast_expression): Record location too.
30245         * expression.cs (Cast): Record location info.
30247         (Expression::ConvertExplicit): Take location argument.
30249         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30250         to determine if we are doing explicit conversions.
30252         (UserCast::Emit): Update accordingly.
30254         (Expression::ConvertExplicit): Report an error if everything fails.
30256         * ../errors/cs0030.cs : Add.
30258 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
30260         * modifiers.cs: If the ABSTRACT keyword is present, also set the
30261         virtual and newslot bits. 
30263         * class.cs (TypeContainer::RegisterRequiredImplementations):
30264         Record methods we need.
30266         (TypeContainer::MakeKey): Helper function to make keys for
30267         MethodBases, since the Methodbase key is useless.
30269         (TypeContainer::Populate): Call RegisterRequiredImplementations
30270         before defining the methods.   
30272         Create a mapping for method_builders_to_methods ahead of time
30273         instead of inside a tight loop.
30275         (::RequireMethods):  Accept an object as the data to set into the
30276         hashtable so we can report interface vs abstract method mismatch.
30278 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30280         * report.cs: Make all of it static.
30282         * rootcontext.cs: Drop object_type and value_type computations, as
30283         we have those in the TypeManager anyways.
30285         Drop report instance variable too, now it is a global.
30287         * driver.cs: Use try/catch on command line handling.
30289         Add --probe option to debug the error reporting system with a test
30290         suite. 
30292         * report.cs: Add support for exiting program when a probe
30293         condition is reached.
30295 2001-10-03  Ravi Pratap  <ravi@ximian.com>
30297         * expression.cs (Binary::DoNumericPromotions): Fix the case when
30298         we do a forcible conversion regardless of type, to check if 
30299         ForceConversion returns a null.
30301         (Binary::error19): Use location to report error.
30303         (Unary::error23): Use location here too.
30305         * ../errors/cs0019.cs : Check in.
30307         * ../errors/cs0023.cs : Check in.
30309         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30310         case of a non-null MethodInfo object with a length of 0 !
30312         (Binary::ResolveOperator): Flag error if overload resolution fails to find
30313         an applicable member - according to the spec :-)
30314         Also fix logic to find members in base types.
30316         (Unary::ResolveOperator): Same here.
30318         (Unary::report23): Change name to error23 and make first argument a TypeContainer
30319         as I was getting thoroughly confused between this and error19 :-)
30321         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30322         (::FindMostEncompassedType): Implement.
30323         (::FindMostEncompassingType): Implement.
30324         (::StandardConversionExists): Implement.
30326         (UserImplicitCast): Re-vamp. We now need info about most specific
30327         source and target types so that we can do the necessary conversions.
30329         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30330         mathematical union with no duplicates.
30332 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30334         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30335         in order from base classes to child classes, so that we can in
30336         child classes look up in our parent for method names and
30337         attributes (required for handling abstract, virtual, new, override
30338         constructs: we need to instrospect our base class, and if we dont
30339         populate the classes in order, the introspection might be
30340         incorrect.  For example, a method could query its parent before
30341         the parent has any methods and would determine that the parent has
30342         no abstract methods (while it could have had them)).
30344         (RootContext::CreateType): Record the order in which we define the
30345         classes.
30347 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
30349         * class.cs (TypeContainer::Populate): Also method definitions can
30350         fail now, keep track of this.
30352         (TypeContainer::FindMembers): Implement support for
30353         DeclaredOnly/noDeclaredOnly flag.
30355         (Constructor::Emit) Return the ConstructorBuilder.
30357         (Method::Emit) Return the MethodBuilder. 
30358         Check for abstract or virtual methods to be public.
30360         * rootcontext.cs (RootContext::CreateType): Register all the
30361         abstract methods required for the class to be complete and the
30362         interface methods that must be implemented. 
30364         * cs-parser.jay: Report error 501 (method requires body if it is
30365         not marked abstract or extern).
30367         * expression.cs (TypeOf::Emit): Implement.
30369         * typemanager.cs: runtime_handle_type, new global type.
30371         * class.cs (Property::Emit): Generate code for properties.
30373 2001-10-02  Ravi Pratap  <ravi@ximian.com>
30375         * expression.cs (Unary::ResolveOperator): Find operators on base type
30376         too - we now conform exactly to the spec.
30378         (Binary::ResolveOperator): Same here.
30380         * class.cs (Operator::Define): Fix minor quirk in the tests.
30382         * ../errors/cs0215.cs : Added.
30384         * ../errors/cs0556.cs : Added.
30386         * ../errors/cs0555.cs : Added.
30388 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30390         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30391         single integer which is really efficient
30393 2001-10-01  Ravi Pratap  <ravi@ximian.com>
30395         *  expression.cs (Expression::ImplicitUserConversion): Use location
30396         even in the case when we are examining True operators.
30398         * class.cs (Operator::Define): Perform extensive checks to conform
30399         with the rules for operator overloading in the spec.
30401         * expression.cs (Expression::ImplicitReferenceConversion): Implement
30402         some of the other conversions mentioned in the spec.
30404         * typemanager.cs (array_type): New static member for the System.Array built-in
30405         type.
30407         (cloneable_interface): For System.ICloneable interface.
30409         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30410         we start resolving the tree and populating types.
30412         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30414 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30416         * expression.cs (Expression::ExprClassFromMemberInfo,
30417         Expression::Literalize): Create literal expressions from
30418         FieldInfos which are literals.
30420         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30421         type casts, because they were wrong.  The test suite in tests
30422         caught these ones.
30424         (ImplicitNumericConversion): ushort to ulong requires a widening
30425         cast. 
30427         Int32 constant to long requires widening cast as well.
30429         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30430         for integers because the type on the stack is not i4.
30432 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
30434         * expression.cs (report118): require location argument. 
30436         * parameter.cs: Do not dereference potential null value.
30438         * class.cs: Catch methods that lack the `new' keyword when
30439         overriding a name.  Report warnings when `new' is used without
30440         anything being there to override.
30442         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30444         * class.cs: Only add constructor to hashtable if it is non-null
30445         (as now constructors can fail on define).
30447         (TypeManager, Class, Struct): Take location arguments.
30449         Catch field instance initialization in structs as errors.
30451         accepting_filter: a new filter for FindMembers that is static so
30452         that we dont create an instance per invocation.
30454         (Constructor::Define): Catch errors where a struct constructor is
30455         parameterless 
30457         * cs-parser.jay: Pass location information for various new
30458         constructs. 
30460         * delegate.cs (Delegate): take a location argument.
30462         * driver.cs: Do not call EmitCode if there were problesm in the
30463         Definition of the types, as many Builders wont be there. 
30465         * decl.cs (Decl::Decl): Require a location argument.
30467         * cs-tokenizer.cs: Handle properly hex constants that can not fit
30468         into integers, and find the most appropiate integer for it.
30470         * literal.cs: Implement ULongLiteral.
30472         * rootcontext.cs: Provide better information about the location of
30473         failure when CreateType fails.
30475 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
30477         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30478         as well.
30480         * expression.cs (Binary::CheckShiftArguments): Add missing type
30481         computation.
30482         (Binary::ResolveOperator): Add type to the logical and and logical
30483         or, Bitwise And/Or and Exclusive Or code paths, it was missing
30484         before.
30486         (Binary::DoNumericPromotions): In the case where either argument
30487         is ulong (and most signed types combined with ulong cause an
30488         error) perform implicit integer constant conversions as well.
30490 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30492         * expression.cs (UserImplicitCast): Method should always be
30493         non-null. 
30494         (Invocation::BetterConversion): Simplified test for IntLiteral.
30496         (Expression::ImplicitNumericConversion): Split this routine out.
30497         Put the code that performs implicit constant integer conversions
30498         here. 
30500         (Expression::Resolve): Become a wrapper around DoResolve so we can
30501         check eclass and type being set after resolve.
30503         (Invocation::Badness): Remove this dead function
30505         (Binary::ResolveOperator): Do not compute the expensive argumnets
30506         unless we have a union for it.
30508         (Probe::Emit): Is needs to do an isinst and then
30509         compare against null.
30511         (::CanConvert): Added Location argument.  If the Location argument
30512         is null (Location.Null), then we do not report errors.  This is
30513         used by the `probe' mechanism of the Explicit conversion.  We do
30514         not want to generate an error for something that the user
30515         explicitly requested to be casted.  But the pipeline for an
30516         explicit cast first tests for potential implicit casts.
30518         So for now, if the Location is null, it means `Probe only' to
30519         avoid adding another argument.   Might have to revise this
30520         strategy later.
30522         (ClassCast): New class used to type cast objects into arbitrary
30523         classes (used in Explicit Reference Conversions).
30525         Implement `as' as well.
30527         Reverted all the patches from Ravi below: they were broken:
30529                 * The use of `level' as a mechanism to stop recursive
30530                   invocations is wrong.  That was there just to catch the
30531                   bug with a strack trace but not as a way of addressing
30532                   the problem.
30534                   To fix the problem we have to *understand* what is going
30535                   on and the interactions and come up with a plan, not
30536                   just get things going.
30538                 * The use of the type conversion cache that I proposed
30539                   last night had an open topic: How does this work across
30540                   protection domains.  A user defined conversion might not
30541                   be public in the location where we are applying the
30542                   conversion, a different conversion might be selected
30543                   (ie, private A->B (better) but public B->A (worse),
30544                   inside A, A->B applies, but outside it, B->A will
30545                   apply).
30547                 * On top of that (ie, even if the above is solved),
30548                   conversions in a cache need to be abstract.  Ie, `To
30549                   convert from an Int to a Short use an OpcodeCast', not
30550                   `To convert from an Int to a Short use the OpcodeCast on
30551                   the variable 5' (which is what this patch was doing).
30553 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30555         * expression.cs (Invocation::ConversionExists): Re-write to use
30556         the conversion cache
30558         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30559         cache all conversions done, not just user-defined ones.
30561         (Invocation::BetterConversion): The real culprit. Use ConversionExists
30562         to determine if a conversion exists instead of acutually trying to 
30563         perform the conversion. It's faster too.
30565         (Expression::ConvertExplicit): Modify to use ConversionExists to check
30566         and only then attempt the implicit conversion.
30568 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30570         * expression.cs (ConvertImplicit): Use a cache for conversions
30571         already found. Check level of recursion and bail out if necessary.
30573 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30575         * typemanager.cs (string_concat_string_string, string_concat_object_object):
30576         Export standard methods that we expect for string operations.
30578         * statement.cs (Block::UsageWarning): Track usage of variables and
30579         report the errors for not used variables.
30581         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30582         operator. 
30584 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30586         * codegen.cs: remove unnneded code 
30588         * expression.cs: Removed BuiltinTypeAccess class
30590         Fix the order in which implicit conversions are
30591         done.  
30593         The previous fixed dropped support for boxed conversions (adding a
30594         test to the test suite now)
30596         (UserImplicitCast::CanConvert): Remove test for source being null,
30597         that code is broken.  We should not feed a null to begin with, if
30598         we do, then we should track the bug where the problem originates
30599         and not try to cover it up here.
30601         Return a resolved expression of type UserImplicitCast on success
30602         rather than true/false.  Ravi: this is what I was talking about,
30603         the pattern is to use a static method as a "constructor" for
30604         objects. 
30606         Also, do not create arguments until the very last minute,
30607         otherwise we always create the arguments even for lookups that
30608         will never be performed. 
30610         (UserImplicitCast::Resolve): Eliminate, objects of type
30611         UserImplicitCast are born in a fully resolved state. 
30613         * typemanager.cs (InitCoreTypes): Init also value_type
30614         (System.ValueType). 
30616         * expression.cs (Cast::Resolve): First resolve the child expression.
30618         (LValue): Add new method AddressOf to be used by
30619         the `&' operator.  
30621         Change the argument of Store to take an EmitContext instead of an
30622         ILGenerator, because things like FieldExpr need to be able to call
30623         their children expression to generate the instance code. 
30625         (Expression::Error, Expression::Warning): Sugar functions for
30626         reporting errors.
30628         (Expression::MemberLookup): Accept a TypeContainer instead of a
30629         Report as the first argument.
30631         (Expression::ResolvePrimary): Killed.  I still want to improve
30632         this as currently the code is just not right.
30634         (Expression::ResolveMemberAccess): Simplify, but it is still
30635         wrong. 
30637         (Unary::Resolve): Catch errors in AddressOf operators.
30639         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30640         index to a byte for the short-version, or the compiler will choose
30641         the wrong Emit call, which generates the wrong data.
30643         (ParameterReference::Emit, ::Store): same.
30645         (FieldExpr::AddressOf): Implement.
30647         * typemanager.cs: TypeManager: made public variable instead of
30648         property.
30650         * driver.cs: document --fatal.
30652         * report.cs (ErrorMessage, WarningMessage): new names for the old
30653         Error and Warning classes.
30655         * cs-parser.jay (member_access): Turn built-in access to types
30656         into a normal simplename
30658 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30660         * expression.cs (Invocation::BetterConversion): Fix to cope
30661         with q being null, since this was introducing a bug.
30663         * expression.cs (ConvertImplicit): Do built-in conversions first.
30665 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30667         * expression.cs (UserImplicitCast::Resolve): Fix bug.
30669 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30671         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30672         I had introduced long ago (what's new ?).
30674         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
30675         the work of all the checking. 
30676         (ConvertImplicit): Call CanConvert and only then create object if necessary.
30677         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30679         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30680         that is the right way. 
30682         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
30683         overloading resolution. Use everywhere instead of cutting and pasting code.
30685         (Binary::ResolveOperator): Use MakeUnionSet.
30687         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
30688         we have to convert to bool types. Not complete yet.
30690 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30692         * typemanager.cs (TypeManager::CSharpName): support ushort.
30694         * expression.cs (Expression::TryImplicitIntConversion): Attempts
30695         to provide an expression that performsn an implicit constant int
30696         conversion (section 6.1.6).
30697         (Expression::ConvertImplicitRequired): Reworked to include
30698         implicit constant expression conversions.
30700         (Expression::ConvertNumericExplicit): Finished.
30702         (Invocation::Emit): If InstanceExpression is null, then it means
30703         that we perform a call on this.
30705 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30707         * expression.cs (Unary::Emit): Remove some dead code.
30708         (Probe): Implement Resolve and Emit for `is'.
30709         (Expression::ConvertImplicitRequired): Attempt to do constant
30710         expression conversions here.  Maybe should be moved to
30711         ConvertImplicit, but I am not sure.
30712         (Expression::ImplicitLongConstantConversionPossible,
30713         Expression::ImplicitIntConstantConversionPossible): New functions
30714         that tell whether is it possible to apply an implicit constant
30715         expression conversion.
30717         (ConvertNumericExplicit): Started work on explicit numeric
30718         conversions.
30720         * cs-parser.jay: Update operator constants.
30722         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30723         (Parameters::GetSignature): Hook up VerifyArgs here.
30724         (Parameters::VerifyArgs): Verifies that no two arguments have the
30725         same name. 
30727         * class.cs (Operator): Update the operator names to reflect the
30728         ones that the spec expects (as we are just stringizing the
30729         operator names).
30731         * expression.cs (Unary::ResolveOperator): Fix bug: Use
30732         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30733         previous usage did only work for our methods.
30734         (Expression::ConvertImplicit): Handle decimal implicit numeric
30735         conversions as well.
30736         (Expression::InternalTypeConstructor): Used to invoke constructors
30737         on internal types for default promotions.
30739         (Unary::Emit): Implement special handling for the pre/post
30740         increment/decrement for overloaded operators, as they need to have
30741         the same semantics as the other operators.
30743         (Binary::ResolveOperator): ditto.
30744         (Invocation::ConversionExists): ditto.
30745         (UserImplicitCast::Resolve): ditto.
30747 2001-09-26  Ravi Pratap  <ravi@ximian.com>
30749         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30750         operator, return after emitting body. Regression tests pass again !
30752         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30753         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30754         (Invocation::OverloadResolve): Ditto.
30755         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30757         * everywhere : update calls to the above methods accordingly.
30759 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30761         * assign.cs (Assign): Make it inherit from ExpressionStatement.
30763         * expression.cs (ExpressionStatement): New base class used for
30764         expressions that can appear in statements, so that we can provide
30765         an alternate path to generate expression that do not leave a value
30766         on the stack.
30768         (Expression::Emit, and all the derivatives): We no longer return
30769         whether a value is left on the stack or not.  Every expression
30770         after being emitted leaves a single value on the stack.
30772         * codegen.cs (EmitContext::EmitStatementExpression): Use the
30773         facilties of ExpressionStatement if possible.
30775         * cs-parser.jay: Update statement_expression.
30777 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
30779         * driver.cs: Change the wording of message
30781 2001-09-25  Ravi Pratap  <ravi@ximian.com>
30783         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
30784         the type of the expression to the return type of the method if
30785         we have an overloaded operator match ! The regression tests pass again !
30786         (Unary::ResolveOperator): Ditto.
30788         * expression.cs (Invocation::ConversionExists): Correct the member lookup
30789         to find "op_Implicit", not "implicit" ;-)
30790         (UserImplicitCast): New class to take care of user-defined implicit conversions.
30791         (ConvertImplicit, ForceConversion): Take TypeContainer argument
30793         * everywhere : Correct calls to the above accordingly.
30795         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30796         (ConvertImplicit): Do user-defined conversion if it exists.
30798 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
30800         * assign.cs: track location.
30801         (Resolve): Use implicit conversions on assignment.
30803         * literal.cs: Oops.  Not good, Emit of short access values should
30804         pass (Bytes) or the wrong argument will be selected.
30806         * expression.cs (Unary::Emit): Emit code for -expr.
30808         (Unary::ResolveOperator): Handle `Substract' for non-constants
30809         (substract from zero from the non-constants).
30810         Deal with Doubles as well. 
30812         (Expression::ConvertImplicitRequired): New routine that reports an
30813         error if no implicit conversion exists. 
30815         (Invocation::OverloadResolve): Store the converted implicit
30816         expressions if we make them
30818 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30820         * class.cs (ConstructorInitializer): Take a Location argument.
30821         (ConstructorBaseInitializer): Same here.
30822         (ConstructorThisInitializer): Same here.
30824         * cs-parser.jay : Update all calls accordingly.
30826         * expression.cs (Unary, Binary, New): Take location argument.
30827         Update accordingly everywhere.
30829         * cs-parser.jay : Update all calls to the above to take a location
30830         argument.
30832         * class.cs : Ditto.
30834 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30836         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30837         (Invocation::BetterConversion): Same here
30838         (Invocation::ConversionExists): Ditto.
30840         (Invocation::ConversionExists): Implement.
30842 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30844         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30845         Also take an additional TypeContainer argument.
30847         * All over : Pass in TypeContainer as argument to OverloadResolve.
30849         * typemanager.cs (CSharpName): Update to check for the string type and return
30850         that too.
30852         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30853         a given method.
30855 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30857         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30858         (Invocation::BetterFunction): Implement.
30859         (Invocation::BetterConversion): Implement.
30860         (Invocation::ConversionExists): Skeleton, no implementation yet.
30862         Okay, things work fine !
30864 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30866         * typemanager.cs: declare and load enum_type, delegate_type and
30867         void_type. 
30869         * expression.cs (Expression::Emit): Now emit returns a value that
30870         tells whether a value is left on the stack or not.  This strategy
30871         might be reveted tomorrow with a mechanism that would address
30872         multiple assignments.
30873         (Expression::report118): Utility routine to report mismatches on
30874         the ExprClass.
30876         (Unary::Report23): Report impossible type/operator combination
30877         utility function.
30879         (Unary::IsIncrementableNumber): Whether the type can be
30880         incremented or decremented with add.
30881         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30882         complemented. 
30883         (Unary::ResolveOperator): Implement ++, !, ~,
30885         (Invocation::Emit): Deal with new Emit convetion.
30887         * All Expression derivatives: Updated their Emit method to return
30888         whether they leave values on the stack or not.
30890         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30891         stack for expressions that are statements. 
30893 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30895         * expression.cs (LValue): New interface.  Must be implemented by
30896         LValue objects.
30897         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30898         LValue interface.
30900         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30901         interface for generating code, simplifies the code.
30903 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30905         * expression.cs (everywhere): Comment out return statements in ::Resolve
30906         methods to avoid the warnings.
30908 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30910         * driver.cs (parse): Report error 2001 if we can not open the
30911         source file.
30913         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30914         not resolve it.
30916         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30917         object. 
30919         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30920         otherwise nested blocks end up with the same index.
30922         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30924         * expression.cs:  Instead of having FIXMEs in the Resolve
30925         functions, throw exceptions so it is obvious that we are facing a
30926         bug. 
30928         * cs-parser.jay (invocation_expression): Pass Location information.
30930         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30931         Use a basename for those routines because .NET does not like paths
30932         on them. 
30934         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30935         already defined.
30937 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30939         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30940         are loading the correct data types (throws an exception if not).
30941         (TypeManager::InitCoreTypes): Use CoreLookupType
30943         * expression.cs (Unary::ResolveOperator): return the child
30944         expression for expressions which are just +expr.
30945         (Unary::ResolveOperator): Return negative literals for -LITERAL
30946         expressions (otherwise they are Unary {Literal}).
30947         (Invocation::Badness): Take into account `Implicit constant
30948         expression conversions'.
30950         * literal.cs (LongLiteral): Implement long literal class.
30951         (IntLiteral): export the `Value' of the intliteral. 
30953 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30955         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30957         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30958         instead of 'Operator'
30960         * expression.cs (Binary::ResolveOperator): Update accordingly.
30961         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30962         and 'Minus'
30964         * cs-parser.jay (unary_expression): Update to use the new names.
30966         * gen-treedump.cs (GetUnary): Same here.
30968         * expression.cs (Unary::Resolve): Implement.
30969         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30970         operators are found instead of making noise ;-)
30971         (Unary::ResolveOperator): New method to do precisely the same thing which
30972         Binary::ResolveOperator does for Binary expressions.
30973         (Unary.method, .Arguments): Add.
30974         (Unary::OperName): Implement.   
30975         (Unary::ForceConversion): Copy and Paste !
30977         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30978         a unary operator.
30980         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30981         for the inbuilt operators. Only overloading works for now ;-)
30983 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30985         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30986         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30988         * expression.cs (This::Emit): Implement. 
30989         (This::Resolve): Implement.
30990         (TypeOf:Resolve): Implement.
30991         (Expression::ResolveSimpleName): Add an implicit this to instance
30992         field references. 
30993         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30994         Bind instance variable to Field expressions.
30995         (FieldExpr::Instance): New field used to track the expression that
30996         represents the object instance.
30997         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30998         binding 
30999         (FieldExpr::Emit): Implement.
31001         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
31002         the last instruction contains a return opcode to avoid generating
31003         the last `ret' instruction (this generates correct code, and it is
31004         nice to pass the peverify output).
31006         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
31007         initializer for static and instance variables.
31008         (Constructor::Emit): Allow initializer to be null in the case of
31009         static constructors.  Only emit initializer for instance
31010         constructors. 
31012         (TypeContainer::FindMembers): Return a null array if there are no
31013         matches.
31015         Also fix the code for the MemberTypes.Method branch, as it was not
31016         scanning that for operators (or tried to access null variables before).
31018         * assign.cs (Assign::Emit): Handle instance and static fields. 
31020         * TODO: Updated.
31022         * driver.cs: Stop compilation if there are parse errors.
31024         * cs-parser.jay (constructor_declaration): Provide default base
31025         initializer for non-static constructors.
31026         (constructor_declarator): Do not provide a default base
31027         initializers if none was specified.
31028         Catch the fact that constructors should not have parameters.
31030         * class.cs: Do not emit parent class initializers for static
31031         constructors, that should be flagged as an error.
31033 2001-09-18  Ravi Pratap  <ravi@ximian.com>
31035         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
31036         Move back code into TypeContainer::Populate.
31038 2001-09-18  Ravi Pratap  <ravi@ximian.com>
31040         * class.cs (TypeContainer::AddConstructor): Fix the check to
31041         compare against Name, not Basename. 
31042         (Operator::OpType): Change Plus and Minus to Add and Subtract.
31044         * cs-parser.jay : Update accordingly.
31046         * class.cs (TypeContainer::FindMembers): For the case where we are searching
31047         for methods, don't forget to look into the operators too.
31048         (RegisterMethodBuilder): Helper method to take care of this for
31049         methods, constructors and operators.
31050         (Operator::Define): Completely revamp.
31051         (Operator.OperatorMethod, MethodName): New fields.
31052         (TypeContainer::Populate): Move the registering of builders into
31053         RegisterMethodBuilder.
31054         (Operator::Emit): Re-write.
31056         * expression.cs (Binary::Emit): Comment out code path to emit method
31057         invocation stuff for the case when we have a user defined operator. I am
31058         just not able to get it right !
31060 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
31062         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
31063         argument. 
31065         (Expression::MemberLookup): Provide a version that allows to
31066         specify the MemberTypes and BindingFlags. 
31068         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
31069         so it was not fetching variable information from outer blocks.
31071         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
31072         Beforefieldinit as it was buggy.
31074         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
31075         that Ravi put here.  
31077         * class.cs (Constructor::Emit): Only emit if block is not null.
31078         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
31079         deal with this by semantically definining it as if the user had
31080         done it.
31082         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
31083         constructors as we now "emit" them at a higher level.
31085         (TypeContainer::DefineDefaultConstructor): Used to define the
31086         default constructors if none was provided.
31088         (ConstructorInitializer): Add methods Resolve and Emit. 
31090         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
31092 2001-09-17  Ravi Pratap  <ravi@ximian.com>
31094         * class.cs (TypeContainer::EmitDefaultConstructor): Register
31095         the default constructor builder with our hashtable for methodbuilders
31096         to methodcores.
31098         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
31099         and argument_count is 0 in which case we have a match.
31100         (Binary::ResolveOperator): More null checking and miscellaneous coding
31101         style cleanup.
31103 2001-09-17  Ravi Pratap  <ravi@ximian.com>
31105         * rootcontext.cs (IsNameSpace): Compare against null.
31107         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
31109         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
31110         and Unary::Operator.
31112         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
31113         accordingly.
31115         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
31116         we have overloaded operators.
31117         (Binary::ResolveOperator): Implement the part which does the operator overload
31118         resolution.
31120         * class.cs (Operator::Emit): Implement.
31121         (TypeContainer::Emit): Emit the operators we have too.
31123         * expression.cs (Binary::Emit): Update to emit the appropriate code for
31124         the case when we have a user-defined operator.
31126 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
31128         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
31130 2001-09-16  Ravi Pratap  <ravi@ximian.com>
31132         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
31133         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
31134         (Constructor::Emit): Implement.
31135         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
31136         if we have no work to do. 
31137         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
31138         Emit method.
31140         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
31141         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
31143         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
31144         of parent.parent.
31146 2001-09-15  Ravi Pratap  <ravi@ximian.com>
31148         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
31149         in the source.
31150         (Tree::RecordNamespace): Method to do what the name says ;-)
31151         (Tree::Namespaces): Property to get at the namespaces hashtable.
31153         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
31154         keep track.
31156         * rootcontext.cs (IsNamespace): Fixed it :-)
31158 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
31160         * class.cs (TypeContainer::FindMembers): Add support for
31161         constructors. 
31162         (MethodCore): New class that encapsulates both the shared aspects
31163         of a Constructor and a Method.  
31164         (Method, Constructor): Factored pieces into MethodCore.
31166         * driver.cs: Added --fatal which makes errors throw exceptions.
31167         Load System assembly as well as part of the standard library.
31169         * report.cs: Allow throwing exceptions on errors for debugging.
31171         * modifiers.cs: Do not use `parent', instead use the real type
31172         container to evaluate permission settings.
31174         * class.cs: Put Ravi's patch back in.  He is right, and we will
31175         have to cope with the
31177 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31179         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
31180         FamORAssem, not FamANDAssem.
31182 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
31184         * driver.cs: Added --parse option that only parses its input files
31185         and terminates.
31187         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
31188         incorrect.  IsTopLevel is not used to tell whether an object is
31189         root_types or not (that can be achieved by testing this ==
31190         root_types).  But to see if this is a top-level *class* (not
31191         necessarly our "toplevel" container). 
31193 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31195         * enum.cs (Enum::Define): Modify to call the Lookup method on the
31196         parent instead of a direct call to GetType.
31198 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31200         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
31201         Modifiers.TypeAttr. This should just be a call to that method.
31203         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
31204         object so that we can determine if we are top-level or not.
31206         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
31207         TypeContainer too.
31209         * enum.cs (Enum::Define): Ditto.
31211         * modifiers.cs (FieldAttr): Re-write.
31213         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
31214         (TypeContainer::HaveStaticConstructor): New property to provide access
31215         to precisely that info.
31217         * modifiers.cs (MethodAttr): Re-write.
31218         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
31220         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
31221         of top-level types as claimed.
31223 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31225         * expression.cs (MemberLookup): Fruitless attempt to lookup
31226         constructors.  Maybe I need to emit default constructors?  That
31227         might be it (currently .NET emits this for me automatically).
31228         (Invocation::OverloadResolve): Cope with Arguments == null.
31229         (Invocation::EmitArguments): new function, shared by the new
31230         constructor and us.
31231         (Invocation::Emit): Handle static and instance methods.  Emit
31232         proper call instruction for virtual or non-virtual invocations.
31233         (New::Emit): Implement.
31234         (New::Resolve): Implement.
31235         (MemberAccess:Resolve): Implement.
31236         (MethodGroupExpr::InstanceExpression): used conforming to the spec
31237         to track instances.
31238         (FieldExpr::Resolve): Set type.
31240         * support.cs: Handle empty arguments.
31241                 
31242         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31243         SimpleLookup): Auxiliary routines to help parse a qualifier
31244         identifier.  
31246         Update qualifier_identifier rule.
31248         * codegen.cs: Removed debugging messages.
31250         * class.cs: Make this a global thing, this acts just as a "key" to
31251         objects that we might have around.
31253         (Populate): Only initialize method_builders_to_methods once.
31255         * expression.cs (PropertyExpr): Initialize type from the
31256         PropertyType. 
31258         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31259         Resolve pattern.  Attempt to implicitly convert value to boolean.
31260         Emit code.
31262         * expression.cs: Set the type for the int32/int32 argument case.
31263         (Binary::ResolveOperator): Set the return type to boolean for
31264         comparission operators
31266         * typemanager.cs: Remove debugging print code.
31268         (Invocation::Resolve): resolve type.
31270         * class.cs: Allocate a MemberInfo of the correct size, as the code
31271         elsewhere depends on the test to reflect the correct contents.
31273         (Method::) Keep track of parameters, due to System.Reflection holes
31275         (TypeContainer::Populate): Keep track of MethodBuilders to Method
31276         mapping here.
31278         (TypeContainer::FindMembers): Use ArrayList and then copy an array
31279         of the exact size and return that.
31281         (Class::LookupMethodByBuilder): New function that maps
31282         MethodBuilders to its methods.  Required to locate the information
31283         on methods because System.Reflection bit us again.
31285         * support.cs: New file, contains an interface ParameterData and
31286         two implementations: ReflectionParameters and InternalParameters
31287         used to access Parameter information.  We will need to grow this
31288         as required.
31290         * expression.cs (Invocation::GetParameterData): implement a cache
31291         and a wrapper around the ParameterData creation for methods. 
31292         (Invocation::OverloadResolve): Use new code.
31294 2001-09-13  Ravi Pratap  <ravi@ximian.com>
31296         * class.cs (TypeContainer::EmitField): Remove and move into 
31297         (Field::Define): here and modify accordingly.
31298         (Field.FieldBuilder): New member.
31299         (TypeContainer::Populate): Update accordingly.
31300         (TypeContainer::FindMembers): Implement.
31302 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31304         * statement.cs: (VariableInfo::VariableType): New field to be
31305         initialized with the full type once it is resolved. 
31307 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
31309         * parameter.cs (GetParameterInfo): Use a type cache to compute
31310         things only once, and to reuse this information
31312         * expression.cs (LocalVariableReference::Emit): Implement.
31313         (OpcodeCast::Emit): fix.
31315         (ParameterReference::Resolve): Implement.
31316         (ParameterReference::Emit): Implement.
31318         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31319         that are expressions need to stay as Expressions.
31321         * typemanager.cs (CSharpName): Returns the C# name of a type if
31322         possible. 
31324         * expression.cs (Expression::ConvertImplicit): New function that
31325         implements implicit type conversions.
31327         (Expression::ImplicitReferenceConversion): Implements implicit
31328         reference conversions.
31330         (EmptyCast): New type for transparent casts.
31332         (OpcodeCast): New type for casts of types that are performed with
31333         a sequence of bytecodes.
31335         (BoxedCast): New type used for casting value types into reference
31336         types.  Emits a box opcode.
31338         (Binary::DoNumericPromotions): Implements numeric promotions of
31339         and computation of the Binary::Type.
31341         (Binary::EmitBranchable): Optimization.
31343         (Binary::Emit): Implement code emission for expressions.
31345         * typemanager.cs (TypeManager): Added two new core types: sbyte
31346         and byte.
31348 2001-09-12  Ravi Pratap  <ravi@ximian.com>
31350         * class.cs (TypeContainer::FindMembers): Method which does exactly
31351         what Type.FindMembers does, only we don't have to use reflection. No
31352         implementation yet.
31354         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31355         typecontainer objects as we need to get at them.
31356         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31358         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31359         typecontainer object.
31361         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31362         of just a Report object.
31364 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31366         * class.cs (Event::Define): Go back to using the prefixes "add_" and
31367         "remove_"
31368         (TypeContainer::Populate): Now define the delegates of the type too.
31369         (TypeContainer.Delegates): Property to access the list of delegates defined
31370         in the type.
31372         * delegates.cs (Delegate::Define): Implement partially.
31374         * modifiers.cs (TypeAttr): Handle more flags.
31376 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31378         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31379         and not <=
31380         (Operator::Define): Re-write logic to get types by using the LookupType method
31381         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31382         (Indexer::Define): Ditto.
31383         (Event::Define): Ditto.
31384         (Property::Define): Ditto.
31386 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31388         * class.cs (TypeContainer::Populate): Now define operators too. 
31389         (TypeContainer.Operators): New property to access the list of operators
31390         in a type.
31391         (Operator.OperatorMethodBuilder): New member to hold the method builder
31392         for the operator we are defining.
31393         (Operator::Define): Implement.
31395 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31397         * class.cs (Event::Define): Make the prefixes of the accessor methods
31398         addOn_ and removeOn_ 
31400         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31401         of the location being passed in too. Ideally, this should go later since all
31402         error reporting should be done through the Report object.
31404         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31405         (Populate): Iterate thru the indexers we have and define them too.
31406         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31407         for the get and set accessors.
31408         (Indexer::Define): Implement.
31410 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
31412         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
31413         my previous implementation, did not work.
31415         * typemanager.cs: Add a couple of missing types (the longs).
31417         * literal.cs: Use TypeManager.bool_type instead of getting it.
31419         * expression.cs (EventExpr): New kind of expressions.
31420         (Expressio::ExprClassFromMemberInfo): finish
31422 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
31424         * assign.cs: Emit stores to static fields differently.
31426 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31428         * Merge in changes and adjust code to tackle conflicts. Backed out my
31429         code in Assign::Resolve ;-) 
31431 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31433         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31434         instead Report.Error and also pass in the location.
31435         (CSharpParser::Lexer): New readonly property to return the reference
31436         to the Tokenizer object.
31437         (declare_local_variables): Use Report.Error with location instead of plain 
31438         old error.
31439         (CheckDef): Ditto.
31441         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31442         (Operator.CheckBinaryOperator): Ditto.
31444         * cs-parser.jay (operator_declarator): Update accordingly.
31446         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31447         (CheckBinaryOperator): Same here.
31449         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31450         on the name without any prefixes of namespace names etc. This is because we
31451         already might have something already fully qualified like 
31452         'System.Console.WriteLine'
31454         * assign.cs (Resolve): Begin implementation. Stuck ;-)
31456 2001-09-07  Ravi Pratap  <ravi@ximian.com>
31458         * cs-tokenizer.cs (location): Return a string which also contains
31459         the file name.
31461         * expression.cs (ElementAccess): New class for expressions of the
31462         type 'element access.'
31463         (BaseAccess): New class for expressions of the type 'base access.'
31464         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31465         respectively.
31467         * cs-parser.jay (element_access): Implement action.
31468         (base_access): Implement actions.
31469         (checked_expression, unchecked_expression): Implement.
31471         * cs-parser.jay (local_variable_type): Correct and implement.
31472         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31474         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31476         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31477         name and the specifiers.
31479         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31481         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
31482         making them all public ;-)
31484         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31485         class anyways.
31487 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
31489         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31490         PropertyExprs.
31491         (FieldExpr, PropertyExprs): New resolved expressions.
31492         (SimpleName::MemberStaticCheck): Perform static checks for access
31493         to non-static fields on static methods. Maybe this should be
31494         generalized for MemberAccesses. 
31495         (SimpleName::ResolveSimpleName): More work on simple name
31496         resolution. 
31498         * cs-parser.jay (primary_expression/qualified_identifier): track
31499         the parameter index.
31501         * codegen.cs (CodeGen::Save): Catch save exception, report error.
31502         (EmitContext::EmitBoolExpression): Chain to expression generation
31503         instead of temporary hack.
31504         (::EmitStatementExpression): Put generic expression code generation.
31506         * assign.cs (Assign::Emit): Implement variable assignments to
31507         local variables, parameters and fields.
31509 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
31511         * statement.cs (Block::GetVariableInfo): New method, returns the
31512         VariableInfo for a variable name in a block.
31513         (Block::GetVariableType): Implement in terms of GetVariableInfo
31515         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31516         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31518 2001-09-06  Ravi Pratap  <ravi@ximian.com>
31520         * cs-parser.jay (operator_declaration): Continue on my quest : update
31521         to take attributes argument.
31522         (event_declaration): Ditto.
31523         (enum_declaration): Ditto.
31524         (indexer_declaration): Ditto.
31526         * class.cs (Operator::Operator): Update constructor accordingly.
31527         (Event::Event): Ditto.
31529         * delegate.cs (Delegate::Delegate): Same here.
31531         * enum.cs (Enum::Enum): Same here.
31533 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31535         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31537         * ../tests/cs0658.cs : New file to demonstrate error 0658.
31539         * attribute.cs (Attributes): New class to encapsulate all attributes which were
31540         being passed around as an arraylist.
31541         (Attributes::AddAttribute): Method to add attribute sections.
31543         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31544         (struct_declaration): Update accordingly.
31545         (constant_declaration): Update.
31546         (field_declaration): Update.
31547         (method_header): Update.
31548         (fixed_parameter): Update.
31549         (parameter_array): Ditto.
31550         (property_declaration): Ditto.
31551         (destructor_declaration): Ditto.
31553         * class.cs (Struct::Struct): Update constructors accordingly.
31554         (Class::Class): Ditto.
31555         (Field::Field): Ditto.
31556         (Method::Method): Ditto.
31557         (Property::Property): Ditto.
31558         (TypeContainer::OptAttribute): update property's return type.
31560         * interface.cs (Interface.opt_attributes): New member.
31561         (Interface::Interface): Update to take the extra Attributes argument.
31563         * parameter.cs (Parameter::Parameter): Ditto.
31565         * constant.cs (Constant::Constant): Ditto.
31567         * interface.cs (InterfaceMemberBase): New OptAttributes field.
31568         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
31569         the attributes as a parameter.
31570         (InterfaceProperty): Update constructor call.
31571         (InterfaceEvent): Ditto.
31572         (InterfaceMethod): Ditto.
31573         (InterfaceIndexer): Ditto.
31575         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
31576         pass the attributes too.
31577         (interface_event_declaration): Ditto.
31578         (interface_property_declaration): Ditto.
31579         (interface_method_declaration): Ditto.
31580         (interface_declaration): Ditto.
31582 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
31584         * class.cs (Method::Define): Track the "static Main" definition to
31585         create an entry point. 
31587         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31588         EntryPoint if we find it. 
31590         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31591         (EmitContext::ig): Make this variable public.
31593         * driver.cs: Make the default output file be the first file name
31594         with the .exe extension.  
31596         Detect empty compilations
31598         Handle various kinds of output targets.  Handle --target and
31599         rename -t to --dumper.
31601         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31602         methods inherited from Expression return now an Expression.  This
31603         will is used during the tree rewriting as we resolve them during
31604         semantic analysis.
31606         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31607         the spec.  Missing entirely is the information about
31608         accessability of elements of it.
31610         (Expression::ExprClassFromMemberInfo): New constructor for
31611         Expressions that creates a fully initialized Expression based on
31612         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31613         a Type.
31615         (Invocation::Resolve): Begin implementing resolution of invocations.
31617         * literal.cs (StringLiteral):  Implement Emit.
31619 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31621         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31622         member.
31624 2001-09-04  Ravi Pratap  <ravi@ximian.com>
31626         * cs-parser.jay (attribute_arguments): Implement actions.
31627         (attribute): Fix bug in production. Implement action.
31628         (attribute_list): Implement.
31629         (attribute_target): Implement.
31630         (attribute_target_specifier, opt_target_specifier): Implement
31631         (CheckAttributeTarget): New method to check if the attribute target
31632         is valid.
31633         (attribute_section): Implement.
31634         (opt_attributes): Implement.
31636         * attribute.cs : New file to handle attributes.
31637         (Attribute): Class to hold attribute info.
31639         * cs-parser.jay (opt_attribute_target_specifier): Remove production
31640         (attribute_section): Modify production to use 2 different rules to 
31641         achieve the same thing. 1 s/r conflict down !
31642         Clean out commented, useless, non-reducing dimension_separator rules.
31644         * class.cs (TypeContainer.attributes): New member to hold list
31645         of attributes for a type.
31646         (Struct::Struct): Modify to take one more argument, the attribute list.
31647         (Class::Class): Ditto.
31648         (Field::Field): Ditto.
31649         (Method::Method): Ditto.
31650         (Property::Property): Ditto.
31652         * cs-parser.jay (struct_declaration): Update constructor call to
31653         pass in the attributes too.
31654         (class_declaration): Ditto.
31655         (constant_declaration): Ditto.
31656         (field_declaration): Ditto.
31657         (method_header): Ditto.
31658         (fixed_parameter): Ditto.
31659         (parameter_array): Ditto.
31660         (property_declaration): Ditto.
31662         * constant.cs (Constant::Constant): Update constructor similarly.
31663         Use System.Collections.
31665         * parameter.cs (Parameter::Parameter): Update as above.
31667 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31669         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31670         (TypeContainer.delegates): New member to hold list of delegates.
31672         * cs-parser.jay (delegate_declaration): Implement the action correctly 
31673         this time as I seem to be on crack ;-)
31675 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
31677         * rootcontext.cs (RootContext::IsNamespace): new function, used to
31678         tell whether an identifier represents a namespace.
31680         * expression.cs (NamespaceExpr): A namespace expression, used only
31681         temporarly during expression resolution.
31682         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31683         utility functions to resolve names on expressions.
31685 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
31687         * codegen.cs: Add hook for StatementExpressions. 
31689         * class.cs: Fix inverted test for static flag in methods.
31691 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31693         * class.cs (Operator::CheckUnaryOperator): Correct error number used
31694         to make it coincide with MS' number.
31695         (Operator::CheckBinaryOperator): Ditto.
31697         * ../errors/errors.txt : Remove error numbers added earlier.
31699         * ../errors/cs1019.cs : Test case for error # 1019
31701         * ../errros/cs1020.cs : Test case for error # 1020
31703         * cs-parser.jay : Clean out commented cruft.
31704         (dimension_separators, dimension_separator): Comment out. Ostensibly not
31705         used anywhere - non-reducing rule.
31706         (namespace_declarations): Non-reducing rule - comment out.
31708         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31709         with TypeContainer::AddEnum.
31711         * delegate.cs : New file for delegate handling classes.
31712         (Delegate): Class for declaring delegates.
31714         * makefile : Update.
31716         * cs-parser.jay (delegate_declaration): Implement.
31718 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
31720         * class.cs (Event::Define): Implement.
31721         (Event.EventBuilder): New member.
31723         * class.cs (TypeContainer::Populate): Update to define all enums and events
31724         we have.
31725         (Events): New property for the events arraylist we hold. Shouldn't we move to using
31726         readonly fields for all these cases ?
31728 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31730         * class.cs (Property): Revamp to use the convention of making fields readonly.
31731         Accordingly modify code elsewhere.
31733         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31734         the Define method of the Property class.
31736         * class.cs : Clean up applied patch and update references to variables etc. Fix 
31737         trivial bug.
31738         (TypeContainer::Populate): Update to define all the properties we have. Also
31739         define all enumerations.
31741         * enum.cs (Define): Implement.
31743 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31745         * cs-parser.jay (overloadable_operator): The semantic value is an
31746         enum of the Operator class.
31747         (operator_declarator): Implement actions.
31748         (operator_declaration): Implement.
31750         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31751         validity of definitions.
31752         (Operator::CheckBinaryOperator): Static method to check for binary operators
31753         (TypeContainer::AddOperator): New method to add an operator to a type.
31755         * cs-parser.jay (indexer_declaration): Added line to actually call the
31756         AddIndexer method so it gets added ;-)
31758         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
31759         already taken care of by the MS compiler ?  
31761 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31763         * class.cs (Operator): New class for operator declarations.
31764         (Operator::OpType): Enum for the various operators.
31766 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31768         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31769         ostensibly handle this in semantic analysis.
31771         * cs-parser.jay (general_catch_clause): Comment out
31772         (specific_catch_clauses, specific_catch_clause): Ditto.
31773         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31774         (catch_args, opt_catch_args): New productions.
31775         (catch_clause): Rewrite to use the new productions above
31776         (catch_clauses): Modify accordingly.
31777         (opt_catch_clauses): New production to use in try_statement
31778         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31779         and re-write the code in the actions to extract the specific and
31780         general catch clauses by being a little smart ;-)
31782         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31783         Hooray, try and catch statements parse fine !
31785 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31787         * statement.cs (Block::GetVariableType): Fix logic to extract the type
31788         string from the hashtable of variables.
31790         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31791         I end up making that mistake ;-)
31792         (catch_clauses): Fixed gross error which made Key and Value of the 
31793         DictionaryEntry the same : $1 !!
31795 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31797         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31799         * cs-parser.jay (event_declaration): Correct to remove the semicolon
31800         when the add and remove accessors are specified. 
31802 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31804         * cs-parser.jay (IndexerDeclaration): New helper class to hold
31805         information about indexer_declarator.
31806         (indexer_declarator): Implement actions.
31807         (parsing_indexer): New local boolean used to keep track of whether
31808         we are parsing indexers or properties. This is necessary because 
31809         implicit_parameters come into picture even for the get accessor in the 
31810         case of an indexer.
31811         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31813         * class.cs (Indexer): New class for indexer declarations.
31814         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31815         (TypeContainer::indexers): New member to hold list of indexers for the
31816         type.
31818 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31820         * cs-parser.jay (add_accessor_declaration): Implement action.
31821         (remove_accessor_declaration): Implement action.
31822         (event_accessors_declaration): Implement
31823         (variable_declarators): swap statements for first rule - trivial.
31825         * class.cs (Event): New class to hold information about event
31826         declarations.
31827         (TypeContainer::AddEvent): New method to add an event to a type
31828         (TypeContainer::events): New member to hold list of events.
31830         * cs-parser.jay (event_declaration): Implement actions.
31832 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31834         * cs-parser.jay (dim_separators): Implement. Make it a string
31835         concatenating all the commas together, just as they appear.
31836         (opt_dim_separators): Modify accordingly
31837         (rank_specifiers): Update accordingly. Basically do the same
31838         thing - instead, collect the brackets here.
31839         (opt_rank_sepcifiers): Modify accordingly.
31840         (array_type): Modify to actually return the complete type string
31841         instead of ignoring the rank_specifiers.
31842         (expression_list): Implement to collect the expressions
31843         (variable_initializer): Implement. We make it a list of expressions
31844         essentially so that we can handle the array_initializer case neatly too.
31845         (variable_initializer_list): Implement.
31846         (array_initializer): Make it a list of variable_initializers
31847         (opt_array_initializer): Modify accordingly.
31849         * expression.cs (New::NType): Add enumeration to help us
31850         keep track of whether we have an object/delegate creation
31851         or an array creation.
31852         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31853         members to hold data about array creation.
31854         (New:New): Modify to update NewType
31855         (New:New): New Overloaded contructor for the array creation
31856         case.
31858         * cs-parser.jay (array_creation_expression): Implement to call
31859         the overloaded New constructor.
31861 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31863         * class.cs (TypeContainer::Constructors): Return member
31864         constructors instead of returning null.
31866 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31868         * typemanager.cs (InitCoreTypes): Initialize the various core
31869         types after we have populated the type manager with the user
31870         defined types (this distinction will be important later while
31871         compiling corlib.dll)
31873         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31874         on Expression Classification.  Now all expressions have a method
31875         `Resolve' and a method `Emit'.
31877         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31878         generation from working.     Also add some temporary debugging
31879         code. 
31881 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31883         * codegen.cs: Lots of code generation pieces.  This is only the
31884         beginning, will continue tomorrow with more touches of polish.  We
31885         handle the fundamentals of if, while, do, for, return.  Others are
31886         trickier and I need to start working on invocations soon.
31888         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31889         s.InitStatement. 
31891         * codegen.cs (EmitContext): New struct, used during code
31892         emission to keep a context.   Most of the code generation will be
31893         here. 
31895         * cs-parser.jay: Add embedded blocks to the list of statements of
31896         this block.  So code generation proceeds in a top down fashion.
31898 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31900         * statement.cs: Add support for multiple child blocks.
31902 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31904         * codegen.cs (EmitCode): New function, will emit the code for a
31905         Block of code given a TypeContainer and its ILGenerator. 
31907         * statement.cs (Block): Standard public readonly optimization.
31908         (Block::Block constructors): Link children. 
31909         (Block::Child): Child Linker.
31910         (Block::EmitVariables): Emits IL variable declarations.
31912         * class.cs: Drop support for MethodGroups here, delay until
31913         Semantic Analysis.
31914         (Method::): Applied the same simplification that I did before, and
31915         move from Properties to public readonly fields.
31916         (Method::ParameterTypes): Returns the parameter types for the
31917         function, and implements a cache that will be useful later when I
31918         do error checking and the semantic analysis on the methods is
31919         performed.
31920         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31921         and made a method, optional argument tells whether this is a class
31922         or a structure to apply the `has-this' bit.
31923         (Method::GetCallingConvention): Implement, returns the calling
31924         convention. 
31925         (Method::Define): Defines the type, a second pass is performed
31926         later to populate the methods.
31928         (Constructor::ParameterTypes): implement a cache similar to the
31929         one on Method::ParameterTypes, useful later when we do semantic
31930         analysis. 
31932         (TypeContainer::EmitMethod):  New method.  Emits methods.
31934         * expression.cs: Removed MethodGroup class from here.
31936         * parameter.cs (Parameters::GetCallingConvention): new method.
31938 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31940         * class.cs (TypeContainer::Populate): Drop RootContext from the
31941         argument. 
31943         (Constructor::CallingConvention): Returns the calling convention.
31944         (Constructor::ParameterTypes): Returns the constructor parameter
31945         types. 
31947         (TypeContainer::AddConstructor): Keep track of default constructor
31948         and the default static constructor.
31950         (Constructor::) Another class that starts using `public readonly'
31951         instead of properties. 
31953         (Constructor::IsDefault): Whether this is a default constructor. 
31955         (Field::) use readonly public fields instead of properties also.
31957         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31958         track of static constructors;  If none is used, turn on
31959         BeforeFieldInit in the TypeAttributes. 
31961         * cs-parser.jay (opt_argument_list): now the return can be null
31962         for the cases where there are no arguments. 
31964         (constructor_declarator): If there is no implicit `base' or
31965         `this', then invoke the default parent constructor. 
31967         * modifiers.cs (MethodAttr): New static function maps a set of
31968         modifiers flags into a MethodAttributes enum
31969         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31970         MethodAttr, TypeAttr to represent the various mappings where the
31971         modifiers are used.
31972         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31974 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31976         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31977         method arguments.
31979         * interface.cs (PopulateIndexer): Implemented the code generator
31980         for interface indexers.
31982 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31984         * interface.cs (InterfaceMemberBase): Now we track the new status
31985         here.  
31987         (PopulateProperty): Implement property population.  Woohoo!  Got
31988         Methods and Properties going today. 
31990         Removed all the properties for interfaces, and replaced them with
31991         `public readonly' fields. 
31993 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31995         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31996         initialize their hashtables/arraylists only when they are needed
31997         instead of doing this always.
31999         * parameter.cs: Handle refs and out parameters.
32001         * cs-parser.jay: Use an ArrayList to construct the arguments
32002         instead of the ParameterCollection, and then cast that to a
32003         Parameter[] array.
32005         * parameter.cs: Drop the use of ParameterCollection and use
32006         instead arrays of Parameters.
32008         (GetParameterInfo): Use the Type, not the Name when resolving
32009         types. 
32011 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
32013         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
32014         and instead use public readonly fields.
32016         * class.cs: Put back walking code for type containers.
32018 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
32020         * class.cs (MakeConstant): Code to define constants.
32022         * rootcontext.cs (LookupType): New function.  Used to locate types 
32025 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
32027         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
32028         this System.Reflection code is.  Kudos to Microsoft
32030         * typemanager.cs: Implement a type cache and avoid loading all
32031         types at boot time.  Wrap in LookupType the internals.  This made
32032         the compiler so much faster.  Wow.  I rule!
32034         * driver.cs: Make sure we always load mscorlib first (for
32035         debugging purposes, nothing really important).
32037         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
32038         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
32040         * rootcontext.cs: Lookup types on their namespace;  Lookup types
32041         on namespaces that have been imported using the `using' keyword.
32043         * class.cs (TypeContainer::TypeAttr): Virtualize.
32044         (Class::TypeAttr): Return attributes suitable for this bad boy.
32045         (Struct::TypeAttr): ditto.
32046         Handle nested classes.
32047         (TypeContainer::) Remove all the type visiting code, it is now
32048         replaced with the rootcontext.cs code
32050         * rootcontext.cs (GetClassBases): Added support for structs. 
32052 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
32054         * interface.cs, statement.cs, class.cs, parameter.cs,
32055         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
32056         Drop use of TypeRefs, and use strings instead.
32058 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
32060         * rootcontext.cs: 
32062         * class.cs (Struct::Struct): set the SEALED flags after
32063         checking the modifiers.
32064         (TypeContainer::TypeAttr): new property, returns the
32065         TypeAttributes for a class.  
32067         * cs-parser.jay (type_list): Oops, list production was creating a
32068         new list of base types.
32070         * rootcontext.cs (StdLib): New property.
32071         (GetInterfaceTypeByName): returns an interface by type name, and
32072         encapsulates error handling here.
32073         (GetInterfaces): simplified.
32074         (ResolveTree): Encapsulated all the tree resolution here.
32075         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
32076         types. 
32078         * driver.cs: Add support for --nostdlib, to avoid loading the
32079         default assemblies.
32080         (Main): Do not put tree resolution here. 
32082         * rootcontext.cs: Beginning of the class resolution.
32084 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
32086         * rootcontext.cs: Provide better error reporting. 
32088         * cs-parser.jay (interface_base): set our $$ to be interfaces.
32090         * rootcontext.cs (CreateInterface): Handle the case where there
32091         are no parent interfaces.
32093         (CloseTypes): Routine to flush types at the end.
32094         (CreateInterface): Track types.
32095         (GetInterfaces): Returns an array of Types from the list of
32096         defined interfaces.
32098         * typemanager.c (AddUserType): Mechanism to track user types (puts
32099         the type on the global type hash, and allows us to close it at the
32100         end). 
32102 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
32104         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
32105         RecordInterface instead.
32107         * cs-parser.jay: Updated to reflect changes above.
32109         * decl.cs (Definition): Keep track of the TypeBuilder type that
32110         represents this type here.  Not sure we will use it in the long
32111         run, but wont hurt for now.
32113         * driver.cs: Smaller changes to accomodate the new code.
32115         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
32116         when done. 
32118         * rootcontext.cs (CreateInterface):  New method, used to create
32119         the System.TypeBuilder type for interfaces.
32120         (ResolveInterfaces): new entry point to resolve the interface
32121         hierarchy. 
32122         (CodeGen): Property, used to keep track of the code generator.
32124 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
32126         * cs-parser.jay: Add a second production for delegate_declaration
32127         with `VOID'.
32129         (enum_body): Put an opt_comma here instead of putting it on
32130         enum_body or enum_member_declarations so we can handle trailing
32131         commas on enumeration members.  Gets rid of a shift/reduce.
32133         (type_list): Need a COMMA in the middle.
32135         (indexer_declaration): Tell tokenizer to recognize get/set
32137         * Remove old targets.
32139         * Re-add the parser target.
32141 2001-07-13  Simon Cozens <simon@simon-cozens.org>
32143         * cs-parser.jay: Add precendence rules for a number of operators
32144         ot reduce the number of shift/reduce conflicts in the grammar.
32146 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
32148         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
32149         and put it here.
32151         Get rid of old crufty code.
32153         * rootcontext.cs: Use this to keep track of the parsed
32154         representation and the defined types available to the program. 
32156         * gen-treedump.cs: adjust for new convention.
32158         * type.cs: Split out the type manager, and the assembly builder
32159         from here. 
32161         * typemanager.cs: the type manager will live here now.
32163         * cil-codegen.cs: And the code generator here. 
32165 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
32167         * makefile: Fixed up for easy making.
32169 2001-07-13  Simon Cozens <simon@simon-cozens.org>
32171         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
32172         the 
32174         (unary_expression): Expand pre_increment_expression and
32175         post_decrement_expression to reduce a shift/reduce.
32177 2001-07-11  Simon Cozens
32179         * cs-tokenizer.cs: Hex numbers should begin with a 0.
32181         Improve allow_keyword_as_indent name.
32183 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
32185         * Adjustments for Beta2. 
32187 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
32189         * decl.cs: Added `Define' abstract method.
32190         (InTransit): new property, used to catch recursive definitions. 
32192         * interface.cs: Implement `Define'. 
32194         * modifiers.cs: Map Modifiers.constants to
32195         System.Reflection.TypeAttribute flags.
32197         * class.cs: Keep track of types and user-defined types.
32198         (BuilderInit): New method for creating an assembly
32199         (ResolveType): New function to launch the resolution process, only
32200         used by interfaces for now.
32202         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
32203         that are inserted into the name space. 
32205 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
32207         * ARGH.  I have screwed up my tree so many times due to the use of
32208         rsync rather than using CVS.  Going to fix this at once. 
32210         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
32211         load types.
32213 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
32215         * Experiment successful: Use System.Type rather that our own
32216         version of Type.  
32218 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
32220         * cs-parser.jay: Removed nsAliases from here.
32222         Use new namespaces, handle `using XXX;' 
32224         * namespace.cs: Reimplemented namespace handling, use a recursive
32225         definition of the class.  Now we can keep track of using clauses
32226         and catch invalid using clauses.
32228 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
32230         * gen-treedump.cs: Adapted for all the renaming.
32232         * expression.cs (Expression): this class now has a Type property
32233         which returns an expression Type.
32235         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32236         `Type', as this has a different meaning now in the base
32238 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
32240         * interface.cs, class.cs: Removed from all the sources the
32241         references to signature computation, as we can not do method
32242         signature computation during the parsing time, as we are not
32243         trying to solve at that point distinguishing:
32245         class X {
32246                 void a (Blah x) {}
32247                 void a (NS.Blah x) {}
32248         }
32250         Which depending on the context might be valid or not, as we do not
32251         know if Blah is the same thing as NS.Blah at that point.
32253         * Redid everything so the code uses TypeRefs now instead of
32254         Types.  TypeRefs are just temporary type placeholders, that need
32255         to be resolved.  They initially have a pointer to a string and the
32256         current scope in which they are used.  This is used later by the
32257         compiler to resolve the reference to an actual Type. 
32259         * DeclSpace is no longer a CIR.Type, and neither are
32260         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
32261         are all DeclSpaces, but no Types. 
32263         * type.cs (TypeRefManager): This implements the TypeRef manager,
32264         which keeps track of all the types that need to be resolved after
32265         the parsing has finished. 
32267 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
32269         * ARGH.  We are going to have to store `foreach' as a class rather
32270         than resolving it, as we need to verify error 1579 after name
32271         resolution.   *OR* we could keep a flag that says `This request to
32272         IEnumerator comes from a foreach statement' which we can then use
32273         to generate the error.
32275 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
32277         * class.cs (TypeContainer.AddMethod): we now add methods to the
32278         MethodGroup instead of the method hashtable.  
32280         * expression.cs: Add MethodGroup abstraction, which gets us one
32281         step closer to the specification in the way we handle method
32282         declarations.  
32284         * cs-parser.jay (primary_expression): qualified_identifier now
32285         tried to match up an identifier to a local variable reference or
32286         to a parameter reference.
32288         current_local_parameters is now a parser global variable that
32289         points to the current parameters for the block, used during name
32290         lookup.
32292         (property_declaration): Now creates an implicit `value' argument to
32293         the set accessor.
32295 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
32297         * parameter.cs: Do not use `param' arguments as part of the
32298         signature, per the spec.
32300 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
32302         * decl.cs: Base class for classes, structs and interfaces.  This
32303         is the "Declaration Space" 
32305         * cs-parser.jay: Use CheckDef for checking declaration errors
32306         instead of having one on each function.
32308         * class.cs: Factor out some code for handling error handling in
32309         accordance to the "Declarations" section in the "Basic Concepts"
32310         chapter in the ECMA C# spec.
32312         * interface.cs: Make all interface member classes derive from
32313         InterfaceMemberBase.
32315 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
32317         * Many things: all interfaces are parsed and generated in
32318         gen-treedump.  Support for member variables, constructors,
32319         destructors, properties, constants is there.
32321         Beginning of the IL backend, but very little done, just there for
32322         testing purposes. 
32324 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
32326         * cs-parser.jay: Fix labeled statement.
32328         * cs-tokenizer.cs (escape): Escape " and ' always.
32329         ref_line, ref_name: keep track of the line/filename as instructed
32330         by #line by the compiler.
32331         Parse #line.
32333 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
32335         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32336         to match the values in System.CodeDOM.
32338         Divid renamed to Divide.
32340         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32341         statements. 
32342         (Statements.set): remove.
32344         * System.CodeDOM/CodeCatchClause.cs: always have a valid
32345         statements. 
32347         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32348         falseStatements always have valid values. 
32350         * cs-parser.jay: Use System.CodeDOM now.