1 2009-08-13 Marek Safar <marek.safar@gmail.com>
3 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
4 Moved resolved logic from Emit to Resolve.
6 2009-08-13 Marek Safar <marek.safar@gmail.com>
8 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
9 codegen.cs: Reworked atttributes handling of ResolveContext.
11 2009-08-12 Marek Safar <marek.safar@gmail.com>
13 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
14 LookupNamespaceOrType to ResolveContext.
16 2009-08-12 Marek Safar <marek.safar@gmail.com>
18 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
19 class.cs: Removed unused parameters and methods.
21 2009-08-11 Marek Safar <marek.safar@gmail.com>
23 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
24 codegen.cs: Finding the best common type of a set of expressions for
27 2009-08-07 Marek Safar <marek.safar@gmail.com>
29 * dynamic.cs, expression.cs: More dynamic conversions.
31 2009-08-06 Miguel de Icaza <miguel@novell.com>
33 * generic.cs: This loop was incorrect, it was increment ii, but
34 checking for `i'. This was a change introduced to fix #327497,
37 * class.cs: Catch another case for cs0533 error, fixes #324782.
39 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
41 * typemanager.cs (GetGenericArguments): SRE returns null for
42 generic methods on type builder instances if they are not generic
43 themselves. For example, for Foo<int>::Bar() it returns null, but
44 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
46 2009-08-05 Marek Safar <marek.safar@gmail.com>
48 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
49 delegate.cs: Work on dynamic binding.
51 2009-08-04 Marek Safar <marek.safar@gmail.com>
53 A second fix for bug #525342
54 * class.cs: Attach partial method attributes to method
57 2009-08-03 Marek Safar <marek.safar@gmail.com>
59 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
62 * rootcontext.cs: Default to langversion v4.
64 2009-08-03 Marek Safar <marek.safar@gmail.com>
66 * pending.cs: Check return type before member info is set.
68 2009-08-03 Marek Safar <marek.safar@gmail.com>
70 * anonymous.cs: Fully initialize generic hoisted field expression.
72 2009-08-02 Miguel de Icaza <miguel@novell.com>
74 * cs-parser.jay: Flag variables declared on the interactive shell
75 as used to prevent the 168 warning about local variable not being
78 2009-07-31 Marek Safar <marek.safar@gmail.com>
80 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
81 attribute.cs: Emit dynamic export attribute.
83 2009-07-30 Marek Safar <marek.safar@gmail.com>
85 * expression.cs: More verifier work.
87 2009-07-29 Marek Safar <marek.safar@gmail.com>
89 * nullable.cs: Fixed SRE crash during corlib compilation.
91 2009-07-29 Marek Safar <marek.safar@gmail.com>
93 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
94 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
95 More TypeManager.TypeToCoreType needed.
97 2009-07-29 Marek Safar <marek.safar@gmail.com>
99 * anonymous.cs: Update after recent SRE fixes.
101 2009-07-28 Marek Safar <marek.safar@gmail.com>
103 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
104 version of GetFieldHandle for fields of generic types.
106 2009-07-27 Marek Safar <marek.safar@gmail.com>
108 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
109 ecore.cs: Add TypeManager.IsDynamicType,
110 PredefinedAttributes.Dynamic.
112 2009-07-27 Marek Safar <marek.safar@gmail.com>
114 A fix for bug #415375
115 * expression.cs: Fixed object and reference type parameter
118 2009-07-27 Marek Safar <marek.safar@gmail.com>
120 A fix for bug #525342
121 * class.cs: Attach partial method attributes to method
124 2009-07-24 Marek Safar <marek.safar@gmail.com>
126 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
129 2009-07-24 Marek Safar <marek.safar@gmail.com>
131 * anonymous.cs (MutateField): Add imported types handling.
133 2009-07-23 Marek Safar <marek.safar@gmail.com>
135 * expression.cs, delegate.cs: Moved arguments resolve into their
136 counterparts expressions. Removed argument resolve from
137 CollectionElementInitializer.
139 2009-07-23 Marek Safar <marek.safar@gmail.com>
141 A fix for bug #523683
142 * convert.cs, delegate.cs: Use common overload mechanism for method
143 group conversion check.
145 2009-07-22 Marek Safar <marek.safar@gmail.com>
147 A fix for bug #523899
148 * generics.cs: Exact type inference with other bound types.
150 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
152 Don't complain when the same type is implemented by the output
153 assembly as well as multiple referenced assemblies
154 * namespace.cs (RootNamespace.LookupTypeReflection): Add
155 'must_be_unique' flag.
156 (GlobalRootNamespace): Update to changes.
157 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
158 already have a type in hand.
160 2009-07-22 Marek Safar <marek.safar@gmail.com>
162 * expression.cs: More verifier instrumentation.
164 * statement.cs: Do proper throw expression conversion.
166 2009-07-22 Marek Safar <marek.safar@gmail.com>
168 A fix for bug #522789
169 * expression.cs: Mutate invocation return type.
171 2009-07-16 Marek Safar <marek.safar@gmail.com>
173 * anonymous.cs: Split assignable and readonly generated variable
176 2009-07-16 Marek Safar <marek.safar@gmail.com>
178 A fix for bug #521671
179 * statement.cs: Fixed crash when checking missing type.
181 2009-07-16 Marek Safar <marek.safar@gmail.com>
183 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
184 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
185 class.cs, driver.cs: Work on dynamic binding.
187 * dynamic.cs: New file.
189 * *.sources, *.proj: Updated.
191 2009-07-15 Marek Safar <marek.safar@gmail.com>
193 * expression.cs (Conditional): Avoid double Resolve.
195 2009-07-13 Marcus Griep <marcus@griep.us>
197 * ecore.cs: Fix obscure bug with resolving members of interfaces
198 that hide parent interface members. Fixes bug #444388 and corrects
201 2009-07-13 Marek Safar <marek.safar@gmail.com>
203 * expression.cs (LocalVariableReference): Bounce resolve.
205 2009-07-10 Marek Safar <marek.safar@gmail.com>
207 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
208 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
211 * support.cs: New dynamic type wrapper.
213 2009-07-08 Marek Safar <marek.safar@gmail.com>
215 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
216 typed local variable.
218 2009-07-06 Marek Safar <marek.safar@gmail.com>
220 A fix for bug #519005
221 * anonymous.cs: Use null_type as no return type placeholder.
223 2009-07-02 Marek Safar <marek.safar@gmail.com>
225 * generic.cs: Handle type inference of identical type parameters
226 with different bounds.
228 2009-07-01 Marek Safar <marek.safar@gmail.com>
230 * expression.cs, class.cs: Events variance.
232 * cs-parser.jay: Interface events error messages.
234 2009-07-01 Marek Safar <marek.safar@gmail.com>
236 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
238 2009-06-29 Marek Safar <marek.safar@gmail.com>
240 * parameter.cs, convert.cs, expression.cs, class.cs: Default
241 parameter expression can be value-type New.
243 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
245 2009-06-26 Marek Safar <marek.safar@gmail.com>
247 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
248 Implemented C# 4.0 named arguments.
250 2009-06-24 Marek Safar <marek.safar@gmail.com>
252 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
253 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
254 parameter modifier. Also fixes bug #515497.
256 2009-06-24 Marek Safar <marek.safar@gmail.com>
258 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
259 arguments expression to be implemented.
261 *.sources: Add argument.cs
263 2009-06-23 Marek Safar <marek.safar@gmail.com>
265 * parameter.cs: Moved GetParameterIndexByName to base class.
267 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
268 unused AType. Use argument's version of GetExpressionTree.
270 2009-06-22 Marek Safar <marek.safar@gmail.com>
272 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
275 2009-06-17 Marek Safar <marek.safar@gmail.com>
277 A fix for bug #514096
278 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
280 2009-06-17 Marek Safar <marek.safar@gmail.com>
282 * expression.cs: The first multi-dimensional array nested array
283 initializers was not checked.
285 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
287 2009-06-17 Marek Safar <marek.safar@gmail.com>
289 A fix for bug #513400
290 * nullable.cs (EmitEquality): Operands emit could be simplified for
291 built-in types when we now emit user operators differently.
293 2009-06-16 Marek Safar <marek.safar@gmail.com>
295 * ecore.cs: Report inaccessible delegate methods correctly.
297 2009-06-16 Marek Safar <marek.safar@gmail.com>
299 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
300 cs-parser.jay: Implemented C# 4.0 optional parameters.
302 2009-06-16 Marek Safar <marek.safar@gmail.com>
304 * driver.cs: Removed broken DefineManifestResource.
306 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
308 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
309 Use $(BOOTSTRAP_PROFILE) instead.
311 2009-06-12 Jb Evain <jbevain@novell.com>
313 * rootcontext.cs: add a Platform field.
314 * driver.cs: handle /platform.
315 * codegen.cs: pass the proper flags according to
316 the platform when saving the assembly.
318 2009-06-11 Marek Safar <marek.safar@gmail.com>
320 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
321 Add optional parameters grammar.
323 2009-06-10 Marek Safar <marek.safar@gmail.com>
325 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
326 driver.cs: Split lang version and metadata version.
328 2009-06-10 Marek Safar <marek.safar@gmail.com>
330 * decl.cs: Better overload ctor collision error message.
332 2009-06-05 Jb Evain <jbevain@novell.com>
334 * driver.cs (EmbededResource): avoid using an internal method
335 in gmcs to embed manifest resources.
337 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
339 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
340 the compiler from older mono versions (like moon's bots)
342 2009-06-04 Marek Safar <marek.safar@gmail.com>
344 * namespace.cs (LookupTypeReflection): Ignore collisions between
347 2009-06-04 Marek Safar <marek.safar@gmail.com>
349 * codegen.cs: Enabled generic type forwarders.
351 2009-06-04 Marek Safar <marek.safar@gmail.com>
353 * dmcs.*: Add another version of SRE compiler.
355 2009-06-03 Marek Safar <marek.safar@gmail.com>
357 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
358 generic-mcs.cs: Fixed variant type conversions.
360 2009-06-02 Marek Safar <marek.safar@gmail.com>
362 A fix for bug #507863
363 * codegen.cs: Fixes a crash on invalid string value attribute.
365 2009-06-01 Marek Safar <marek.safar@gmail.com>
367 A fix for bug #508334
368 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
369 cs-parser.jay: Fully import __arglist modifier.
371 2009-05-29 Marek Safar <marek.safar@gmail.com>
373 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
374 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
375 actually work with closed generic types.
377 2009-05-27 Alan McGovern <amcgovern@novell.com>
379 * class.cs, decl.cs, delegate.cs, parameter.cs:
380 Fix the build by replacing the use of 'var' with the actual type.
382 2009-05-27 Marek Safar <marek.safar@gmail.com>
384 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
385 cs-parser.jay, generic-mcs.cs: Report wrong variant types
388 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
391 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
392 Marek Safar <marek.safar@gmail.com>
394 A fix for bug #377509
395 * parameter.cs: Use predefined and not empty name for implicit
398 2009-05-21 Marek Safar <marek.safar@gmail.com>
400 * class.cs: Don't report wrong warnings for event fields.
402 2009-05-21 Marek Safar <marek.safar@gmail.com>
404 A fix for bug #504667
405 * class.cs: Check for static class using parent container instead of
408 2009-05-08 Marek Safar <marek.safar@gmail.com>
410 A fix for bug #496922
411 * expression.cs: Always use temporary variable when using object
414 2009-04-28 Marek Safar <marek.safar@gmail.com>
416 A fix for bug #495112
417 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
420 2009-04-27 Miguel de Icaza <miguel@novell.com>
422 * driver.cs: Add a flag to work as a replacement for CSC in VS.
424 2009-04-24 Miguel de Icaza <miguel@novell.com>
426 * complete.cs: No idea how gonzalo got a null in the list, but
429 2009-04-24 Miguel de Icaza <miguel@novell.com>
431 * complete.cs (CompletionElementInitializer): New completion class
432 to support completing inside a C# 3 element initializer, so this
433 allows completion for Silverlight situations where it is very
436 new TextBlock () { Fo<TAB>
438 (CompletionSimpleName): Expose the prefix that was
439 passed to the simple name.
441 * cs-parser.jay (object_or_collection_initializer): Add support
442 for element_initializers.
444 * expression.cs (CollectionOrObjectInitializers.DoResolve):
445 special case completion expressions as this method aggressively
446 collects data before it operates, and errors were being thrown
447 earlier than we were able to complete.
449 2009-04-23 Miguel de Icaza <miguel@novell.com>
451 * eval.cs: Make getcompletions silent and enable debugging output
452 if the -v option is passed.
454 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
455 Consider looking up the namespace that matches the prefix being
458 This is part of the support for allowing completions like:
459 `System.Co<TAB>' to complete to System.Console.
461 * complete.cs (CompletionSimpleName.AppendResults): Make this
464 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
466 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
467 COMPLETE_COMPLETION as internal.
469 2009-04-17 Miguel de Icaza <miguel@novell.com>
471 * complete.cs: Include namespace resolution in simple names as
472 well as global types and types in the using scope in the
475 * namespace.cs: Supporting infrastrcture to provide completions
476 based on the current using scope.
478 * eval.cs: Introduce an entry point that allows for initialization
479 to return a list of the files passed on the command line.
481 2009-04-14 Marek Safar <marek.safar@gmail.com>
483 A fix for bug #494243
484 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
486 2009-04-13 Marek Safar <marek.safar@gmail.com>
488 A fix for bug #493887
489 * statement.cs: Don't skip string multi-section with default or
490 null label when populating string hashtable.
492 2009-04-06 Marek Safar <marek.safar@gmail.com>
494 A fix for bug #492329
495 * expression.cs (New): Load variable when assigning type parameter
498 2009-04-06 Marek Safar <marek.safar@gmail.com>
500 A fix for bug #488960
501 * decl.cs: Compare MVAR types using non-null values.
503 2009-03-27 Marek Safar <marek.safar@gmail.com>
505 * typemanager.cs, expression.cs: Removed unused nullable checks.
507 2009-03-27 Marek Safar <marek.safar@gmail.com>
509 * *.cs: Removed some gmcs conditionals.
511 2009-03-26 Marek Safar <marek.safar@gmail.com>
513 * generic.cs, support.cs: Moved generics stuff out of support.cs
515 2009-03-24 Marek Safar <marek.safar@gmail.com>
517 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
520 2009-03-23 Marek Safar <marek.safar@gmail.com>
522 * attribute.cs: Consider all members for error reporting when
523 checking named arguments.
525 2009-03-23 Marek Safar <marek.safar@gmail.com>
527 A fix for bug #487625
528 * namespace.cs: Use a warning for all predefined type conflicts.
530 2009-03-23 Marek Safar <marek.safar@gmail.com>
532 A fix for bug #485706
533 * statement.cs: Explicitly type catch type argument to pass verifier
536 2009-03-22 Miguel de Icaza <miguel@novell.com>
538 Initial support to provide code completion facilities to consumers
539 of the evaluator API.
541 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
542 support the completion engine. When we reach the end of the
543 input stream instead of returning EOF, when this flag is true the
544 tokenizer instead produces:
546 One GENERATE_COMPLETION token: this token then must be
547 handled in the grammar at every point where the user
548 would likely request a completion.
550 As many COMPLETE_COMPLETION tokens as necessary. These
551 tokens are generated to assist the parser in unwinding and
552 producing a valid parse tree.
554 The parser rules do not have to be perfect, the parser needs to be
555 augmented with judicious use of GENERATE_COMPLETION tokens to
556 improve the areas where we can provide completion and the parser
557 needs to add support for COMPLETE_COMPLETION tokens in productions
560 It is common to not have enough support for COMPLETE_COMPLETION
561 under certain rules and that even if we generated the
562 GENERATE_COMPLETION token that the resulting tree will be invalid
563 due to the missing rules that support COMPLETE_COMPLETION.
565 The final EOF token is produced by having the parser notify the
566 tokenizer when it reaches the root production that the next token
569 * support.cs (CompletionResult): New Exception. This exception
570 is thrown to return the completion results when one of the special
571 completion expressions is reached.
573 This exception is thrown by the completing ExpressionStatements
574 classes that live in complete.cs
576 * complete.cs (CompletingExpression): a new base class for
577 completing expressions. This derives from the
578 ExpressionStatement class and not from Expression as it allows
579 completion to happen not only where expressions are expected in
580 the grammar, but also where statements are expected.
582 (CompletionSimpleName): A new class used to provide completions
583 for SimpleNames. This currently only resolves to local
584 variables from the evaluator context (GetVars call).
586 (CompletionMemberAccess): Implements support for completing member
589 * cs-parser.jay: Add support for completion in a few places.
591 * eval.cs (GetCompletions): New public API for the evaluator that
592 returns a list of possible completions given the input. The
593 return value is an array of completions
595 * anonymous.cs (Compatible): If the exception thrown from the
596 resolved expression is a CompletionResult exception let that one
597 through instead of printing a diagnostic error in the try/catch.
599 2009-03-22 Miguel de Icaza <miguel@novell.com>
603 * driver.cs (Main): Use Environment.Exit to quit quickly and
604 prevent the compiler from doing the usual wait for helper thread
607 This is to prevent a slowdown that was reported by Gonzalo on
610 2009-03-19 Marek Safar <marek.safar@gmail.com>
612 * ecore.cs: Load build-in types directly instead of accessing
615 2009-03-18 Marek Safar <marek.safar@gmail.com>
617 * ecore.cs: Always use unbox.any when available.
619 2009-03-18 Marek Safar <marek.safar@gmail.com>
621 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
623 2009-03-17 Marek Safar <marek.safar@gmail.com>
625 * generic.cs: Removed obsolete version of type inference.
627 2009-03-16 Marek Safar <marek.safar@gmail.com>
629 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
630 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
631 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
632 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
634 2009-03-11 Marek Safar <marek.safar@gmail.com>
636 A fix for bug #482996
637 * anonymous.cs: Make sure we are not infering return type when
638 checking type compatibility.
640 2009-03-11 Marek Safar <marek.safar@gmail.com>
642 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
643 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
644 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
645 attributes in their own structure. Needed when accessing their
646 properties before they are resolved.
648 2009-03-09 Marek Safar <marek.safar@gmail.com>
650 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
651 hashtable (~10x faster).
653 * driver.cs: Removed wrong Reset.
655 2009-03-08 Marek Safar <marek.safar@gmail.com>
657 * class.cs: Use correct common base type for unmanaged delayed
660 * rootcontext.cs: Wrap unhandled exception.
662 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
664 Make SeekableStreamReader self-tuning and arbitrarily seekable
665 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
667 (SeekableStreamReader.Position.set): Use it. Simplify logic
668 which, as a side-effect, makes it arbitrarily-seekable. Tune the
669 buffer size when the stream needs to be re-read from the beginning.
671 2009-03-05 Marek Safar <marek.safar@gmail.com>
673 A fix for bug #480100
674 * parameter.cs: A parameter is not hoisted when used directly as ET.
676 2009-03-04 Marek Safar <marek.safar@gmail.com>
678 * statement.cs: Fixed an issue when using variable is of interface
681 2009-03-03 Marek Safar <marek.safar@gmail.com>
683 A fix for bug #480319
684 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
686 2009-03-03 Marek Safar <marek.safar@gmail.com>
688 A fix for bug #480867
689 * typemanager.cs, expression.cs, ecore.cs: Changed method group
690 expression to have no valid type.
692 2009-03-03 Marek Safar <marek.safar@gmail.com>
694 A fix for bug #481258
695 * class.cs: Set extension method flag in partial container.
697 2009-03-03 Marek Safar <marek.safar@gmail.com>
699 * statement.cs, typemanager.cs: Use expression for StringEmitter.
701 * attribute.cs: Add sanity check.
703 2009-02-27 Marek Safar <marek.safar@gmail.com>
705 * class.cs: Add external constructor error.
707 2009-02-26 Marek Safar <marek.safar@gmail.com>
709 A fix for bug #475354
710 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
711 correctly user defined nullable equality operators.
713 2009-02-25 Marek Safar <marek.safar@gmail.com>
715 A fix for bug #479532
716 * expression.cs: Implement NewInitialize::AddressOf.
718 2009-02-25 Marek Safar <marek.safar@gmail.com>
720 A fix for bug #413633
721 * expression.cs: Iterate all base class-constraint types.
723 2009-02-24 Marek Safar <marek.safar@gmail.com>
725 A fix for bug #479209
726 * literal.cs: Mutate null underlying type.
728 2009-02-24 Marek Safar <marek.safar@gmail.com>
730 A fix for bug #476295
731 * convert.cs: Avoid wrapping implicitly convertible reference type.
733 2009-02-23 Marek Safar <marek.safar@gmail.com>
735 * iterators.cs: Create MemberName correctly.
737 2009-02-23 Marek Safar <marek.safar@gmail.com>
739 A fix for bug #478655
740 * literal.cs: Check also underlying null type conversion.
742 2009-02-21 Marek Safar <marek.safar@gmail.com>
744 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
746 2009-02-20 Marek Safar <marek.safar@gmail.com>
748 A fix for bug #477447
749 * statement.cs: Add reference to correct parent storey when this
750 is accessible from deep children storey (more than 1 level).
752 2009-02-19 Marek Safar <marek.safar@gmail.com>
754 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
755 * class.cs: Define base type members before setting up member cache.
757 2009-02-18 Marek Safar <marek.safar@gmail.com>
759 A fix for bug #477378
760 * nullable.cs, expression.cs, statement.cs: More precise null type
763 2009-02-18 Marek Safar <marek.safar@gmail.com>
765 A fix for bug #472805
766 * typemanager.cs, namespace.cs: Import only visible extension method
769 2009-02-18 Marek Safar <marek.safar@gmail.com>
771 A fix for bug #476895
772 * attribute.cs: Use correct resolve context for attribute type.
774 2009-02-18 Marek Safar <marek.safar@gmail.com>
776 A fix for bug #476266
777 * anonymous.cs: Mutate multi-dimensional arrays.
779 2009-02-18 Marek Safar <marek.safar@gmail.com>
781 A fix for bug #476400
782 * statement.cs, expression.cs: Removed wrong Dispose optimization.
784 2009-02-18 Marek Safar <marek.safar@gmail.com>
786 A fix for bug #476811
787 * generics.cs: Fixed null-literal check.
789 2009-02-17 Marek Safar <marek.safar@gmail.com>
791 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
792 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
793 messing with static variables.
795 2009-02-16 Marek Safar <marek.safar@gmail.com>
797 A fix for bug #475965
798 * generics.cs: Check generic parameter type after extracting from
801 2009-02-16 Marek Safar <marek.safar@gmail.com>
803 A fix for bug #475823
804 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
807 2009-02-14 Marek Safar <marek.safar@gmail.com>
809 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
810 Simplified event field definition using backing field and not
811 field builder directly.
813 * expression.cs (EmitLdArg): Optimize fast paths.
815 2009-02-13 Marek Safar <marek.safar@gmail.com>
817 A fix for bug #475327
818 * expression.cs (ArrayCreation): Don't mutate values optimized away.
820 2009-02-13 Marek Safar <marek.safar@gmail.com>
822 A fix for bug #475342
823 * cs-parser.jay: Using 'super' instead of 'base' to call base
824 constructor crashes compiler.
826 2009-02-13 Marek Safar <marek.safar@gmail.com>
828 A fix for bug #475354
829 * expression.cs (Constantify): Add nullable types.
831 * const.cs (EmitDecimalConstant): Avoid explicit cast.
833 2009-02-12 Marek Safar <marek.safar@gmail.com>
835 A fix for bug #475246
836 * expression.cs: More broken flowanalysis hacking needed.
838 2009-02-12 Marek Safar <marek.safar@gmail.com>
840 * attribute.cs: Compare only ref/out array modifiers.
842 2009-02-11 Marek Safar <marek.safar@gmail.com>
844 * statement.cs: Use member cache when looking for foreach members.
846 2009-02-11 Marek Safar <marek.safar@gmail.com>
848 * expression.cs: Don't expose internal initializer types.
850 * statement.cs: Check also explicit conversions for goto case.
852 2009-02-11 Marek Safar <marek.safar@gmail.com>
854 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
856 2009-02-10 Marek Safar <marek.safar@gmail.com>
858 * *.cs: Replace null-type with NullLiteral where appropriate.
860 2009-02-09 Marek Safar <marek.safar@gmail.com>
862 * expression.cs: Initializer of reference argument use temporary
863 variable to be verifiable.
865 * parameter.cs: Share EmitLdArg.
867 2009-02-09 Marek Safar <marek.safar@gmail.com>
869 A fix for bug #473559
870 * class.cs: Fixed: Not reporting error about nested class with the
873 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
875 Contributed under the MIT/X11 license.
877 * generic.cs: Added VerifyVariantTypeParameters which performs new
878 variance verification logic. The old logic, based on the spec, was
879 wrong because the spec is full of LIES!
881 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
883 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
886 * ecore.cs: Added calls to the new variance verification logic.
889 * delegate.cs: Removed calls to the old variance verification logic.
891 2009-02-06 Marek Safar <marek.safar@gmail.com>
893 * delegate.cs: Use cached Invoke method directly.
895 2009-02-06 Marek Safar <marek.safar@gmail.com>
897 * expression.cs: Emit expression tree for hoisted variable access.
899 2009-02-04 Marek Safar <marek.safar@gmail.com>
901 * namespace.cs: Add better extension class check.
903 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
905 * generic.cs: Fixed typeo (TypeParameter.Variacne).
907 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
909 This patch adds initial generic variance support to the compiler.
910 It is contributed under the MIT/X11 license.
912 * typemanager.cs: Modified ImplementsInterface to check variance.
913 Added VerifyVariantTypeParameters which checks the specified type to see
914 if it uses a variant type parameter as a type argument (which is not
915 allowed). Added IsVariantOf which determins if the first type is a
916 variant of the second. NOTE: This only supports reference types at
917 the moment to conform with the current level of VM support. When the
918 VM supports value types, this will follow step.
920 * generic.cs: Added the Variance enum. Added a Variance property to
921 TypeParameter and added variance support to definition phase. Added a
922 Variance property to TypeParameterName. Also check to make sure that
923 no variant types appear in generic method parameters.
925 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
926 keywords if the langversion supports it.
928 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
929 that variant types are only used in legal positions. Also added
930 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
933 * decl.cs: Construct TypeParameter with the variance information.
935 * convert.cs: Checks variance in ImplicitReferenceConversionExists
936 and ImplicitConversionStandard.
938 * rootcontext.cs: Added new "Future" language version.
940 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
941 type parameters are not used as type arguments in interface inheritance.
942 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
943 parameters are not used as method return types. In MemberBase.
944 ResolveMemberType, ensure that variant type parameters are not used
945 as type arguments. Also call VerifyNoVariantTypeParameters on every
946 set of parameters which are resolved.
948 * delegate.cs: Modified Delegate.Define to ensure that variant
949 parameters are not used as type arguments and that a contravariant
950 parameter is not used as the return type. Also call
951 VerifyNoVariantTypeParameters on the delegate parameters.
953 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
954 to specify generic variance.
956 * driver.cs: Added support for LanguageVersion.Future in the form of
957 "-langversion:future".
959 * generic-mcs.cs: Stubbed out new members in generic.cs.
961 2009-02-03 Marek Safar <marek.safar@gmail.com>
963 * class.cs, generic.cs: Emit type parameter constraints for nested
966 2009-02-02 Marek Safar <marek.safar@gmail.com>
968 A fix for bug #471213
969 * class.cs: Avoid emitting backing field for abstract event fields.
971 2009-02-01 Marek Safar <marek.safar@gmail.com>
973 A fix for bug #359731
974 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
977 2009-01-30 Marek Safar <marek.safar@gmail.com>
979 A fix for bug #470767
980 * statement.cs: Introduced BlockScopeExpression, needed when
981 expression tree conversion has to emit scope variables.
983 2009-01-29 Marek Safar <marek.safar@gmail.com>
985 * class.cs: Remove duplicate CallingConvention.
987 2009-01-29 Marek Safar <marek.safar@gmail.com>
989 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
990 when I finally found the right naming convention.
992 2009-01-29 Marek Safar <marek.safar@gmail.com>
994 * cs-tokenizer.cs: Put back different open parens optimization.
996 2009-01-28 Marek Safar <marek.safar@gmail.com>
998 A fix for bug #470227
999 * cs-tokenizer.cs: Remove too agressive parser optimization.
1001 2009-01-28 Marek Safar <marek.safar@gmail.com>
1003 A fix for bug #324319
1004 * class.cs: Remove too early base type resolve.
1006 2009-01-27 Marek Safar <marek.safar@gmail.com>
1008 A fix for bug #324319
1009 * ecore.cs: Explicitly type null when assigning to type argument to
1010 make pass verifier check.
1012 2009-01-27 Marek Safar <marek.safar@gmail.com>
1014 * anonymous.cs: Fixed recent regression when initializing captured
1017 2009-01-26 Marek Safar <marek.safar@gmail.com>
1019 A fix for bug #469019
1020 * anonymous.cs: Use all parent type parameters when instantiating
1021 nested generic storey.
1023 2009-01-26 Marek Safar <marek.safar@gmail.com>
1025 * expression.cs: Check for null instance methodgroup expression.
1027 2009-01-26 Marek Safar <marek.safar@gmail.com>
1029 A fix for bug #469244
1030 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
1031 instance inside a conditional expression.
1033 2009-01-23 Marek Safar <marek.safar@gmail.com>
1035 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
1036 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
1037 GetElementType and HasElementType. IsValueType clean up.
1039 2009-01-23 Marek Safar <marek.safar@gmail.com>
1041 * nullable.cs: Use common EmitCall.
1043 * expression.cs: Emit constraint. for virtual calls only.
1045 2009-01-23 Marek Safar <marek.safar@gmail.com>
1047 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
1048 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
1049 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
1052 2009-01-22 Jb Evain <jbevain@novell.com>
1054 * anonymous.cs: make anonymous types' ToString implementation
1055 match what csc outputs.
1057 2009-01-21 Marek Safar <marek.safar@gmail.com>
1059 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
1062 2009-01-17 Marek Safar <marek.safar@gmail.com>
1064 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
1067 2009-01-16 Marek Safar <marek.safar@gmail.com>
1069 * nullable.cs (LiftedBinaryOperator): Check for all possible null
1072 2009-01-15 Marek Safar <marek.safar@gmail.com>
1074 A fix for bug #466634
1075 * statement.cs: Add reference for nested storey when only this
1078 2009-01-15 Marek Safar <marek.safar@gmail.com>
1080 A fix for bug #466474
1081 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
1084 2009-01-15 Marek Safar <marek.safar@gmail.com>
1086 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
1087 Fixed nested stories parent referencing process. Also fixes #463985.
1089 2009-01-06 Marek Safar <marek.safar@gmail.com>
1091 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
1092 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
1093 implementation. Also fixes #463108.
1095 2009-01-05 Marek Safar <marek.safar@gmail.com>
1097 A fix for bug #416109
1098 * decl.cs: Issue correct CLSAttribute warning location.
1100 2009-01-05 Marek Safar <marek.safar@gmail.com>
1102 A fix for bug #456775
1103 * attribute.cs: Use attribute owner scope when resolving attribute
1106 2009-01-05 Marek Safar <marek.safar@gmail.com>
1108 A fix for bug #457257
1109 * decl.cs: Fixed incorrect member declaring type comparison.
1111 2009-01-05 Marek Safar <marek.safar@gmail.com>
1113 A fix for bug #460896
1114 * driver.cs: Handle /RES resources as embeddable.
1116 2009-01-05 Marek Safar <marek.safar@gmail.com>
1118 A fix for bug #462515
1119 * ecore.cs: Report inacessible members upwards.
1121 2009-01-05 Marek Safar <marek.safar@gmail.com>
1123 A fix for bug #463190, #463192
1124 * decl.cs, namespace.cs: Also import internal extension classes.
1126 2009-01-04 Marek Safar <marek.safar@gmail.com>
1128 A fix for bug #463415
1129 * generic.cs: Use right index for RemoveDependentTypes.
1131 2009-01-02 Marek Safar <marek.safar@gmail.com>
1133 A fix for bug #463196
1134 * expression.cs: Fixed enum to null comparison.
1136 2009-01-02 Marek Safar <marek.safar@gmail.com>
1138 A fix for bug #463121
1139 * nullable.cs: Fixed nullable user equality operator comparison.
1141 2009-01-02 Marek Safar <marek.safar@gmail.com>
1143 A fix for bug #462950
1144 * class.cs, decl.cs: Use full explicit name when defining automatic
1145 property backing field.
1147 2009-01-02 Marek Safar <marek.safar@gmail.com>
1149 A fix for bug #462592
1150 * pending.cs: Emit type arguments for generic proxy method.
1152 2008-12-30 Marek Safar <marek.safar@gmail.com>
1154 * expression.cs (As): Mutate all type arguments.
1156 2008-12-29 Marek Safar <marek.safar@gmail.com>
1158 A fix for bug #462622
1159 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
1162 2008-12-29 Marek Safar <marek.safar@gmail.com>
1164 A fix for bug #450782
1165 * ecore.cs: Consider more variables of form V.I to be fixed.
1167 2008-12-29 Marek Safar <marek.safar@gmail.com>
1169 A fix for bug #460712
1170 * typemanager.cs: Core types could be imported.
1172 2008-12-28 Marek Safar <marek.safar@gmail.com>
1174 A fix for bugs #460847, #460772, #458049, #457339, #447807
1175 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
1176 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
1177 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
1178 user lambdas used inside query clauses.
1180 2008-12-18 Marek Safar <marek.safar@gmail.com>
1182 A fix for bug #460229
1183 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
1185 2008-12-18 Marek Safar <marek.safar@gmail.com>
1187 A fix for bug #459952
1188 * decl.cs, namespace.cs: Use common CheckAccessLevel.
1190 2008-12-18 Marek Safar <marek.safar@gmail.com>
1192 A fix for bug #459630
1193 * convert.cs: Enum to valuetype conversion is not allowed.
1195 2008-12-18 Marek Safar <marek.safar@gmail.com>
1197 A fix for bug #457087
1198 * generic.cs: Don't crash when constraint comes from type
1201 2008-12-16 Marek Safar <marek.safar@gmail.com>
1203 A fix for bug #459221
1204 * anonymous.cs, statement.cs: Delay only captured this
1207 2008-12-12 Marek Safar <marek.safar@gmail.com>
1209 A fix for bug #457489
1210 * anonymous.cs, statement.cs: Split anonymous storey instantiation
1211 and initialization to capture scope initializers correctly.
1213 2008-12-11 Marek Safar <marek.safar@gmail.com>
1215 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
1216 ParameterReference refactoring.
1218 2008-12-03 Marek Safar <marek.safar@gmail.com>
1220 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
1221 to be imported from any assembly.
1223 2008-12-03 Marek Safar <marek.safar@gmail.com>
1225 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
1226 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
1227 from anonymous method and lambda expression.
1229 2008-12-01 Marek Safar <marek.safar@gmail.com>
1231 A fix for bug #448560
1232 * expression.cs (As): Box any generic type arguments to be
1235 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
1237 Add tripwire for implicit conversion bugs
1238 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
1240 (MethodGroupExpr.OverloadResolve): Add sanity check between
1241 IsApplicable and VerifyArgumentsCompat.
1242 (VerifyArgumentsCompat): Report CS1501 where appropriate.
1244 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
1246 Fix build break in System.Data_test
1247 * convert.cs (ImplicitConversionExists): Move NullLiteral
1249 (ImplicitStandardConversionExists): ... here.
1251 2008-11-28 Marek Safar <marek.safar@gmail.com>
1253 * literal.cs: Emit correctly explicit null to nullable cast.
1255 2008-11-28 Marek Safar <marek.safar@gmail.com>
1257 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
1260 2008-11-28 Marek Safar <marek.safar@gmail.com>
1262 A fix for bug #449005
1263 * convert.cs, nullable.cs: Use only one implicit nullable
1266 2008-11-27 Marek Safar <marek.safar@gmail.com>
1268 * convert.cs, literal.cs: More Convert cleanup is needed.
1270 2008-11-27 Marek Safar <marek.safar@gmail.com>
1272 * decl.cs, class.cs: Fixed misleading error message.
1274 2008-11-26 Marek Safar <marek.safar@gmail.com>
1276 A fix for bug #449005
1277 * nullable.cs (EmitEquality): Disable optimization for user operator
1280 2008-11-25 Marek Safar <marek.safar@gmail.com>
1282 A fix for bug #447027
1283 * anonymous.cs (HoistedVariable): Cache also outer access to deal
1284 with context variables stored as expression instances.
1286 2008-11-25 Marek Safar <marek.safar@gmail.com>
1288 A fix for bug #447027
1289 * delegate.cs: Fixed delegate VerifyMethod logic.
1291 2008-11-24 Marek Safar <marek.safar@gmail.com>
1293 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
1296 2008-11-21 Marek Safar <marek.safar@gmail.com>
1298 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
1299 member type resolve to follow normal flow, instead of random
1302 2008-11-21 Marek Safar <marek.safar@gmail.com>
1304 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
1307 2008-11-21 Marek Safar <marek.safar@gmail.com>
1309 * const.cs: Emit decimal array constant as literal.
1311 2008-11-20 Marek Safar <marek.safar@gmail.com>
1313 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
1315 2008-11-19 Marek Safar <marek.safar@gmail.com>
1317 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
1318 into real property (saves 8 MB for corlib compilation).
1320 2008-11-19 Marek Safar <marek.safar@gmail.com>
1322 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
1323 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
1324 generic-mcs.cs: Small cleanup of TypeArguments.
1326 2008-11-18 Marek Safar <marek.safar@gmail.com>
1328 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
1329 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
1330 of ConstructedType expression, renamed to GenericTypeExpr.
1332 2008-11-17 Marek Safar <marek.safar@gmail.com>
1334 A fix for bug #445303
1335 * location.cs (IsConditionalDefined): Handle undefined global
1338 2008-11-17 Marek Safar <marek.safar@gmail.com>
1340 A fix for bug #444678
1341 * expression.cs (TryReduceConstant): Always create new constant
1344 2008-11-17 Marek Safar <marek.safar@gmail.com>
1346 A fix for bug #444673
1347 * ecore.cs: Ignore open generic types when used as generic type
1350 2008-11-17 Marek Safar <marek.safar@gmail.com>
1352 A fix for bug #445458
1353 * expression.cs, cs-parser.jay: Don't crash when an expression
1356 2008-11-17 Marek Safar <marek.safar@gmail.com>
1358 A fix for bug #445464
1359 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
1360 inside unbound type.
1362 2008-11-14 Jb Evain <jbevain@novell.com>
1364 * driver.cs: ignore empty -nowarn argument such as
1365 the one in -nowarn:12,13,,.
1367 2008-11-13 Marek Safar <marek.safar@gmail.com>
1369 A fix for bug #444271
1370 * anonymous.cs: Rescan parent storeys when best candidate was
1373 2008-11-13 Marek Safar <marek.safar@gmail.com>
1375 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
1376 useless UnboundTypeExpression.
1378 * attribute.cs: Do check obsolete attribute on generic types.
1380 2008-11-12 Marek Safar <marek.safar@gmail.com>
1382 A fix for bugs #425680, #400139
1383 * ecore.cs, expression.cs: Trying to do some almost_matched_members
1386 2008-11-11 Marek Safar <marek.safar@gmail.com>
1388 A fix for bug #435747
1389 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
1390 compound value types assignment. Few micro optimizations added.
1392 2008-11-10 Marek Safar <marek.safar@gmail.com>
1394 A fix for bug #442610
1395 * anonymous.cs (MutateConstructor): More SRE hacking.
1397 2008-11-10 Marek Safar <marek.safar@gmail.com>
1399 A fix for bug #442579
1400 * ecore.cs: Also initialize expanded form of a method with 1 params
1403 2008-11-06 Marek Safar <marek.safar@gmail.com>
1405 * expression.cs (UnaryMutator): Do early l-side check.
1407 2008-11-05 Miguel de Icaza <miguel@novell.com>
1409 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1410 Init, otherwise we would crash later on when checking for friend
1413 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1414 Otherwise we never get any meaningful information as to what
1417 2008-11-05 Marek Safar <marek.safar@gmail.com>
1419 A fix for bug #436318
1420 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1422 2008-11-05 Miguel de Icaza <miguel@novell.com>
1424 * namespace.cs: Turns out that it was a really bad idea to hide
1425 the errors for namespaces not found here in eval mode.
1427 * eval.cs: When we process using clauses, only enter those into
1428 the list of valid using clauses after they have been validated.
1430 The above change gives the proper semantics: it does not
1431 senselessly report the same errors with broken using statements by
1432 never storing them in the first place when they are invalid.
1434 2008-11-05 Marek Safar <marek.safar@gmail.com>
1436 A fix for bug #421839
1437 * cs-parser.jay: Remove expression from coalesce rule to force lower
1438 priority than the assignment operator.
1440 2008-11-05 Marek Safar <marek.safar@gmail.com>
1442 A fix for bug #437875
1443 * nullable.cs: Compile correctly method group operand used with null
1444 coalescing operator.
1446 2008-11-04 Marek Safar <marek.safar@gmail.com>
1448 A fix for bug #434589
1449 * expression.cs (Binary): Ignore lifted conversions when at least
1450 one operand is of reference type.
1452 2008-11-04 Marek Safar <marek.safar@gmail.com>
1454 * cs-parser.jay: Better syntax error report.
1456 2008-11-03 Marek Safar <marek.safar@gmail.com>
1458 A fix for bug #436792
1459 * cs-parser.jay: Use GetLocation to access location.
1461 2008-11-03 Marek Safar <marek.safar@gmail.com>
1463 A fix for bug #440774
1464 * cs-parser.jay: Also set current_array_type when parsing local
1467 2008-11-03 Marek Safar <marek.safar@gmail.com>
1469 A fix for bug #440785
1470 * expression.cs (As): Don't resolve self modifing expression
1473 2008-11-03 Marek Safar <marek.safar@gmail.com>
1475 A fix for bug #439447
1476 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1478 2008-11-03 Marek Safar <marek.safar@gmail.com>
1480 A fix for bug #437571
1481 * cs-parser.jay: Fixes internal error for invalid expression
1484 2008-10-17 Marek Safar <marek.safar@gmail.com>
1486 * ecore.cs: Resolve correctly ambiguous params delegate methods.
1488 2008-10-17 Marek Safar <marek.safar@gmail.com>
1490 * generic.cs, anonymous.cs: Simplified GetDeclarations.
1492 2008-10-17 Marek Safar <marek.safar@gmail.com>
1494 * cs-tokenizer.cs: More precise cast parsing.
1496 2008-10-16 Martin Baulig <martin@ximian.com>
1498 * anonymous.cs (AnonymousMethodStorey): Put back the
1499 `hoisted_locals' hashtable and use it in EmitType().
1501 2008-10-15 Marek Safar <marek.safar@gmail.com>
1503 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1504 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1507 2008-10-14 Marek Safar <marek.safar@gmail.com>
1509 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1511 2008-10-14 Marek Safar <marek.safar@gmail.com>
1513 * statement.cs: Mutate scope initializers.
1515 2008-10-14 Marek Safar <marek.safar@gmail.com>
1517 * expression.cs: Use typeless value for This constant.
1519 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1521 2008-10-14 Marek Safar <marek.safar@gmail.com>
1523 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1526 2008-10-13 Marek Safar <marek.safar@gmail.com>
1528 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1531 2008-10-13 Marek Safar <marek.safar@gmail.com>
1533 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1534 parser and tokenizer. Fixes many ambiguities including #433258.
1536 2008-10-10 Marek Safar <marek.safar@gmail.com>
1538 * cs-parser.jay: Fixed missing accessor recovery.
1540 2008-10-10 Marek Safar <marek.safar@gmail.com>
1542 A fix for bug #433701
1543 * expression.cs: Better error message.
1545 2008-10-10 Marek Safar <marek.safar@gmail.com>
1547 * cs-parser.jay, expression.cs: Start reporting real parser errors.
1549 * Makefile: Disabled unused debug symbols.
1551 Also fixes: #320556, #321097, #321656, #321876, #351316
1553 2008-10-09 Miguel de Icaza <miguel@novell.com>
1555 * eval.cs: rename "<interactive>" to "{interactive}", to work
1556 around a requirement in the compiler that this be a valid
1557 filename, and in Windows it is not (433886).
1559 2008-10-09 Marek Safar <marek.safar@gmail.com>
1561 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1563 2008-10-08 Marek Safar <marek.safar@gmail.com>
1565 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1566 cs-parser.jay: Generic type declaration and type arguments cleanup.
1568 2008-10-05 Marek Safar <marek.safar@gmail.com>
1570 * cs-parser.jay: Allow parsing weird array creation construct.
1572 2008-10-05 Marek Safar <marek.safar@gmail.com>
1574 * cs-parser.jay: Conflicts reduction.
1576 2008-10-04 Marek Safar <marek.safar@gmail.com>
1578 * cs-parser.jay: Conflicts reduction.
1580 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
1583 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1584 property. Add a 'count' hint about the use of the shared vector.
1585 Ensure that we don't leak out dirty bits.
1586 (UsageVector.MergeChild): Throw away information about variables
1588 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1590 2008-10-03 Marek Safar <marek.safar@gmail.com>
1592 A fix for bug #431746
1593 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1594 parameters when iterator is created.
1596 2008-10-03 Marek Safar <marek.safar@gmail.com>
1598 A fix for bug #431827
1599 * expression.cs: Fixed right based pointer arithmetic operations
1602 2008-10-03 Marek Safar <marek.safar@gmail.com>
1604 A fix for bug #353779
1605 * assign.cs, expression.cs: Fixed compound assignment conversions.
1607 2008-10-02 Marek Safar <marek.safar@gmail.com>
1609 A fix for bug #375262
1610 * statement.cs: Refactor ArrayForeach to be usable with string
1611 indexer. Optimized single dimentional arrays foreach.
1613 2008-10-02 Marek Safar <marek.safar@gmail.com>
1615 A fix for bug #431255
1616 * anonymous.cs, expression.cs: Removed broken optimization.
1618 2008-10-01 Marek Safar <marek.safar@gmail.com>
1620 * anonymous.cs: Use full type parameters of parent generic
1621 containers. Removed unnecessary AddParentStoreyReference call.
1623 2008-10-01 Marek Safar <marek.safar@gmail.com>
1625 A fix for bug #324702
1626 * class.cs: Use better shorter names for explicit interface member
1629 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1631 2008-10-01 Marek Safar <marek.safar@gmail.com>
1633 * expression.cs: Use new interface to check fixed expression.
1635 2008-10-01 Marek Safar <marek.safar@gmail.com>
1637 A fix for bug #421101
1638 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1639 interface to check for fixed fixed-buffers.
1641 2008-10-01 Marek Safar <marek.safar@gmail.com>
1643 A fix for bug #429264
1644 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1646 * delegate.cs: Removed unnecessary casts.
1648 2008-09-30 Marek Safar <marek.safar@gmail.com>
1650 A fix for bug #352151
1651 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1652 class.cs: Fixed already defined explicit interface members check.
1654 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
1656 cs-tokenizer.cs: Fix typo.
1658 2008-09-28 Miguel de Icaza <miguel@novell.com>
1660 * eval.cs (InteractiveBase): The quit command now just sets a
1661 flag, instead of calling Environment.Exit(), it is milder on
1664 CompiledMethod is now in Mono.CSharp, not nested inside
1665 the Evaluator, it was inconvenient to use.
1667 2008-09-27 Miguel de Icaza <miguel@novell.com>
1669 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1670 code to be invoked without having to reparse.
1672 2008-09-27 Miguel de Icaza <miguel@novell.com>
1674 * ecore.cs: The recent changes to FieldExpr broke this as well.
1675 Fixes LINQ queries in the interactive shell.
1677 * Multiple files: indentation fixing for the Mono coding
1678 guidelines for the switch statement.
1680 * eval.cs: Make the Evaluator API thread safe.
1682 2008-09-26 Marek Safar <marek.safar@gmail.com>
1684 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1685 constructor parsing.
1687 2008-09-26 Marek Safar <marek.safar@gmail.com>
1689 A fix for bug #325326
1690 * statement.cs: Check possible mistaken empty statement using
1691 explicit blocks only.
1693 2008-09-25 Miguel de Icaza <miguel@novell.com>
1695 * eval.cs (LoadAssembly, ReferenceAssembly): Call
1696 RootNamespace.ComputeNamespaces to update the internal list of
1697 namespaces, this is no longer done for us.
1699 (InteractiveBase): Use the Evaluator APIs instead of calling into
1702 2008-09-25 Marek Safar <marek.safar@gmail.com>
1704 A fix for bug #429264
1705 * expression.cs: Missing mutator for access to multidimensional
1708 2008-09-25 Marek Safar <marek.safar@gmail.com>
1710 * class.cs, statement: Emit DebuggerHidden attribute for iterator
1713 * driver.cs: Missing input argument check.
1715 2008-09-25 Marek Safar <marek.safar@gmail.com>
1717 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1718 expression.cs, statement.cs, rootcontext.cs, class.cs,
1719 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1722 2008-09-24 Miguel de Icaza <miguel@novell.com>
1724 * ecore.cs (FieldExpr): Only initialize eclass when we return a
1725 fully constructed FieldExpr, fixes the regression introduced in
1728 * ecore.cs, expression.cs: Plug back the eclass initialization as
1729 otherwise it regresses `csharp'.
1731 2008-09-24 Marek Safar <marek.safar@gmail.com>
1733 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1734 ecore.cs, attribute.cs: Moved obsolete method checks from emit
1735 phase to resolve phase. It resolves problems with expression trees
1736 and fixes bugs #323796, #325156.
1738 2008-09-23 Marek Safar <marek.safar@gmail.com>
1740 * codegen.cs: Report better error when symbol writer is missing.
1742 2008-09-23 Marek Safar <marek.safar@gmail.com>
1744 * codegen.cs: Set .NET symbol writer.
1746 * decl.cs: Guard against null generic arguments.
1748 * report.cs: Don't report exactly same additional details.
1750 2008-09-22 Marek Safar <marek.safar@gmail.com>
1752 A fix for bug #324917
1753 * cs-parser.jay: Add missing multidimensional non-expression type
1756 2008-09-22 Marek Safar <marek.safar@gmail.com>
1758 A fix for bug #428191
1759 * anonymous.cs: Create an outer generic fields also for non-storey
1762 2008-09-22 Marek Safar <marek.safar@gmail.com>
1764 A fix for bug #378294
1765 * class.cs: Make fixed size buffers gmcs feature only.
1767 2008-09-22 Marek Safar <marek.safar@gmail.com>
1769 A fix for bug #355622, #324993
1770 * assign.cs, const.cs, class.cs: Create new EmitContext for each
1773 2008-09-19 Marek Safar <marek.safar@gmail.com>
1775 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1778 2008-09-19 Marek Safar <marek.safar@gmail.com>
1780 A fix for bug #416110
1781 * generic.cs: Struct constraint results in default ctor and
1782 ValueType base type constraint to be set.
1784 2008-09-19 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #423791
1787 * generic.cs: Fixed params output type type-inference.
1789 2008-09-19 Marek Safar <marek.safar@gmail.com>
1791 * cs-parser.jay, expression.cs: Fixed few expression crashes.
1793 2008-09-19 Marek Safar <marek.safar@gmail.com>
1795 * cs-tokenizer.cs: Don't break on extra partial modifier.
1797 2008-09-19 Marek Safar <marek.safar@gmail.com>
1799 A fix for bug #427592
1800 * generic.cs: Use common parameter resolve method.
1802 2008-09-18 Marek Safar <marek.safar@gmail.com>
1804 A fix for bug #414758
1805 * expression.cs, ecore.cs: Fixed crash when accessing non-static
1808 2008-09-18 Marek Safar <marek.safar@gmail.com>
1810 * driver.cs, namespace.cs: Read types and namespaces after all
1811 requested assemblies are loaded, fixes issues with System.Core
1812 auto-reference, and #419888.
1814 2008-09-18 Marek Safar <marek.safar@gmail.com>
1816 A fix for bug #417705
1817 * cs-parser.jay: Fixed as/is operator expression split.
1819 2008-09-18 Marek Safar <marek.safar@gmail.com>
1821 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1822 Fixed expression tree representation of empty new expression and
1823 new initializer expression.
1825 2008-09-18 Miguel de Icaza <miguel@novell.com>
1827 * eval.cs: Remove warning, keep reference to driver around.
1829 * Hide fields that do not need to be public.
1831 2008-09-17 Marek Safar <marek.safar@gmail.com>
1833 A fix for bug #426385
1834 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1835 conversion for array elements.
1837 2008-09-17 Marek Safar <marek.safar@gmail.com>
1839 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1840 void parsing conflicts.
1842 2008-09-15 Marek Safar <marek.safar@gmail.com>
1844 A fix for bug #425601
1845 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1846 System.Core only when there is no custom ExtensionAttribute
1849 2008-09-15 Miguel de Icaza <miguel@novell.com>
1851 * namespace.cs: Do not report CS0246 (name
1853 2008-09-12 Marek Safar <marek.safar@gmail.com>
1855 A fix for bug #425669
1856 * generic.cs: Don't cache generic static anonymous method
1859 2008-09-12 Marek Safar <marek.safar@gmail.com>
1861 * generic.cs, class.cs, delegate.cs: Check recursive inherited
1862 conflicting constraints.
1864 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
1866 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1869 2008-09-12 Marek Safar <marek.safar@gmail.com>
1871 * literal.cs, convert.cs, expression.cs, statement.cs: More null
1872 to null pointer conversion fixes.
1874 2008-09-11 Marek Safar <marek.safar@gmail.com>
1876 * cs-parser.jay, expression.cs: An implicitly typed local variable
1877 declarator cannot use an array initializer.
1879 2008-09-11 Marek Safar <marek.safar@gmail.com>
1881 * cs-parser.jay: Reduced number of printed tokens, add sorting.
1883 2008-09-11 Marek Safar <marek.safar@gmail.com>
1885 * generic.cs (InflatedConstraints): Don't crash when constraints
1888 * cs-parser.jay: const_declarator is a block.
1890 * constant.cs: Check for not allowed NaN conversions.
1892 2008-09-10 Miguel de Icaza <miguel@novell.com>
1894 * driver.cs: Drop --shell argument, the compiler is no longer a
1897 * eval.cs: Move most of the code that deals with evaluation into
1898 this file and document the public API from repl.cs
1900 * repl.cs: Remove from here.
1902 2008-09-10 Marek Safar <marek.safar@gmail.com>
1904 A fix for bug #424684
1905 * generic.cs: Generic class constraints must come first.
1907 2008-09-09 Miguel de Icaza <miguel@novell.com>
1909 * cs-parser.jay: Improve error reporting for syntax errors in
1910 statements and expressions, we now report the expected tokens
1911 instead of reporting the useless "; expected".
1913 Drop the strings from the token declaration, it turns out that
1914 they did not do what I thought they did. Instead they were adding
1915 two sets of tokens to the tables.
1917 2008-09-09 Marek Safar <marek.safar@gmail.com>
1919 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1920 delegate.cs: Share special type check.
1922 2008-09-09 Marek Safar <marek.safar@gmail.com>
1924 A fix for bug #423981
1925 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1927 2008-09-09 Marek Safar <marek.safar@gmail.com>
1929 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1932 2008-09-09 Marek Safar <marek.safar@gmail.com>
1934 A fix for bugs: #324750, #335946
1935 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
1936 lookup rule to determine ?-based tokens.
1938 2008-09-08 Miguel de Icaza <miguel@novell.com>
1940 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1941 expressions (like event adding or removing) end up here, so we
1942 need to treat those as statements.
1944 Add LoadAssembly method.
1946 2008-09-04 Miguel de Icaza <miguel@novell.com>
1948 * repl.cs: Add Time method.
1950 2008-09-05 Marek Safar <marek.safar@gmail.com>
1952 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1954 2008-09-05 Miguel de Icaza <miguel@novell.com>
1956 * repl.cs: Add workaround for old compilers.
1958 2008-09-04 Jb Evain <jbevain@novell.com>
1960 * repl.cs (PrettyPrint): pretty print everything that
1961 implements IDictionary, as well as IEnumerables. Also,
1962 add a quit helper property.
1964 2008-09-04 Marek Safar <marek.safar@gmail.com>
1966 * constant.cs: Better error reporting for decimal literals.
1968 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1971 2008-09-04 Marek Safar <marek.safar@gmail.com>
1972 Miguel de Icaza <miguel@novell.com>
1974 A fix for bug #422951
1975 * assign.cs (Assign.DoResolve): Perform the type conversions
1976 checks before we attempt to initialize `New' initializers.
1978 2008-09-04 Marek Safar <marek.safar@gmail.com>
1980 A fix for bug #422853
1981 * delegate.cs (DelegateCreation): Add special handling for
1982 EmptyExpression.Null instance expression which is just another
1983 hack for undecided member instance exression.
1985 2008-09-04 Marek Safar <marek.safar@gmail.com>
1987 * expression.cs, ecore.cs: Emit full expression tree for reduced
1990 2008-09-04 Marek Safar <marek.safar@gmail.com>
1992 * expression.cs (This): Guard against multi-resolving.
1994 * ecore.cs, statement.cs (Throw): Simplified.
1996 * flowanalysis.cs: Also verify event fields.
1998 2008-09-04 Miguel de Icaza <miguel@novell.com>
2000 * assign.cs (Assign.DoResolve): Perform the type conversions
2001 checks before we attempt to initialize `New' initializers.
2003 * repl.cs (PrettyPrint): Add Hashtable prettyprint
2005 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
2008 * repl.cs: Update help.
2010 2008-09-03 Miguel de Icaza <miguel@novell.com>
2012 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
2013 handling of the default config handling, including the special
2014 treatment of System.Core assembly.
2016 Fixes the REPL processing for LINQ.
2018 2008-09-03 Marek Safar <marek.safar@gmail.com>
2020 A fix for bug #422507
2021 * expression.cs (UnboxCast): Add missing child expression mutator.
2023 2008-09-03 Marek Safar <marek.safar@gmail.com>
2025 * driver.cs: Don't self reference System.Core assembly.
2027 2008-09-03 Marek Safar <marek.safar@gmail.com>
2029 A fix for bug #422507
2030 * expression.cs (StringConcat): Add missing type mutator.
2032 2008-09-03 Marek Safar <marek.safar@gmail.com>
2034 * generic.cs (TypeInferenceContext): Follow equality rule for
2035 constructed type lower bound type inference.
2037 2008-09-02 Miguel de Icaza <miguel@novell.com>
2039 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
2040 <dblank@cs.brynmawr.edu> which updates the cursor position on
2043 2008-09-02 Marek Safar <marek.safar@gmail.com>
2045 A fix for bug #367145
2046 * driver.cs: Fixed import of extension methods when using -noconfig
2049 2008-09-02 Marek Safar <marek.safar@gmail.com>
2051 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
2052 version from non-generic implementation instead.
2054 2008-09-01 Marek Safar <marek.safar@gmail.com>
2056 A fix for bug #418908
2057 * class.cs: Use AddScopeStatement for field initializers.
2059 2008-09-01 Marek Safar <marek.safar@gmail.com>
2061 A fix for bug #415385
2062 * ecore.cs, convert.cs: Do method group conversion for equal group types.
2064 2008-09-01 Marek Safar <marek.safar@gmail.com>
2066 A fix for bug #421736
2067 * iterators.cs: Don't crash on unreachable iterators.
2069 2008-09-01 Marek Safar <marek.safar@gmail.com>
2071 A fix for bug #421628
2072 * parameter.cs, attribute.cs: Clone also parameter attributes.
2074 2008-08-30 Miguel de Icaza <miguel@novell.com>
2076 * namespace.cs (LookupType): In EvalMode, try to replace
2077 the TypeBuilder from our cache with a Type as Reflection.Emit does
2078 not like to mix code from older assemblies emitted and new
2081 This sounds like a serious Mono bug that prevents multiple
2082 assemblies to be generated and consumed at the same time.
2084 * cs-parser.jay (push_current_class): Do not make interactive
2085 classes internal or private, make them public as we currently
2086 generate each new class in a new assembly.
2088 2008-08-29 Miguel de Icaza <miguel@novell.com>
2090 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
2091 remove types that are entered into the global namespace during
2092 parsing so that we can remove them on failure.
2094 * cs-parser.jay: Parsing: we now keep track of types that are
2095 entered into global variables and queue those in case the parsing
2098 This happens in a few situations: during partial-input, we invoke
2099 the parser repeatedly for example with the string "class X", this
2100 would cause X to be registed, and we need to remove this
2101 registration so that another parse attempt later with say "class X {"
2102 would actually work.
2104 Additionally, if there is an error in the resolution phase, for
2105 example: "class X : NonExistant {}" th
2107 * cs-parser.jay: Be more precise with the errors being raised,
2108 instead of flagging all exceptions during parsing to be attributed
2109 to the parsing process, distinguish those from errors happening in
2110 the actions and hint that using -v would produce the actual
2113 * repl.cs: Do not load all compiler references on each reset,
2114 doing the partial reset takes care of this.
2116 2008-08-28 Miguel de Icaza <miguel@novell.com>
2118 * repl.cs: Add support for loading all the files from
2119 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
2122 Introduce a micro-parser that is able to deambiguate on its input
2123 whether we are dealing with a compilation unit (namespace, class,
2124 interface, struct, delegate) declaration or a statement. This
2125 allows both declarations and statements to be entered.
2127 Set history size by default to 300 lines.
2129 Instead of distinguishing based on the parser.InteractiveResult,
2130 have only two cases: statements were parsed, or a compilation unit
2131 was. Always pull the Using statement additions from the
2132 compilation unit parse.
2134 * cs-tokenizer.cs: Rename tokens to better describe their intent
2135 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
2137 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
2138 EvalMode is used to trigger the lookup of global variables while
2139 StatementMode is used turn variable declarations into static
2142 * getline.cs: Allow history size to be set.
2144 2008-08-29 Marek Safar <marek.safar@gmail.com>
2146 A fix for bug #360755
2147 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
2149 2008-08-29 Marek Safar <marek.safar@gmail.com>
2151 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
2153 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
2154 member name, it is too confusing
2156 * decl.cs, class.cs: Don't report unused fields with attached attribute.
2158 * rootcontext.cs: Finally default to warning level 4.
2160 2008-08-28 Marek Safar <marek.safar@gmail.com>
2162 * class.cs (CheckBase): Ignore overloaded operators.
2164 2008-08-28 Marek Safar <marek.safar@gmail.com>
2166 A fix for bug #420830
2167 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
2169 2008-08-28 Marek Safar <marek.safar@gmail.com>
2171 A fix for bug #420832
2172 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
2174 2008-08-28 Marek Safar <marek.safar@gmail.com>
2176 A fix for bug #420386
2177 * nullables.cs: Fixed logic of nullable user comparison operators involving
2180 2008-08-28 Marek Safar <marek.safar@gmail.com>
2182 * attribute (IsClsCompliant): Use FALSE value for pointer types.
2184 2008-08-27 Miguel de Icaza <miguel@novell.com>
2186 * repl.cs: Add support for aborting the running code with C-c.
2188 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
2190 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
2192 2008-08-27 Miguel de Icaza <miguel@novell.com>
2194 * cs-parser.jay (interactive_statement_list): A new set of rules
2195 for hosting statements that uses the "interactive_" prefix.
2197 * repl.cs: Add support for parsing `using' as a statement or as a
2198 directive. Deambiguating before passing this to the parser.
2200 We need to distinguish statement_expressions that occur at the
2201 toplevel vs those that occur embedded into expressions.
2203 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
2204 that fixes the cursor key handling, and a history bug.
2206 2008-08-26 Miguel de Icaza <miguel@novell.com>
2208 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
2209 limitations in Console, instead the 2.0 bootstrap libraries now
2210 include the Console bits.
2212 Also, remove the use of Nullables from getline.cs
2216 Interactive support for the C# compiler. Use gmcs --shell to
2217 enter a read-eval-print loop shell.
2219 Docs: http://www.mono-project.com/CsharpRepl
2221 * sources: include repl.cs here and getline.cs for gmcs.exe,
2222 everything else is getline.cs impaired.
2224 * Makefile: when bootstrapping pass a special flag
2225 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
2226 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
2227 This distinguishes those two cases.
2229 * repl.cs: Support for a read-eval-print loop. Will be soon
2230 refactored into eval support and then REPL on top of it.
2232 * ecore.cs: If a simplename lookup fails, before erroring out,
2233 if we are in EvalMode to resolve the name to a declaration in the
2236 This means that variable declarations that happened in previous
2237 classes (as repl puts every statement in a separate class) are
2238 made visible in this way.
2240 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
2241 triggered an error due to the end of file being reached. This is
2242 used to do multi-line input, and notify the caller that the user
2243 needs to provide more text before a successful parse.
2245 Add new grammar rules after the INTERACTIVE_PARSER token is seen
2246 to drive the evaluation with a custom wrapper.
2248 * driver.cs: Add support for --shell, and refactor some code to be
2251 * namespace.cs: Add support for serializing the contents of the
2252 namespaces and reloading them.
2254 * getline.cs: A managed implementation of ReadLine under
2255 X11/Apache2 license terms. Easy to embed in other applications as
2258 * namespace.cs: Add some functions to save and restore the
2261 * rootcontext.cs: New public field.
2263 * cs-tokenizer.cs: Add support for one of the possible characters
2264 we introduce into the token stream.
2266 This patch does not affect the regular tokenization process, the
2267 only performance hit would happen if there is an invalid character
2268 on the input string.
2270 * support.cs: Move isatty helper routine here.
2272 * codegen.cs: Small cleanup, and add a mechanism to initialize the
2273 code generator for in-memory assemblies.
2275 2008-08-26 Marek Safar <marek.safar@gmail.com>
2277 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
2278 parameter cannot be always used as a type.
2280 2008-08-21 Marek Safar <marek.safar@gmail.com>
2282 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
2284 2008-08-21 Marek Safar <marek.safar@gmail.com>
2286 * convert.cs: Implement explicit array to IList<T> conversion.
2288 2008-08-20 Marek Safar <marek.safar@gmail.com>
2290 A fix for bug #362740
2291 * cs-tokenizer.cs: Handle UTF-16 surrogates.
2293 2008-08-20 Marek Safar <marek.safar@gmail.com>
2295 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
2296 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
2297 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
2298 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
2299 handling to use just one type of infrastructure and deal with generics
2302 2008-07-23 Martin Baulig <martin@ximian.com>
2304 *** Merged this from trunk revision 108527 ***
2307 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
2308 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
2311 2008-08-15 Marek Safar <marek.safar@gmail.com>
2313 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
2316 2008-08-15 Marek Safar <marek.safar@gmail.com>
2318 * delegate.cs: Fixed compiler crash when creating delegate using partial
2321 * typemanager.cs: MulticastDelegate is not a delegate.
2323 2008-08-14 Marek Safar <marek.safar@gmail.com>
2325 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
2328 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
2330 * cs-parser.jay (type): Allow 'var' in mcs too.
2331 (local_variable_type): Likewise.
2333 2008-08-14 Marek Safar <marek.safar@gmail.com>
2335 * driver.cs: Removed broken -noconfig variants.
2337 2008-08-14 Marek Safar <marek.safar@gmail.com>
2339 A fix for bug #417078
2340 * expression.cs: Emit correctly left side pointer operators.
2342 2008-08-13 Marek Safar <marek.safar@gmail.com>
2344 * generic.cs, lambda.cs: Inflate method generic arguments only.
2346 2008-08-12 Marek Safar <marek.safar@gmail.com>
2348 * class.cs: Fixed struct layout check regression.
2350 2008-08-12 Marek Safar <marek.safar@gmail.com>
2352 * cs-parser.jay, enum.cs: Simplified enum parsing.
2354 * decl.cs: Check all type parameters conflicts.
2356 * expression.cs, statement.cs, attribute.cs: More expression checks.
2358 2008-08-11 Marek Safar <marek.safar@gmail.com>
2360 * generic.cs: Add type inference types restriction.
2362 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
2363 anonymous.cs, expression.cs: Allocate less accessor parameters.
2365 2008-08-08 Marek Safar <marek.safar@gmail.com>
2367 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
2370 2008-08-08 Marek Safar <marek.safar@gmail.com>
2372 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
2374 2008-08-07 Marek Safar <marek.safar@gmail.com>
2376 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
2377 Also fixes #362146 and #381592.
2379 2008-08-07 Marek Safar <marek.safar@gmail.com>
2381 * ecore.cs: Reduced constant cannot be used as an attribute value.
2383 * cs-parser.jay: Base expression has to be a type.
2385 * expression.cs (Conditional): Uses ReducedExpression.
2387 2008-08-06 Marek Safar <marek.safar@gmail.com>
2389 A fix for bug #376826
2390 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
2391 address of hoisted local variable or parameter cannot be taken.
2393 2008-08-05 Marek Safar <marek.safar@gmail.com>
2395 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
2396 anonymous method inside checked/unchecked expression.
2398 2008-08-05 Marek Safar <marek.safar@gmail.com>
2400 * typemanager.cs (IsEqual): Guard against null.
2402 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2403 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2404 routine. Fixed few misleading conversion errors.
2406 2008-08-04 Marek Safar <marek.safar@gmail.com>
2408 * class.cs: Consider generics when checking cycles in struct layout.
2410 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
2412 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
2414 2008-08-04 Marek Safar <marek.safar@gmail.com>
2416 A fix for bug #414165
2417 * anonymous.cs: Use same anonymous implementation method for all anonymous
2420 2008-08-04 Marek Safar <marek.safar@gmail.com>
2422 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2425 2008-08-04 Marek Safar <marek.safar@gmail.com>
2427 * cs-parser.jay: Typeof argument has to be a type expression.
2429 * namespace.cs: Check alias and namespace definitions collisions.
2431 * class.cs, pending.cs: Moved explicit interface accessor implementation
2434 * delegate.cs, expression.cs: Verify special name invocations.
2436 2008-08-01 Marek Safar <marek.safar@gmail.com>
2438 * cs-parser.jay: Don't choke on empty generic type arguments.
2440 * cs-tokenizer.cs: Handle escaped preprocessor directives.
2442 * expression.cs, ecore.cs: Minor expressions bugs.
2444 2008-08-01 Marek Safar <marek.safar@gmail.com>
2446 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2447 and added more error handling.
2449 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2451 * modifiers.cs, enum.cs: Fixed.
2453 2008-07-31 Jb Evain <jbevain@novell.com>
2455 * driver.cs: remove -pkg ability of smcs.
2457 2008-07-30 Marek Safar <marek.safar@gmail.com>
2459 * statement.cs (Switch): Correctly set empty default target for single
2462 2008-07-30 Marek Safar <marek.safar@gmail.com>
2464 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2465 string switch statement implementation to use string dictionary which
2466 significantly (2-8x) improves performance of generated code.
2468 2008-07-29 Marek Safar <marek.safar@gmail.com>
2470 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2471 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2473 2008-07-29 Marek Safar <marek.safar@gmail.com>
2475 A fix for bug #412595
2476 * typemanager.cs, convert.cs, expression.cs: Some types are never
2477 convertible to each other.
2479 2008-07-29 Marek Safar <marek.safar@gmail.com>
2481 * nullable.cs (CreateNullConstant): An error messages update.
2483 2008-07-29 Marek Safar <marek.safar@gmail.com>
2485 A fix for bug #412595
2486 * cfold.cs: Don't cast undefined bool constant.
2488 2008-07-29 Martin Baulig <martin@ximian.com>
2491 (SymbolWriter.Reset): New public static method.
2494 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2496 2008-07-28 Marek Safar <marek.safar@gmail.com>
2498 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2500 * expression.cs (ElementAccess): Exact size allocation.
2502 2008-07-26 Marek Safar <marek.safar@gmail.com>
2504 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2506 2008-07-25 Marek Safar <marek.safar@gmail.com>
2508 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2510 * class.cs: Removed $PRIVATE$ field hack which caused problems during
2513 2008-07-25 Marek Safar <marek.safar@gmail.com>
2515 A fix for bug #412217
2516 * assign.cs: Mutate also assignment type.
2518 2008-07-25 Marek Safar <marek.safar@gmail.com>
2520 A fix for bug #323644
2521 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2524 2008-07-25 Marek Safar <marek.safar@gmail.com>
2526 A fix for bug #412134
2527 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2528 non-enumerable operands when overloading equality or bitwise operators.
2530 2008-07-25 Marek Safar <marek.safar@gmail.com>
2532 * anonymous.cs: Cache closed generic anonymous method delegates.
2534 2008-07-24 Marek Safar <marek.safar@gmail.com>
2536 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
2537 anonymous.cs, statement.cs: Always emit anonymous method as static method
2538 when is instance free. Use nesting for nested anynomous methods blocks.
2540 2008-07-23 Marek Safar <marek.safar@gmail.com>
2542 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2545 2008-07-23 Marek Safar <marek.safar@gmail.com>
2547 * expression.cs: Removed MakeSimpleCall.
2549 2008-07-23 Marek Safar <marek.safar@gmail.com>
2551 A fix for bug #323012
2552 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2553 Base method implementing interface has to be public.
2555 2008-07-23 Marek Safar <marek.safar@gmail.com>
2557 * cs-parser.jay: Don't break on missing argument.
2559 2008-07-22 Marek Safar <marek.safar@gmail.com>
2561 A fix for bug #320993
2562 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2563 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2565 2008-07-22 Marek Safar <marek.safar@gmail.com>
2567 A fix for bug #320748
2568 * convert.cs: Implicit user operators cannot convert to interfaces
2570 2008-07-22 Marek Safar <marek.safar@gmail.com>
2572 A fix for bug #312686
2573 * driver.cs: Ignore empty assembly references.
2575 2008-07-22 Marek Safar <marek.safar@gmail.com>
2577 A fix for bug #387040
2578 * ecore.cs: Skip constrains check for an explicit implementation.
2580 2008-07-21 Marek Safar <marek.safar@gmail.com>
2582 A fix for bug #409045
2583 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2584 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2585 identifiers are file specific unless passed as input arguments.
2587 2008-07-21 Marek Safar <marek.safar@gmail.com>
2589 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2590 to emit UnmanagedMarshal data under 2.0 profile.
2592 2008-07-21 Marek Safar <marek.safar@gmail.com>
2594 A fix for bug #410369
2595 * parameter.cs: Clone correctly ParamsParameter.
2597 2008-07-21 Marek Safar <marek.safar@gmail.com>
2599 * expression.cs (Argument): Always report type for type based expressions
2602 2008-07-18 Marek Safar <marek.safar@gmail.com>
2604 A fix for bug #410666
2605 * anonymous.cs: Correctly initialize generic storey reference.
2607 2008-07-18 Marek Safar <marek.safar@gmail.com>
2609 * convert.cs: Don't box same type arguments.
2611 2008-07-18 Marek Safar <marek.safar@gmail.com>
2613 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2614 Finished missing generic type mutators.
2616 2008-07-18 Marek Safar <marek.safar@gmail.com>
2618 * iterators.cs, statement.cs: Finished statements CloneTo.
2620 2008-07-18 Marek Safar <marek.safar@gmail.com>
2622 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2624 * expression.cs: Emit optimized default value expressions in expression tree
2627 2008-07-18 Marek Safar <marek.safar@gmail.com>
2629 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2631 2008-07-17 Marek Safar <marek.safar@gmail.com>
2633 A fix for bug #367536
2634 * cs-parser.jay: Check static constructor of generic types for an access
2637 2008-07-17 Marek Safar <marek.safar@gmail.com>
2639 A fix for bug #353800
2640 * lambda.cs: Emit ret for contextual statements.
2642 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2643 up emitting redundant ret for all anonymous methods with return.
2645 2008-07-17 Marek Safar <marek.safar@gmail.com>
2647 A fix for bug #365188
2648 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2649 create anonymous method storey in unreachable block.
2651 2008-07-17 Marek Safar <marek.safar@gmail.com>
2653 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2654 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2655 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2656 statement.cs: Fixed relevant defects found by Gendarme.
2658 2008-07-17 Marek Safar <marek.safar@gmail.com>
2660 A fix for bug #325291
2661 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
2662 statement.cs: Replaced IAnonymousHost with top level block flag.
2664 2008-07-17 Marek Safar <marek.safar@gmail.com>
2666 * cs-parser.jay: Clean up unused open_parens.
2668 2008-07-17 Marek Safar <marek.safar@gmail.com>
2670 * ecore.cs: Custom error message for a range variable assignment.
2672 2008-07-16 Marek Safar <marek.safar@gmail.com>
2674 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2677 2008-07-16 Marek Safar <marek.safar@gmail.com>
2679 * literal.cs: Null literal is of object type.
2681 2008-07-16 Marek Safar <marek.safar@gmail.com>
2683 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2684 expression of nullable equality comparison.
2686 2008-07-15 Marek Safar <marek.safar@gmail.com>
2688 * expression.cs(PointerArithmetic): Removed redundant assignment.
2690 2008-07-15 Marek Safar <marek.safar@gmail.com>
2692 * decl.cs (GetSignatureForError): Report full namespace name for containers.
2694 2008-07-14 Marek Safar <marek.safar@gmail.com>
2696 A fix for bug #408361
2697 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2698 they are replaced by GetMethod.
2700 2008-07-14 Marek Safar <marek.safar@gmail.com>
2702 A fix for bug #408721 by jeremie.laval@gmail.com
2703 * expression.cs (Indirection): Implemented CloneTo.
2705 2008-07-14 Marek Safar <marek.safar@gmail.com>
2707 * statement.cs (AssignableSlots): Temporary disabled variable initialization
2710 2008-07-14 Marek Safar <marek.safar@gmail.com>
2712 * report.cs (EnableReporting): Don't reinitialize 0-based values.
2714 2008-07-11 Marek Safar <marek.safar@gmail.com>
2716 * linq.cs: Reset tranparent parameter counter in probing mode.
2718 2008-07-11 Marek Safar <marek.safar@gmail.com>
2720 * anonymous.cs: Mutate anonymous method type.
2722 2008-07-11 Marek Safar <marek.safar@gmail.com>
2724 * ecore.cs, anonymous.cs: Mutate field expressions.
2726 2008-07-10 Marek Safar <marek.safar@gmail.com>
2728 A fix for bug #369670
2729 * linq.cs, statement.cs: Use explicit block for query expressions variables.
2731 2008-07-10 Marek Safar <marek.safar@gmail.com>
2733 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2735 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
2738 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2739 only one '>', and finds a '>>', abort the generic lookahead.
2741 2008-07-10 Marek Safar <marek.safar@gmail.com>
2743 A fix for bug #319902
2744 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
2746 2008-07-10 Marek Safar <marek.safar@gmail.com>
2748 A fix for bug #406371
2749 * statement.cs: Moved EmitSymbolInfo to Block.
2751 2008-07-09 Marek Safar <marek.safar@gmail.com>
2753 * ecore.cs: Report better error for extension method overload failures.
2755 2008-07-09 Marek Safar <marek.safar@gmail.com>
2757 * expression.cs (Is): No need to box reference values.
2759 2008-07-09 Marek Safar <marek.safar@gmail.com>
2761 * class.cs: Use event resolve context when initializing CreateEmitContext.
2763 2008-07-09 Marek Safar <marek.safar@gmail.com>
2765 A fix for bug #394436
2766 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2767 method used inside expression trees. Added more LINQ to expression tree
2770 2008-07-08 Marek Safar <marek.safar@gmail.com>
2772 A fix for bug #378189, #370577
2773 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2776 2008-07-08 Marek Safar <marek.safar@gmail.com>
2778 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2781 2008-07-08 Marek Safar <marek.safar@gmail.com>
2783 A fix for bug #406702
2784 * anonymous.cs: Always park anonymous method in the nearest parent storey.
2786 2008-07-07 Marek Safar <marek.safar@gmail.com>
2788 A fix for bug #406648
2789 * cs-parser.jay: Report nullable use in mcs for some cases.
2791 2008-07-07 Marek Safar <marek.safar@gmail.com>
2793 * ecore.cs: Improved argument mismatch error messages.
2795 2008-07-07 Marek Safar <marek.safar@gmail.com>
2797 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2799 2008-07-07 Marek Safar <marek.safar@gmail.com>
2801 * expression.cs (TypeOf): Mutate type argument.
2803 2008-07-04 Marek Safar <marek.safar@gmail.com>
2805 * class.cs: Report missing partial modifier for correct type.
2807 2008-07-04 Marek Safar <marek.safar@gmail.com>
2809 * ecore.cs, expression.cs (VariableReference): Variable property is
2812 2008-07-04 Marek Safar <marek.safar@gmail.com>
2814 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2816 2008-07-04 Marek Safar <marek.safar@gmail.com>
2818 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2821 2008-07-04 Marek Safar <marek.safar@gmail.com>
2823 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2824 anonymous method storey to an instance method when only "this" is hoisted.
2826 2008-07-03 Marek Safar <marek.safar@gmail.com>
2828 A fix for bug #321615
2829 * expression.cs: Pointer comparisons use unsigned operator.
2831 2008-07-03 Marek Safar <marek.safar@gmail.com>
2833 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2835 2008-07-02 Marek Safar <marek.safar@gmail.com>
2837 A fix for bug #404905
2838 * class.cs: Always initialize local unsafe variables.
2840 2008-06-30 Marek Safar <marek.safar@gmail.com>
2842 A fix for bug #396987
2843 * expression.cs (NewInitialize): Clear local temporary variable for next run
2845 2008-06-27 Marek Safar <marek.safar@gmail.com>
2847 A fix for bug #401020
2848 * ecore.cs: Both types and modifiers have to match for ref and out arguments
2850 2008-06-27 Marek Safar <marek.safar@gmail.com>
2852 A fix for bug #398319
2853 * cs-parser.jay: Implemented undocumented base access expression inside
2856 2008-06-26 Marek Safar <marek.safar@gmail.com>
2858 A fix for bug #404227
2859 * cs-parser.jay: Parse namespace declaration using qualified identifier.
2861 2008-06-26 Marek Safar <marek.safar@gmail.com>
2863 A fix for bug #404227
2864 * convert.cs: Fixed explicit array to interface cast.
2866 2008-06-26 Marek Safar <marek.safar@gmail.com>
2868 A fix for bug #403894
2869 * delegate.cs: Mutate DelegateInvocation type.
2871 2008-06-26 Marek Safar <marek.safar@gmail.com>
2873 A fix for bug #379348
2874 * delegate.cs: Box a load of generic parameters.
2876 2008-06-26 Marek Safar <marek.safar@gmail.com>
2878 * expression.cs: Add an array creation arguments mutate.
2880 2008-06-26 Marek Safar <marek.safar@gmail.com>
2882 A fix for bug #386068
2883 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2886 2008-06-25 Marek Safar <marek.safar@gmail.com>
2888 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2891 2008-06-25 Marek Safar <marek.safar@gmail.com>
2893 A fix for bug #403518
2894 * delegate.cs: Type correctly anonymous method new invocation.
2896 2008-06-24 Marek Safar <marek.safar@gmail.com>
2898 A fix for bug #394826
2899 * anonymous.cs: Fully qualify members when resolving anonymous type internal
2902 2008-06-24 Marek Safar <marek.safar@gmail.com>
2904 A fix for bug #394826
2905 * anonymous.cs, iterators.cs: Construct generic storey only when is really
2908 2008-06-24 Marek Safar <marek.safar@gmail.com>
2910 * class.cs: Clone indexer parameters for localized capturing.
2912 2008-06-24 Marek Safar <marek.safar@gmail.com>
2914 A fix for bug #402379
2915 * expression.cs: Don't crash when an object initializer resolve fails.
2917 2008-06-24 Marek Safar <marek.safar@gmail.com>
2919 A fix for bug #402888
2920 * expression.cs: Mutate conditional expression.
2922 2008-06-24 Marek Safar <marek.safar@gmail.com>
2924 A fix for bug #401012
2925 * class.cs: Keep StructLayout in shared container.
2927 2008-06-24 Marek Safar <marek.safar@gmail.com>
2929 A fix for bug #400438
2930 * decl.cs, class.cs: Only properties can be automatically implemented.
2932 2008-06-24 Marek Safar <marek.safar@gmail.com>
2934 * statement.cs (ChangeToIterator): Copy also labels.
2936 2008-06-23 Marek Safar <marek.safar@gmail.com>
2938 * ecore.cs: Pass type argument details to parent extension method.
2940 2008-06-23 Marek Safar <marek.safar@gmail.com>
2942 A fix for bug #375966
2943 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2945 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
2947 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2949 2008-06-22 Marek Safar <marek.safar@gmail.com>
2951 A fix for bug #394347
2952 * anonymous.cs: Cache compatible delegates as compatibility check produces
2953 a new method every time.
2955 2008-06-20 Marek Safar <marek.safar@gmail.com>
2957 * anonymous.cs: Propagate storey reference for single references.
2959 2008-06-20 Marek Safar <marek.safar@gmail.com>
2961 A fix for bug #387615
2962 * assign.cs, expression.cs: Correctly clone compound assignment.
2964 2008-06-19 Marek Safar <marek.safar@gmail.com>
2966 A fix for bug #359611, #359604
2967 * anonymous.cs: Mutate all types of hoisted parameters.
2969 2008-06-19 Marek Safar <marek.safar@gmail.com>
2971 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2972 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2973 expression.cs, codegen.cs, statement.cs
2975 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2976 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2978 ** Anonymous methods, lambda expressions rewrite **
2980 Anonymous expressions are now resolved when an explicit block is resolved
2981 and they don't require any registration procedure anymore. Further,
2982 anonymous methods are defined when explicit block is emitted which allows
2983 better control of whole process and opens possibilities for more
2984 optimizations as well as alternative to reverse whole process.
2986 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2987 process consistent and to correctly emit hoisted generic methods when they
2988 have at least 1 hoisted variable.
2990 2008-06-17 Martin Baulig <martin@ximian.com>
2992 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2994 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2995 virtual property; check it in Emit().
2996 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2998 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
3000 (Indexer.Define): Likewise.
3002 2008-06-17 Marek Safar <marek.safar@gmail.com>
3004 * convert.cs: Don't use IsInterface on type arguments.
3006 * delegate.cs: DelegateInvocation uses MethodInfo.
3008 * parameter.cs: Removed IsTypeParameter.
3010 * generic-mcs.cs: More missing stuff.
3012 2008-06-16 Martin Baulig <martin@ximian.com>
3015 (Modifiers.DEBUGGER_HIDDEN): New public const.
3018 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
3021 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
3022 (AbstractPropertyEventMethod): Likewise.
3023 (Constructor.Emit): Likewise.
3024 (SourceMethod.SetCompilerGenerated): Removed.
3026 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
3030 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
3031 if we're an `IteratorHost'.
3032 (AnonymousMethodMethod..ctor): Don't set
3033 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
3036 2008-06-16 Marek Safar <marek.safar@gmail.com>
3038 * statement.cs: Clean-up foreach statements.
3040 2008-06-12 Marek Safar <marek.safar@gmail.com>
3042 * class.cs: Stop using public method which should not exist
3043 (MethodBuilder.SetGenericMethodSignature).
3045 2008-06-11 Martin Baulig <martin@ximian.com>
3048 (Location.LookupFile): Add `CompilationUnit' argument; when given
3049 a relative file name, make it relative to the directory the .cs
3050 file is located in instead of using the current directory.
3052 2008-06-11 Martin Baulig <martin@ximian.com>
3055 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
3056 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
3057 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
3058 (SourceMethod.SetCompilerGenerated): Likewise.
3060 2008-06-11 Marek Safar <marek.safar@gmail.com>
3062 * codegen.cs, driver: Only write symbol file when it's asked for.
3064 2008-06-11 Marek Safar <marek.safar@gmail.com>
3066 * codegen.cs: Don't use assembly writer error handling for symbol writer.
3068 2008-06-10 Martin Baulig <martin@ximian.com>
3070 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
3072 2008-06-09 Marek Safar <marek.safar@gmail.com>
3074 A fix for bug #316290
3075 * expression.cs: Include decimal operators in predefined table.
3077 * parameters.cs: More readonlyness.
3079 2008-06-09 Marek Safar <marek.safar@gmail.com>
3081 A fix for bug #397213
3082 * cs-parser.jay: One more missing current_local_parameters reset.
3084 2008-06-09 Marek Safar <marek.safar@gmail.com>
3086 A fix for bug #396633
3087 * class.cs: Host backing field in partial container.
3089 2008-06-09 Marek Safar <marek.safar@gmail.com>
3091 A fix for bug #397068
3092 * expression.cs: Check both operand types when predefined operator is used.
3094 2008-06-05 Martin Baulig <martin@ximian.com>
3096 Merged the `debugger-kahalo' branch.
3099 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
3100 we're an iterator method.
3101 (SourceMethod): Reflect latest symbol writer changes;
3102 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
3103 now `start_row' and `end_row'.
3104 (Constructor.Emit): Fix the logic whether to emit symbol information.
3106 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
3110 (CompilationUnit): New public class; derives from `SourceFile'.
3111 (SourceFileEntry.DefineSymbolInfo): New public method.
3112 (SourceFileEntry.SetChecksum): New public method.
3113 (Location): Encode hidden line numbers by using `column == 255';
3114 the .ctor now accepts `column == -1' to mark a hidden line number.
3115 (Location.Hidden): New public property.
3116 (Location.CheckPoint): Add `CompilationUnit'.
3117 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
3118 (Location.Push): Add `CompilationUnit compile_unit' argument.
3119 (Location.CompilationUnit): New public property.
3122 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
3124 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
3126 * driver.cs: `SourceFile' -> `CompilationUnit'.
3128 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
3130 * namespace.cs: `SourceFile' -> `CompilationUnit'.
3132 * cs-tokenizer.cs: Add support for `#pragma checksum' and
3136 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
3137 new symbol writer API to also pass the file.
3139 2008-06-05 Marek Safar <marek.safar@gmail.com>
3141 * statement.cs: Emit catch variable assignment using variable expression.
3143 2008-06-05 Marek Safar <marek.safar@gmail.com>
3145 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
3146 with other variable types.
3148 2008-06-04 Marek Safar <marek.safar@gmail.com>
3150 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
3151 GetLength method emit, it breaks resolve rules.
3153 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
3154 Marek Safar <marek.safar@gmail.com>
3156 A fix for bug #395542
3157 * cs-parser.jay: The trailing comma is allowed in anonymous type member
3160 2008-06-02 Marek Safar <marek.safar@gmail.com>
3162 A fix for bug #395287
3163 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
3165 2008-05-31 Marek Safar <marek.safar@gmail.com>
3167 A fix for bug #395845
3168 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
3169 non-nullable parameter type.
3171 2008-05-31 Marek Safar <marek.safar@gmail.com>
3173 * class.cs: Handle contructor initializer as a statement in top-level block.
3175 2008-05-30 Marek Safar <marek.safar@gmail.com>
3177 * attribute.cs: Don't mix old and new corlib types when emitting corlib
3178 security attributes.
3180 2008-05-24 Marek Safar <marek.safar@gmail.com>
3182 * ecore.cs, expression.cs: Small IVariable refactoring.
3184 2008-05-22 Marek Safar <marek.safar@gmail.com>
3186 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
3188 2008-05-21 Marek Safar <marek.safar@gmail.com>
3190 * cs-parser.jay: Removed redundant catch type check.
3192 2008-05-21 Marek Safar <marek.safar@gmail.com>
3194 A fix for bug #390372
3195 * nullable.cs: Set correct return type.
3197 2008-05-21 Marek Safar <marek.safar@gmail.com>
3199 A fix for bug #391062
3200 * typemanager.cs: Fixed crash when comparing null types.
3202 2008-05-21 Marek Safar <marek.safar@gmail.com>
3204 A fix for bug #391871
3205 * cs-parser.jay: Better error handling for invalid catch type.
3207 2008-05-20 Marek Safar <marek.safar@gmail.com>
3209 A fix for bug #392155
3210 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
3212 2008-05-15 Marek Safar <marek.safar@gmail.com>
3214 A fix for bug #390666
3215 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
3218 2008-05-15 Marek Safar <marek.safar@gmail.com>
3220 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
3223 2008-05-13 Marek Safar <marek.safar@gmail.com>
3225 A fix for bug #389625
3226 * delegate.cs, generic.cs: Some progress on method group return type
3229 2008-05-13 Marek Safar <marek.safar@gmail.com>
3231 A fix for bug #378419
3232 * namespace.cs: Inspect also parent namespaces not only namespace entries.
3234 2008-05-12 Marek Safar <marek.safar@gmail.com>
3236 * class.cs (Constructor): Added IsCompilerGenerated.
3238 2008-05-12 Marek Safar <marek.safar@gmail.com>
3240 * expression.cs: Enum binary operators can accept non-enum operand only when
3241 is implicitly convertible to underlying type.
3243 2008-05-12 Marek Safar <marek.safar@gmail.com>
3245 A fix for bug #389272
3246 * support.cs: Workaround System.InvalidOperationException for enums.
3248 2008-05-12 Marek Safar <marek.safar@gmail.com>
3250 A fix for bug #389073
3251 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
3253 2008-05-10 Marek Safar <marek.safar@gmail.com>
3255 * driver.cs: Split Parse.
3257 * location.cs (LookupFile): Uses string.Empty.
3259 2008-05-07 Marek Safar <marek.safar@gmail.com>
3261 * expression.cs, parameter.cs: Small ParameterReference clean up.
3263 2008-05-07 Marek Safar <marek.safar@gmail.com>
3265 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
3266 hack. Fixes #387502.
3268 2008-05-06 Martin Baulig <martin@ximian.com>
3270 * class.cs (Constructor.Emit): Fix the logic whether to emit
3273 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
3276 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
3277 InvalidOperationException when the iterator is before the start or
3280 2008-05-06 Marek Safar <marek.safar@gmail.com>
3282 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
3283 when left is nullable type.
3285 2008-05-06 Marek Safar <marek.safar@gmail.com>
3287 A fix for bug #386628
3288 * expression.cs (LocalVariableReference): Continue in resolving when
3289 variable is not assigned.
3291 2008-05-05 Marek Safar <marek.safar@gmail.com>
3293 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
3294 nullable operations.
3296 2008-05-04 Marek Safar <marek.safar@gmail.com>
3298 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
3299 it saves many redundant temporary variables for nullable operations.
3301 2008-05-03 Marek Safar <marek.safar@gmail.com>
3303 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
3305 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
3308 * nullable.cs: Constant coalescing operator optimizations.
3310 2008-05-03 Marek Safar <marek.safar@gmail.com>
3312 * constant.cs: Use unsigned conversion for values which are unsigned only.
3314 2008-05-03 Marek Safar <marek.safar@gmail.com>
3316 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
3317 coalescing operator as it should be.
3319 2008-05-02 Marek Safar <marek.safar@gmail.com>
3321 A fix for bug #371016
3322 * expression.cs: All predefined delegate operators require implicit method
3325 2008-05-02 Marek Safar <marek.safar@gmail.com>
3327 * constant.cs: Emit long constant as uint when fits the range.
3329 * convert.cs, expression.cs: Fixed few unsafe conversions.
3331 2008-05-02 Marek Safar <marek.safar@gmail.com>
3333 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
3335 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
3338 * convert.cs (ImplicitNumericConversion): Don't modify the type of
3340 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
3342 2008-05-01 Marek Safar <marek.safar@gmail.com>
3344 * constant.cs, literal.cs: IsLiteral property for error reporting.
3346 * ecore.cs, expression.cs: Implemented Property expression.
3348 2008-05-01 Marek Safar <marek.safar@gmail.com>
3350 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
3352 * nullable.cs: Implemented nullable coalescing null operator.
3354 * ecore.cs, expression.cs: Expression trees work.
3356 2008-05-01 Marek Safar <marek.safar@gmail.com>
3358 * ecore.cs: CreateExpressionTree is finally abstract.
3360 * expression.cs, linq.cs: Updated.
3362 2008-05-01 Marek Safar <marek.safar@gmail.com>
3364 * expression.cs, ecore.cs: Block base access expression inside expression
3367 2008-05-01 Marek Safar <marek.safar@gmail.com>
3369 A fix for bug #385058
3370 * expression.cs: User-defined operator implementations always take
3371 precedence over predefined operator implementations.
3373 2008-04-30 Marek Safar <marek.safar@gmail.com>
3375 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
3376 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
3377 expression tree conversions.
3379 2008-04-30 Marek Safar <marek.safar@gmail.com>
3381 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
3382 operators method details to Operator class.
3384 2008-04-30 Marek Safar <marek.safar@gmail.com>
3386 * anonymous.cs: Pass unsafe flags to anonymous container.
3388 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
3389 inside expression tree.
3391 2008-04-29 Martin Baulig <martin@ximian.com>
3393 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
3394 (Tokenizer.PopPosition): Also restore the `line'.
3396 2008-04-29 Marek Safar <marek.safar@gmail.com>
3398 * delegate.cs: Implemented Invoke expression.
3400 2008-04-29 Marek Safar <marek.safar@gmail.com>
3402 * expression.cs: Fixed equality reference comparison regression.
3404 2008-04-29 Marek Safar <marek.safar@gmail.com>
3406 * ecore.cs: Clean up EmptyCast hack.
3408 * expression.cs, nullable.cs: Implemented enum binary and unary operations
3409 using correct conversion rules. Also fixes #383993.
3411 2008-04-28 Martin Baulig <martin@ximian.com>
3413 * class.cs (Constructor.Emit): Don't emit debugging information
3414 for generated default .ctor's.
3416 2008-04-28 Marek Safar <marek.safar@gmail.com>
3418 * convert.cs: Empty-cast ushort to int conversion.
3420 2008-04-28 Marek Safar <marek.safar@gmail.com>
3422 A fix for bug #384191
3423 * ecore.cs, expression.cs: Fixed expression cloning.
3425 2008-04-28 Marek Safar <marek.safar@gmail.com>
3427 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3429 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
3431 Fix #381559, test-638.cs, test-639.cs
3432 * assign.cs (CompoundAssign.Helper): New wrapper.
3433 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3435 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3436 Pass unconverted expressions to the params array creation expression.
3437 (FieldExpr.EmitAssign): Don't special-case StringConcat.
3438 (PropertyExpr.EmitAssign): Likewise.
3439 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3440 element if it is of kind CompoundAssign.Helper.
3441 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3442 first before anything else.
3443 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3444 (ArrayAccess.LoadArrayAndArguments): Simplify.
3446 2008-04-27 Marek Safar <marek.safar@gmail.com>
3448 * expression.cs: Fixed cloning of typeof(void).
3450 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
3452 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3453 (Assign.Emit): Likewise. Move it to ...
3454 (CompoundAssign.DoResolve): ... here and ...
3455 (CompoundAssign.Emit): ... here.
3456 (EventAddOrRemove): New helper to handle += and -= on events, and
3457 avoid the use of BinaryDelegates.
3458 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3459 (EventExpr.EmitAddOrRemove): Improve.
3460 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3462 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3463 create VarExprs for 'foo.bar.var'.
3464 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3465 is a highly inappropriate name for its functionality.
3467 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3469 Simplify handling of multiple assignments
3470 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
3472 (SimpleAssign): New. Class to be used for normal assignments.
3473 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3474 * expression.cs, parameter.cs, statement.cs: Likewise.
3476 2008-04-25 Marek Safar <marek.safar@gmail.com>
3478 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3479 for incompatible underlying types, more to come, uff.
3481 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3484 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3485 Handle 'leave_copy'.
3487 2008-04-25 Marek Safar <marek.safar@gmail.com>
3489 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3491 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
3493 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
3494 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3495 * statement.cs (While, Do, For): Allow test to have side effects.
3496 (For.DoEmit): Always emit InitStatement.
3499 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3500 Always create SideEffectConstant.
3501 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3502 of type EnumConstant.
3504 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3505 Handle 'right' being SideEffectConstant of type 'bool'.
3507 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3508 Use left.EmitBranchable instead of open coding it, so as to
3509 improve optimization opportunities.
3511 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3513 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3515 (Expression.EmitSideEffect): Document.
3517 2008-04-23 Marek Safar <marek.safar@gmail.com>
3519 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3521 2008-04-23 Marek Safar <marek.safar@gmail.com>
3523 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3525 2008-04-23 Marek Safar <marek.safar@gmail.com>
3527 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3528 conversion to expression tree.
3530 2008-04-23 Marek Safar <marek.safar@gmail.com>
3532 * ecore.cs: Removed unused expression.
3534 2008-04-22 Marek Safar <marek.safar@gmail.com>
3536 * expression.cs: Implemented NegateChecked and New expressions.
3538 2008-04-22 Marek Safar <marek.safar@gmail.com>
3540 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3542 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
3545 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3546 needing final 'ret' instruction.
3548 2008-04-22 Marek Safar <marek.safar@gmail.com>
3550 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3552 2008-04-21 Marek Safar <marek.safar@gmail.com>
3554 * expression.cs: Emit ldnull and not null expression as an instance argument
3555 of static method expression calls.
3557 2008-04-21 Marek Safar <marek.safar@gmail.com>
3559 A fix for bug #378200
3560 * expression.cs: Fixed crash when creating parameterless expression tree
3563 2008-04-21 Marek Safar <marek.safar@gmail.com>
3565 A fix for bug #375297
3566 * anonymous.cs: Fixed crash when inferring from null argument anonymous
3569 2008-04-21 Marek Safar <marek.safar@gmail.com>
3571 A fix for bug #377596
3572 * decl.cs, class.cs: Emit delegate type argument attributes.
3574 2008-04-21 Marek Safar <marek.safar@gmail.com>
3576 A fix for bug #365314
3577 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3579 2008-04-21 Marek Safar <marek.safar@gmail.com>
3581 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3584 2008-04-21 Marek Safar <marek.safar@gmail.com>
3586 * generic.cs (TypeParameter): Removed redundant location.
3588 2008-04-19 Marek Safar <marek.safar@gmail.com>
3590 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3591 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3592 FullNamedExpression in all declaration type expression, statements will come
3595 2008-04-18 Marek Safar <marek.safar@gmail.com>
3597 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3598 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3600 2008-04-18 Marek Safar <marek.safar@gmail.com>
3602 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3605 2008-04-17 Marek Safar <marek.safar@gmail.com>
3607 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3610 2008-04-17 Marek Safar <marek.safar@gmail.com>
3612 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3616 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
3618 Hook up 'EmitSideEffect'
3619 * constant.cs (Constant.EmitSideEffect): New.
3620 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
3621 (SideEffectConstant.EmitSideEffect): New.
3622 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
3623 unconditional branch in EmitBranchable.
3624 (FieldExpr.EmitBranchable): New.
3625 * expression.cs (Unary.EmitSideEffect): New.
3626 (Binary.EmitSideEffect): New.
3627 (VariableReference.EmitSideEffect): New. Do nothing.
3629 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3631 Introduce 'EmitSideEffect'
3632 * ecore.cs (Expression.EmitSideEffect): New.
3633 (TypeCast): Rename from EmptyCast.
3635 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3636 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3637 * convert.cs, nullable.cs: Update to changes.
3639 2008-04-16 Marek Safar <marek.safar@gmail.com>
3641 * class.cs, cs-parser.jay: Early check for base types expression.
3643 2008-04-16 Marek Safar <marek.safar@gmail.com>
3645 * decl.cs (MemberName): Declare PrettyName as obsolete.
3647 2008-04-16 Marek Safar <marek.safar@gmail.com>
3649 * namespace.cs: Use MemberName comparison.
3651 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
3654 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
3656 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3657 (MemberName.FullyQualifiedName): New. Provides the functionality
3658 that users assume FullName would have.
3659 * ecore.cs, namespace.cs: Update to changes.
3661 * statement.cs (Using.assign): Make into ExpressionStatement.
3662 (Using.EmitPreTryBody): Simplify.
3664 2008-04-16 Marek Safar <marek.safar@gmail.com>
3666 * report.cs: ColorFormat is protected.
3668 * rootcontext.cs: Unused fields clean-up.
3670 * namespace.cs: Made UsingEntry name private.
3672 2008-04-16 Marek Safar <marek.safar@gmail.com>
3674 * cs-tokenizer.cs, location.cs: Removed unused field.
3676 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
3677 Raja R Harinath <harinath@hurrynot.org>
3680 * constant.cs (SideEffectConstant.value): Rename from 'left'.
3681 (SideEffectConstant.side_effect): Rename from 'right'.
3682 (SideEffectConstant..ctor): Normalize 'side_effect'.
3683 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3684 value of this constant.
3685 * cfold.cs: Update to changes.
3687 2008-04-15 Marek Safar <marek.safar@gmail.com>
3689 * cs-paser.jay: Removed unused variable.
3691 * driver.cs: Made Compile instance method.
3693 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
3695 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3697 2008-04-15 Marek Safar <marek.safar@gmail.com>
3699 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
3701 2008-04-13 Jb Evain <jbevain@novell.com>
3703 * namespace.cs: update the System.Core fullname for 2.1
3704 * driver.cs: update the list of required assemblies for 2.1.
3705 Merged from the Moonlight 2 branch.
3707 2008-04-11 Marek Safar <marek.safar@gmail.com>
3709 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3710 types and user defined operators. User operators arguments has to be checked
3711 for null value before invocation, which also means no operator is called
3712 when any argument is not convertible to unwrapped nullable type.
3714 2008-04-09 Marek Safar <marek.safar@gmail.com>
3716 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3717 of Unary expressions to follow operator overloading rules precisely.
3718 Also fixes #321794, #323794
3720 2008-04-08 Marek Safar <marek.safar@gmail.com>
3722 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3725 2008-04-08 Marek Safar <marek.safar@gmail.com>
3727 * expression.cs, ecore.cs: Implemented MemberInit expression.
3729 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
3731 Fix mono/tests/exception4.cs
3732 * statement.cs (ExceptionStatement, TryCatch): Revert to using
3733 ec.NeedReturnLabel () rather emitting a 'nop'.
3735 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3737 (TryCatch.SomeCodeFollows): Likewise.
3738 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3739 for 'break', 'continue' and 'return' statements inside a try.
3740 We're fairly sure that the generated IL stream will have more
3741 instructions textually following the try.
3742 (FlowBranchingTryCatch): Likewise.
3744 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3745 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3748 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3749 wrapper -- forward everything to CollectionForeach.
3750 (CollectionForeach.NonDisposableWrapper): New.
3751 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3752 instead of a pop + branch to end.
3754 2008-04-07 Marek Safar <marek.safar@gmail.com>
3756 A fix for bug #377485
3757 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
3758 Propagate location for extension method groups. Report conversion failure at
3761 2008-04-07 Marek Safar <marek.safar@gmail.com>
3763 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3764 ListInit and Field expressions.
3766 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
3768 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3769 Since $PC is always -1 inside the body of MoveNext, the fault
3771 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3772 * statement.cs (ExceptionStatement.emit_finally): Likewise.
3773 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3775 The denouement! Fix #324708
3776 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3777 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3778 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3779 'finally' inside the finally clause.
3781 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3782 inside an iterator. Don't emit the body of the 'finally' inside
3783 the finally clause yet.
3785 Use the ResumableStatement infrastructure for MoveNext ()
3786 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3787 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
3788 'old_resume_points'. Move dispatcher upfront.
3789 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3790 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3791 in an enumerator. This encodes the main fix in this patch series
3792 -- we can only jump into the first instruction of a try from the
3793 outside, but we want to emit try/finally regions in iterators and
3794 resume in the middle of them.
3796 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
3798 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3799 of NeedReturnLabel here.
3801 Introduce a common point for emitting try/finally to IL
3802 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
3803 features of the various subclasses, which are now driven by ...
3804 (ExceptionStatement.EmitPreTryBody): ... this and ...
3805 (ExceptionStatement.EmitTryBody): ... this and the original
3807 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3808 Remove DoEmit and update to follow above protocol.
3810 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3811 of the dispatcher are the same, skip emitting the 'switch'.
3812 * iterator.cs (Iterator.EmitDispose): Update to changes.
3814 Clean up handling of 'using' statement
3815 * statement.cs (UsingTemporary): New. Carved out of ...
3816 (Using): ... this. Simplify drastically. Handle exactly
3818 * cs-parser.jay (using_statement): Split. Create UsingTemporary
3819 or Using as appropriate. If there are multiple variable declared,
3820 create nested Using statements.
3821 (resource_acquisition): Kill.
3823 * statement.cs (ExceptionStatement.EmitForDispose): Use
3824 EmitFinallyBody, not EmitFinally.
3826 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3827 * iterator.cs: Update to changes.
3829 Start using the ResumableStatement infrastructure
3830 * statement.cs (ResumeableStatement.PrepareForDispose): New.
3831 (ResumableStatement.EmitForDispose): New.
3832 (ExceptionStatement): Override them.
3833 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3834 EmitForDispose to create the body of the Dispose method. Don't
3837 * iterator.cs (Iterator.AddResumePoint): Move here from ...
3838 * statement.cs (Toplevel.AddResumePoint): ... here.
3839 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3840 * flowanalysis.cs (FlowBranchingIterator): New.
3841 * codegen.cs (EmitContext): Update to changes.
3843 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3844 (Iterator.old_resume_points): Rename from 'resume_points'.
3845 (Iterator.MoveNextStatement): Remove unused class.
3847 New infrastructure for try/finally in iterators (still unused)
3848 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3849 (FlowBranchingToplevel.AddResumePoint): Hook into
3850 ToplevelBlock.AddResumePoint.
3851 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3852 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3853 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
3854 resume points and assign program-counter values.
3855 (ExceptionBlock.AddResumePoint): Collect resume points for
3856 de-muxer at the top of try block.
3857 * iterators.cs (Yield.CheckContext): Simplify.
3858 (Yield.Resolve): Use FlowBranching.AddResumePoint.
3860 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
3862 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3863 argument to an ExitStatement.
3864 (FlowBranchingException): Refactor saved origins code.
3865 * statement.cs (ExitStatement): Update to cahges.
3866 * iterator.cs (YieldBreak): Likewise.
3868 * statement.cs (ResumableStatement): New. Common base class for
3869 YieldReturn and ExceptionStatement.
3870 (ExitStatement): New. Common base class for Return and YieldBreak.
3871 (Return): Update to changes.
3872 * iterator.cs (YieldBreak): Likewise.
3873 * lambda.cs (ContextualReturn): Likewise.
3876 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3877 emit a meaningful error message.
3879 Fix #324765, #319508
3880 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3881 (VariableInfo.SetAssigned): Set it.
3882 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3883 determine if CS0219 or CS0168 is appropriate. Don't use
3884 flow-analysis information.
3885 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3886 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
3887 (EmitContext.EndFlowBranching): ... this.
3889 2008-04-03 Marek Safar <marek.safar@gmail.com>
3891 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3893 2008-04-03 Marek Safar <marek.safar@gmail.com>
3895 A fix for bug #376508
3896 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3897 ImplicitConversionExists.
3899 2008-04-03 Marek Safar <marek.safar@gmail.com>
3901 * expression.cs (Binary): Added remaining binary operators to expression
3904 * nullable.cs: Optimize shift with null argument.
3906 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
3908 Fix minor IL regression
3909 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3910 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3911 * cs-parser.jay (try_statement): Update to changes.
3913 * statement.cs (TryFinally.need_exc_block): Delete.
3914 (TryFinally): Update to changes.
3916 Now all ExceptionStatements are unconditional
3917 * statement.cs (CollectionForeach.DisposableWrapper): New.
3918 Extract out the try/finally code into a new wrapper.
3919 (CollectionForeach.Resolve): Use it to simplify the code.
3921 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
3923 Start at simplifying ExceptionStatement semantics a bit
3924 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3925 * cs-parser.jay (try_statement): Update to changes.
3926 (opt_catch_clauses): Remove.
3927 * flowanalysis.cs: Update to changes.
3928 (FlowBranching.BranchingType.TryCatch): New.
3929 (FlowBranchingTryCatch): New.
3931 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3932 (FlowBranching.CreateBranching): Update to changes.
3933 (FlowBranchingBlock.AddSibling): Add sanity check.
3934 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3937 * iterators.cs (Iterator.MarkFinally): Remove.
3938 * statement.cs (ExceptionStatement): Update to changes.
3940 Add support for skipping over finally blocks at runtime. First
3941 in a series to fix #324708
3942 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3943 (Iterator.EmitMoveNext): Initialize it.
3944 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3945 branch over the body of the 'finally' clause.
3947 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
3949 Avoid lopsided use of Foo/DoFoo names
3950 * statement.cs (ExpressionStatement.EmitFinallyBody):
3951 Rename from EmitFinally.
3952 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3953 * iterator.cs: Update to changes.
3955 2008-04-02 Marek Safar <marek.safar@gmail.com>
3957 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3958 based on UserOperatorCall. More binary nullable operators clean up.
3960 2008-04-02 Martin Baulig <martin@ximian.com>
3962 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3964 2008-04-02 Marek Safar <marek.safar@gmail.com>
3966 * nullable.cs: Merge user and empty conversions when lifting expression
3969 * expression.cs (StringConcat): Implemented expression tree representation.
3971 2008-04-01 Marek Safar <marek.safar@gmail.com>
3973 * nullable.cs: When lifting null literal and a user operator exists, no call
3976 2008-04-01 Marek Safar <marek.safar@gmail.com>
3978 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3981 2008-04-01 Marek Safar <marek.safar@gmail.com>
3983 * nullable.cs, expression.cs: Use namespace instead heavily nested
3984 monster abstract class.
3986 2008-04-01 Marek Safar <marek.safar@gmail.com>
3988 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3989 lifting of null literal and user operators. Clean up of some temporary
3992 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3994 Fix #368224, test-629.cs
3995 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3996 if it crossed an unwind-protect boundary.
3997 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3998 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3999 inside an unwind-protected region.
4000 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
4001 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
4002 'leave' instead of a 'br' if unwind-protected.
4003 (Iterator.EmitYieldBreak): Likewise.
4005 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
4007 * driver.cs: Only define versioninfo resources if no win32 resource
4010 2008-03-28 Marek Safar <marek.safar@gmail.com>
4012 A fix for bug #372375
4013 * convert.cs: Fixed boxing of nullable types.
4015 2008-03-28 Marek Safar <marek.safar@gmail.com>
4017 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
4020 2008-03-28 Marek Safar <marek.safar@gmail.com>
4022 A fix for bug #374619
4023 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
4025 2008-03-27 Marek Safar <marek.safar@gmail.com>
4027 * lambda.cs: Check return type only for invocation.
4029 2008-03-27 Marek Safar <marek.safar@gmail.com>
4031 A fix for bug #374214
4032 * ecore.cs: Correctly report argument type mismatch.
4034 2008-03-27 Marek Safar <marek.safar@gmail.com>
4036 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
4037 and not rely on broken IsEnum.
4039 2008-03-27 Marek Safar <marek.safar@gmail.com>
4041 * nullable.cs: New file, extracted from generic.cs.
4043 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
4045 2008-03-27 Marek Safar <marek.safar@gmail.com>
4047 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
4048 predefined comparison operators and null literals.
4050 * report.cs: New warning ID.
4052 2008-03-25 Marek Safar <marek.safar@gmail.com>
4054 A fix for bug #370577
4055 * lambda.cs: Check return type too.
4057 2008-03-25 Marek Safar <marek.safar@gmail.com>
4059 A fix for bug #372846
4060 * class.cs: Automatic properties can be declared as unsafe.
4062 2008-03-20 Marek Safar <marek.safar@gmail.com>
4064 * location.cs: Use string based concatenation.
4066 * expression.cs: LiftedBinaryOperator is gmcs only.
4068 2008-03-20 Marek Safar <marek.safar@gmail.com>
4070 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
4071 conversions rules and expression trees.
4073 2008-03-19 Marek Safar <marek.safar@gmail.com>
4075 * delegate.cs: Use extension method source as delegate target.
4077 2008-03-19 Marek Safar <marek.safar@gmail.com>
4079 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
4080 binary operations to be purely based on binary operations and optimized
4081 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
4082 and other ET refactoring.
4084 * typemanager.cs: Fixed warning.
4086 2008-03-17 Marek Safar <marek.safar@gmail.com>
4088 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
4090 * symbolwriter.cs: Fixed.
4092 2008-03-17 Marek Safar <marek.safar@gmail.com>
4094 * anonymous.cs, driver.cs: Reset anonymous types counters.
4096 2008-03-17 Marek Safar <marek.safar@gmail.com>
4098 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
4100 * class.cs: Use fullname for all type member definitions.
4102 2008-02-19 Martin Baulig <martin@ximian.com>
4105 (IMethodData.EmitExtraSymbolInfo): New interface method.
4106 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
4107 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
4108 interface method here as an empty public virtual method.
4111 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
4112 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
4113 CodeGen.SymbolWriter.SetRealMethodName().
4115 2008-02-18 Martin Baulig <martin@ximian.com>
4118 (ScopeInfo.EmitType): Override this and emit debugging
4119 information for captured variables.
4120 (RootScopeInfo.EmitType): Override this and emit symbol
4121 information for a captured `this'.
4123 2008-02-15 Martin Baulig <martin@ximian.com>
4125 * iterators.cs: Emit debugging info.
4128 (EmitContext.Flags): Add `OmitDebuggingInfo'.
4129 (EmitContext.OmitDebuggingInfo): New public property.
4132 (While): Override Emit() and don't emit symbol info there; do it
4133 inside DoEmit() instead.
4134 (Block.Emit): Omit symbol information while emitting the scope
4135 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
4137 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
4138 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
4139 .ctor to make `IsIterator' work.
4141 2008-03-14 Martin Baulig <martin@ximian.com>
4143 * symbolwriter.cs: Added the new symbol writer function from the
4144 debugger's `terrania' branch; temporarily enclose them inside
4145 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
4148 2008-03-14 Martin Baulig <martin@ximian.com>
4151 (SymbolWriter): Make this a public static class.
4154 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
4155 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
4157 2008-03-14 Marek Safar <marek.safar@gmail.com>
4159 A fix for bug #370577
4160 * statement.cs, lambda.cs: Added extra limitations when dealing with void
4163 2008-03-14 Marek Safar <marek.safar@gmail.com>
4165 * typemanager.cs (CSharpName): Made 250 times faster.
4167 2008-03-13 Marek Safar <marek.safar@gmail.com>
4169 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
4171 2008-03-12 Marek Safar <marek.safar@gmail.com>
4173 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
4174 crash when predefined field does not exist.
4176 2008-03-12 Marek Safar <marek.safar@gmail.com>
4178 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
4180 2008-03-12 Marek Safar <marek.safar@gmail.com>
4182 * class.cs (FixedField): Don't crash when contructors are missing.
4184 2008-03-11 Marek Safar <marek.safar@gmail.com>
4186 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
4187 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
4188 check internal types accessibility for internal and external types.
4189 Replaced EnumToUnderlying by GetEnumUnderlyingType.
4191 2008-03-11 Marek Safar <marek.safar@gmail.com>
4193 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
4194 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
4195 attribute.cs, statement: Use corect instance of predefined types (work
4196 related to #364674).
4198 2008-03-07 Marek Safar <marek.safar@gmail.com>
4200 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
4202 2008-03-07 Marek Safar <marek.safar@gmail.com>
4204 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
4205 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
4206 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
4207 predefined types clean up, delayed predefined types members initialization
4208 (work related to #364674).
4210 2008-03-05 Marek Safar <marek.safar@gmail.com>
4212 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
4214 2008-03-05 Marek Safar <marek.safar@gmail.com>
4216 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
4217 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
4218 predefined types clean up (work related to #364674).
4220 2008-03-04 Marek Safar <marek.safar@gmail.com>
4222 * ecore.cs: Print an error message instead of throwing exception.
4224 2008-03-04 Marek Safar <marek.safar@gmail.com>
4226 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
4227 expression.cs, statement.cs: Unififed null literal representation.
4229 2008-03-03 Marek Safar <marek.safar@gmail.com>
4231 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
4232 expression.cs: Refactored binary operators resolve phase and improved speed.
4233 The nullable code is still missing and won't work correctly, more fixes
4236 It also fixes #323726, #324312, #324248, and many other unreported issues.
4238 2008-02-29 Zoltan Varga <vargaz@gmail.com>
4240 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
4243 2008-02-27 Marek Safar <marek.safar@gmail.com>
4245 * ecore.cs: Clean-up and split BetterConversion.
4247 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
4250 * enum.cs (EnumMember.Value): Only access 'value' if
4251 ResolveValue says it's ok.
4252 (EnumMember.DoResolveValue): Don't set prev_member.value.
4253 (Enum.GetDefinition): Reverse arguments of Equals --
4254 EnumMember.Value can return 'null'.
4256 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
4258 2008-02-22 Marek Safar <marek.safar@gmail.com>
4260 * generic.cs, expression.cs: More ongoing work on expression trees.
4262 2008-02-21 Marek Safar <marek.safar@gmail.com>
4264 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
4265 handle missing matches when mutiple operators exist.
4267 2008-02-20 Marek Safar <marek.safar@gmail.com>
4269 A fix for bug #363218
4270 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
4273 2008-02-20 Marek Safar <marek.safar@gmail.com>
4275 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
4276 update. This time to deal correctly with SideEffectConstant expression used
4277 as an argument for another constant folding.
4279 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
4281 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
4284 2008-02-19 Marek Safar <marek.safar@gmail.com>
4286 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
4288 2008-02-19 Marek Safar <marek.safar@gmail.com>
4290 A fix for bug #328136
4291 * expression.cs: Do not fold immediately LogicalAnd operators when the left
4292 side is a false constant, because we still need to evaluate the right-hand
4295 * statement.cs (If): Emit two types of boolean constants (simple constant,
4296 side-effect constant).
4298 2008-02-19 Marek Safar <marek.safar@gmail.com>
4300 * constant.cs (SideEffectConstant): Don't emit boolean constant.
4302 * expression.cs: Fold immediately LogicalAnd operators when both sides are
4305 2008-02-18 Marek Safar <marek.safar@gmail.com>
4307 A fix for bug #361457
4308 * ecore.cs (IsApplicable): Params methods have lower priority.
4310 * support.cs: Return correct parameter modifier for params types.
4312 2008-02-18 Marek Safar <marek.safar@gmail.com>
4314 * generic.cs (TypeParameter): Cache attribute target name.
4316 * support.cs: Removed unused variable.
4318 * typemanager.cs: Removed debugging leftover.
4320 * ecore.cs: Use local type instead of a property;
4322 * class.cs (VerifyMembers): Consider also parent to test whether type member
4325 * expression.cs (FullMethodDesc): Removed.
4327 * attribute.cs (IsValidArgumentType): Made static.
4329 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
4331 Cleanup to be more readable.
4332 * Makefile (GMCS_PROFILE): Remove.
4333 (COMPILER_NAME): New helper.
4335 2008-02-15 Miguel de Icaza <miguel@novell.com>
4337 * cs-tokenizer.cs: if a conditional expression happens inside a
4338 (...) this also means that we do not need to de-ambiguate between
4339 an parenthesized expression and a cast.
4343 * constant.cs (SideEffectConstant): a constant value that happens
4344 to have a side effect.
4346 Fixes the build regressions introduced by the fix for #359789
4348 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
4350 * expression.cs (Conditional.Emit): when emitting the ternary
4351 operator, use local variables to generate code verifiable code.
4353 The verifier cannot infer that the type on stack before the
4354 stloc.0 is executed is of type ParentB. This happens because the
4355 stack merge algorithm uses only parent types when deciding which
4356 is the common type. This is described in Part III 1.8.1.3 of ECMA
4359 This code compiled with mcs is not verifiable under MS. The MS
4360 verifier picks the first common interface of Foo and Bar, which is
4361 wrong, but doesn't use a full join type of the 2 interfaces.
4363 CSC uses a clever hack to compile such code in a verifiable
4364 way. It stores the intermediate values in a local variable with
4369 2008-02-14 Miguel de Icaza <miguel@novell.com>
4371 * expression.cs: Do not fold BitwiseAnd operators when the left
4372 side is a false constant, because we still need to evaluate the
4377 * support.cs: Instead of throwing an InternalErrorException when
4378 the position of the stream is outside the boundary of our buffer,
4379 reset the state of the reader, and restart the reading from the
4380 beginning of the file.
4382 2008-02-14 Marek Safar <marek.safar@gmail.com>
4384 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
4386 2008-02-14 Marek Safar <marek.safar@gmail.com>
4388 A fix for bug #361686
4389 * decl.cs: A protected types used inside a private class which parents
4390 derives from the protected class are accessible.
4392 2008-02-13 Marek Safar <marek.safar@gmail.com>
4394 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
4395 the parameterless constructor.
4397 2008-02-13 Marek Safar <marek.safar@gmail.com>
4399 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4400 lookup methods to use standard member cache when doing member lookup.
4402 2008-02-12 Marek Safar <marek.safar@gmail.com>
4404 * driver.cs: Don't report full path for referenced module as assembly error.
4406 2008-02-12 Marek Safar <marek.safar@gmail.com>
4408 * Makefile: Fixed `qh' target to work on all machines.
4410 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4411 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4412 and HasElementType with TypeManager implementation.
4414 2008-02-08 Marek Safar <marek.safar@gmail.com>
4416 A fix for bugs #325134, #359749
4417 * expression.cs, ecore.cs: Try to resolve an extension method even if the
4418 first binds point to non-method member expression.
4420 2008-02-08 Marek Safar <marek.safar@gmail.com>
4422 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4424 2008-02-08 Marek Safar <marek.safar@gmail.com>
4426 A fix for bugs #321394, #323028
4427 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4428 Reworked naive IsAccessibleAs implementation to handle nested types.
4430 2008-02-05 Jb Evain <jbevain@novell.com>
4432 * class.cs: use generic type comparison for parameters
4435 2008-02-05 Marek Safar <marek.safar@gmail.com>
4437 A fix for bug #325372
4438 * class.cs: Use generic type comparison when testing method signatures.
4440 2008-02-05 Marek Safar <marek.safar@gmail.com>
4442 A fix for bug #357047
4443 * ecore.cs: Applied C# 3.0 changes to better conversion.
4445 2008-02-05 Marek Safar <marek.safar@gmail.com>
4447 A fix for bug #358374
4448 * cs-parser.jay: Correctly set modifiers for all constructor types.
4450 2008-02-04 Marek Safar <marek.safar@gmail.com>
4452 A fix for bug #355251
4453 * generic.cs: Added base class constraint based type inference.
4455 2008-02-01 Marek Safar <marek.safar@gmail.com>
4457 A fix for bug #357255
4458 * decl.cs: One more missing visibility check.
4460 2008-02-01 Marek Safar <marek.safar@gmail.com>
4462 * support.cs: Fixed broken return.
4464 2008-01-25 Marek Safar <marek.safar@gmail.com>
4466 * report.cs: Correctly reset warnings count after probing.
4468 2008-01-25 Martin Baulig <martin@ximian.com>
4471 (NamespaceEntry.SymbolFileID): Make this work again after
4472 MemberName.ToString() is gone.
4474 2008-01-25 Marek Safar <marek.safar@gmail.com>
4476 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4479 2008-01-25 Marek Safar <marek.safar@gmail.com>
4481 * generic.cs: Use full implicit conversion for type inference fixing.
4483 2008-01-24 Marek Safar <marek.safar@gmail.com>
4485 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4486 Fixed user operator conversions.
4488 2008-01-24 Marek Safar <marek.safar@gmail.com>
4490 * generic.cs: Do nullable type to null comparison optimization during
4493 2008-01-24 Marek Safar <marek.safar@gmail.com>
4495 A fix for bug #355163
4496 * generic.cs: Enabled l-value resolve on nullable expressions.
4498 2008-01-24 Marek Safar <marek.safar@gmail.com>
4500 A fix for bug #353986
4501 * class.cs: Ingore static ctors with parameters for any further checks.
4503 2008-01-24 Marek Safar <marek.safar@gmail.com>
4505 A fix for bug #354310
4506 * namespace.cs: Removed redundant check.
4508 2008-01-24 Marek Safar <marek.safar@gmail.com>
4510 A fix for bug #354928
4511 * expression.cs: ElementInitializers can be resolved only once.
4513 2008-01-24 Marek Safar <marek.safar@gmail.com>
4515 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4516 Condition expressions.
4518 2008-01-23 Marek Safar <marek.safar@gmail.com>
4520 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4522 2008-01-22 Marek Safar <marek.safar@gmail.com>
4524 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4527 * generic.cs: Implemented coalesce expression.
4529 2008-01-22 Marek Safar <marek.safar@gmail.com>
4531 A fix for bug #355145
4532 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4533 expression tree type inference.
4535 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
4538 * expression.cs (Binary.IsUnsignedType): Fix typo.
4540 2008-01-22 Marek Safar <marek.safar@gmail.com>
4542 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4544 2008-01-22 Marek Safar <marek.safar@gmail.com>
4546 A fix for bug #355161
4547 * ecore.cs, expression.cs: Wider range of extension method supported
4550 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
4552 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4553 AssemblyBuilder to operate in compiler context. Fixes mcs part of
4556 2008-01-22 Marek Safar <marek.safar@gmail.com>
4558 A fix for bug #355148
4559 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4561 2008-01-22 Miguel de Icaza <miguel@novell.com>
4563 * expression.cs (CreateExpressionTree): Add support for or and
4564 logical or, and indent following the coding conventions.
4566 * typemanager.cs (LinqExpression): renamed from
4567 ExpressionTreeManager, for a shorter name.
4569 Use TypeManager.CoreLookupType to lookup types from our core
4570 assemblies and turn those into "Type" variables.
4572 Consumers that previously used "Namespace" and "Type" from this
4573 class should instead use the TypeExpression which is a type that
4574 is fully resolved (without involving the regular C# resolution
4577 This typically looks like this:
4579 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4580 new MemberAccess (texpr, name, type_arguments, loc)
4582 This avoids the problem in: #355178
4584 2008-01-21 Marek Safar <marek.safar@gmail.com>
4586 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4587 feature in parser only as we do in other cases.
4589 2008-01-21 Marek Safar <marek.safar@gmail.com>
4591 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4592 typemanager.cs: A refactoring of params arguments to reuse existing
4593 expressions (params -> array initializer) to emit params argument instead
4594 of specialized handling.
4595 It was required by expression tree implementation and it has other benefits
4596 as well, we now apply same optimization for params arguments as we do for
4599 2008-01-18 Marek Safar <marek.safar@gmail.com>
4601 A fix for bug #353526
4602 * generic.cs: A type inference of params arguments may not required any
4603 temporary array creation.
4605 2008-01-18 Marek Safar <marek.safar@gmail.com>
4607 A fix for bug #353534
4608 * generic.cs, ecore.cs, expression.cs: A method group type inference is
4609 supported for delegates only.
4611 2008-01-18 Marek Safar <marek.safar@gmail.com>
4613 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4614 type for more than 1 candidates.
4616 2008-01-18 Marek Safar <marek.safar@gmail.com>
4618 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4621 2008-01-16 Marek Safar <marek.safar@gmail.com>
4623 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4624 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4625 operator) expressions.
4627 2008-01-16 Zoltan Varga <vargaz@gmail.com>
4629 * statement.cs: Avoid declaring an IL variable for this_variable since it is
4630 not accessed from the generated IL.
4632 2008-01-14 Marek Safar <marek.safar@gmail.com>
4634 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4635 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4636 statement.cs: The first expression tree implementation drop, mostly
4637 infrastructure work.
4639 2008-01-14 Marek Safar <marek.safar@gmail.com>
4641 * ecore.cs (IsNestedChild): Refactored.
4643 2008-01-11 Marek Safar <marek.safar@gmail.com>
4645 * lambda.cs: Don't use a cast on unknown expression statement.
4647 2008-01-10 Geoff Norton <gnorton@novell.com>
4649 * cs-tokenizer.cs: One more token to distinguish between method and lambda
4652 2008-01-09 Marek Safar <marek.safar@gmail.com>
4654 * doc.cs: Report better /doc crash details.
4656 2008-01-09 Marek Safar <marek.safar@gmail.com>
4658 A fix for bug #352536
4659 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4661 2008-01-08 Marek Safar <marek.safar@gmail.com>
4663 A fix for bug #352287
4664 * ecore.cs, expression.cs: Do `this' access checking in all member access
4667 2008-01-08 Marek Safar <marek.safar@gmail.com>
4669 * rootcontext.cs, driver.cs: Switch to linq mode by default.
4671 * report.cs: Reset message stacks.
4673 2008-01-08 Marek Safar <marek.safar@gmail.com>
4675 * generic.cs (InferInPhases): Correctly calculate params position.
4677 2008-01-08 Marek Safar <marek.safar@gmail.com>
4679 * cs-tokenizer.cs: No need to parse full string when parsing lambda
4682 2008-01-07 Marek Safar <marek.safar@gmail.com>
4684 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4686 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4688 * driver.cs: Updated --help option.
4690 2008-01-07 Marek Safar <marek.safar@gmail.com>
4692 * generic.cs (InferParamsTypeArguments): Removed.
4693 (InferInPhases): Add params type inference.
4694 (LowerBoundInference): Fixed scoring mechanism.
4696 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4698 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
4700 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4701 byte array for unsigned "baked" assemblies.
4703 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
4705 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4706 array for assemblies that are not strongnamed.
4708 2008-01-04 Marek Safar <marek.safar@gmail.com>
4710 A fix for bug #351481
4711 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4712 declaring type for nested generic types.
4714 2008-01-04 Marek Safar <marek.safar@gmail.com>
4716 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4717 instead of ToString.
4719 2008-01-03 Marek Safar <marek.safar@gmail.com>
4721 A fix for bug #351047
4722 * expression.cs (Binary.ResolveOperator): Allow equality operators between
4723 null and structs only when equality and inequality operators are defined
4724 either as an user-operators or predefined operators.
4726 2008-01-03 Marek Safar <marek.safar@gmail.com>
4728 A fix for bug #351047
4729 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4731 2008-01-03 Marek Safar <marek.safar@gmail.com>
4733 A fix for bug #351257
4734 * cs-tokenizer.cs: Advance line number for '\r' correctly.
4736 2008-01-03 Marek Safar <marek.safar@gmail.com>
4738 A fix for bug #351157
4739 * class.cs (Using): Fixed yet another broken cloning.
4741 (Block): Put back more sensible default value for statements.
4743 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
4745 * codegen.cs: Allow AssemblyVersion with only major version component.
4748 2007-12-29 Marek Safar <marek.safar@gmail.com>
4750 A fix for bug #324654
4751 * class.cs: Use FullName property as member name.
4753 2007-12-28 Marek Safar <marek.safar@gmail.com>
4755 A fix for bug #342117
4756 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4757 constructor constraint.
4759 2007-12-28 Marek Safar <marek.safar@gmail.com>
4761 A fix for bug #338273
4762 * class.cs (ProbertyBase): Access modifier checks are required for overrides
4765 2007-12-28 Marek Safar <marek.safar@gmail.com>
4767 A fix for bug #350839
4768 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4770 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4772 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4775 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4777 * statement.cs: Changed some Hashtables to use HybridDictionaries
4778 instead. It was observed that some HashTables only contained a few
4779 items in the vast majority of cases. Since HybridDictionary is
4780 more efficient on small sets (<10 elements), "known_variables"
4781 from class ExplicitBlock as well as "labels" and "constants " from
4782 class Block were changed to HybridDictionaries.
4784 Atsai results: (56216kb->54987kb)
4786 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4789 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
4791 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4794 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
4796 * expression.cs: foreach loop to for loop, saved on allocation of
4797 enumerator (59333kb->59141kb)
4799 * statement.cs. Changed foreach loops to for loops, saved on
4800 allocation of enumerator (59141kb->59006kb)
4802 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4803 when constructed with no specified capacity. This was causing a
4804 few ArrayLists to allocate more memory than they would potentially
4805 need in the Block class and MemberCache class. Setting the
4806 ArrayLists to construct with a capacity of 1 saves some
4807 memory. (56216kb->55585kb)
4809 2007-12-27 Marek Safar <marek.safar@gmail.com>
4811 A fix for bug #347189 (2nd issue)
4812 * expression.cs (MemberAccess): Nested type can be found in base non-generic
4815 2007-12-27 Miguel de Icaza <miguel@novell.com>
4817 * report.cs: Do not use colors if stdout and stderr are not a
4820 2007-12-27 Marek Safar <marek.safar@gmail.com>
4822 A fix for bug #346998
4823 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4826 2007-12-27 Marek Safar <marek.safar@gmail.com>
4828 A fix for bug #343465
4829 * class.cs: Explicit method name for nested types uses dots only.
4831 2007-12-27 Marek Safar <marek.safar@gmail.com>
4833 A fix for bug #343707
4834 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4836 2007-12-27 Marek Safar <marek.safar@gmail.com>
4838 * ecore.cs: Report type inference errors only when arguments count matches
4841 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4843 * expression.cs, report.cs: New warning.
4845 * typemanager.cs: Catch anonymous method type too.
4847 2007-12-23 Marek Safar <marek.safar@gmail.com>
4849 A fix for bug #346379
4850 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4852 2007-12-23 Marek Safar <marek.safar@gmail.com>
4854 A fix for bug #347359
4855 * expression.cs (Invocation): Don't resolve already resolved expression.
4857 2007-12-23 Marek Safar <marek.safar@gmail.com>
4859 A fix for bug #347189
4860 * class.cs (FixedField): Use non-dependent code only in the define phase.
4862 2007-12-23 Marek Safar <marek.safar@gmail.com>
4864 A fix for bug #348076
4865 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4867 2007-12-22 Marek Safar <marek.safar@gmail.com>
4869 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4870 discovered extension methods.
4872 2007-12-22 Marek Safar <marek.safar@gmail.com>
4874 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4877 2007-12-21 Miguel de Icaza <miguel@novell.com>
4879 * report.cs (ErrorMessage): Add support for using colors on
4880 terminals that support it.
4882 2007-12-21 Marek Safar <marek.safar@gmail.com>
4884 * ecore.cs: Use information about expanded params for error reporting.
4886 2007-12-21 Marek Safar <marek.safar@gmail.com>
4888 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4889 and logic for params overloads.
4891 2007-12-15 Miguel de Icaza <miguel@novell.com>
4893 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4894 as this is also created from the parser. Fixes #349034
4896 2007-12-12 Miguel de Icaza <miguel@novell.com>
4898 * statement.cs (Throw.CloneTo): it is valid to have empty
4899 expressions for throw.
4901 2007-12-03 Marek Safar <marek.safar@gmail.com>
4903 * cs-parser.jay: Set delegate constraint parsing region correctly.
4905 2007-12-03 Marek Safar <marek.safar@gmail.com>
4907 A fix for bug #345467
4908 * typemanager.cs (IsEqual): Compare generic parameters position only.
4910 2007-11-28 Marek Safar <marek.safar@gmail.com>
4912 * expression.cs (BaseAccess): Type arguments can be null.
4914 2007-11-27 Raja R Harinath <harinath@gmail.com>
4916 * statement.cs (Block.Resolve): Ensure flow-branching tree is
4917 consistent even when an error has occured.
4918 (Switch.Resolve): Likewise.
4920 2007-11-22 Marek Safar <marek.safar@gmail.com>
4922 A fix for bug #334505
4923 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4926 2007-11-22 Marek Safar <marek.safar@gmail.com>
4928 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
4929 refactorings required to resolve extension methods correctly when mixing
4930 generics and non-generics members.
4932 2007-11-20 Marek Safar <marek.safar@gmail.com>
4934 A fix for bug #342584
4935 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4938 2007-11-19 Marek Safar <marek.safar@gmail.com>
4940 A fix for bug #342512
4941 * delegate.cs: Use delegate argument expression when is available. Don't
4942 emit virtual call when class is sealed.
4944 2007-11-16 Marek Safar <marek.safar@gmail.com>
4946 A fix for bug #325423
4947 * assign.cs (FieldInitializer): Use resolved expression for emit.
4949 * class.cs: Print less confusing error message.
4951 2007-11-16 Marek Safar <marek.safar@gmail.com>
4953 * cs-tokenizer.cs: Removed GMCS ifdefs.
4955 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4958 * cs-parser.jay: Disabled nullable check.
4960 * generic-mcs: Copied more generic stuff.
4962 2007-11-16 Marek Safar <marek.safar@gmail.com>
4964 * gcs-parser.jay: Merged to cs-parser.jay.
4966 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4967 * *.csproj, *.sources: Updated to use only jay parser file.
4969 2007-11-16 Marek Safar <marek.safar@gmail.com>
4971 * gcs-parser.jay: Added nullable and default expression feature checks.
4973 2007-11-16 Marek Safar <marek.safar@gmail.com>
4975 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4976 it fixes many TODOs and hidden bugs.
4978 * expression: Removed duplicate error check.
4980 2007-11-15 Marek Safar <marek.safar@gmail.com>
4982 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4983 implicitly type local variable only when it is used in a declaration.
4985 2007-11-15 Marek Safar <marek.safar@gmail.com>
4987 * attribute.cs: Use CS0612 for empty strings.
4989 2007-11-14 Marek Safar <marek.safar@gmail.com>
4991 * lambda.cs, statement.cs: Contextual return may act as a statement.
4993 2007-11-14 Marek Safar <marek.safar@gmail.com>
4995 A fix for a regression cause by #324222
4996 * class.cs: Don't report unused even when it implements an interface.
4998 2007-11-13 Marek Safar <marek.safar@gmail.com>
5000 A fix for bug #341205
5001 * ecore.cs, expression.cs: Method group expression cannot do static
5002 method access with an instance reference check before overloading takes
5005 2007-11-13 Marek Safar <marek.safar@gmail.com>
5007 A fix for bug #325359
5008 * class.cs: Use predictable name for automatically generated property.
5010 2007-11-12 Marek Safar <marek.safar@gmail.com>
5012 A fix for bug #324996
5013 * expression.cs (Is): Handle case where D is nullable and T is not
5016 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
5018 2007-11-12 Marek Safar <marek.safar@gmail.com>
5020 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
5021 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
5022 Flush small error reporting changes.
5024 2007-11-09 Marek Safar <marek.safar@gmail.com>
5026 A fix for bug #324996
5027 * expression.cs: Rewrote Is expression implementation to work with
5028 generics, nullable types, anonymous method. A const result expression
5029 uses existing infrastructure instead of custom not fully-featured one.
5031 2007-11-08 Marek Safar <marek.safar@gmail.com>
5033 A fix for bug #340202
5034 * class.cs: Consider generics for volatile field.
5036 2007-11-08 Marek Safar <marek.safar@gmail.com>
5038 A fix for bug #335594
5039 * expression.cs: Use conversion rules when handling string addition.
5041 2007-11-07 Marek Safar <marek.safar@gmail.com>
5043 A fix for bug #336651
5044 * expression.cs: Fixed a crash when probing is on.
5046 2007-11-07 Marek Safar <marek.safar@gmail.com>
5048 A fix for bug #324242
5049 * covert.cs: Added a conversion from any nullable-type with an
5050 underlying enum-type to the type System.Enum.
5052 2007-11-07 Marek Safar <marek.safar@gmail.com>
5054 A fix for bug #324222
5055 * class.cs: Report all non-used event fields.
5057 2007-11-07 Marek Safar <marek.safar@gmail.com>
5059 A fix for bug #325161
5060 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
5061 qualifier for generic types.
5063 2007-11-07 Marek Safar <marek.safar@gmail.com>
5065 A fix for bug #322971
5066 * expression.cs, ecore.cs: Added intermediate result value check for
5069 2007-11-07 Marek Safar <marek.safar@gmail.com>
5071 A fix for bug #324754
5072 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
5073 when it was requested.
5075 2007-11-07 Marek Safar <marek.safar@gmail.com>
5077 A fix for bug #325101
5078 * expression.cs: Do type not value comparison for `is' expression.
5080 2007-11-07 Marek Safar <marek.safar@gmail.com>
5082 A fix for bug #320236
5083 * convert.cs: Don't apply user conversion on underlying target type.
5085 2007-11-06 Marek Safar <marek.safar@gmail.com>
5087 * expression.cs: Don't use unresolved expression for error reporting.
5089 2007-11-06 Marek Safar <marek.safar@gmail.com>
5091 A fix for bugs #337712, #324490
5092 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
5093 overloading resolution too.
5095 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
5096 the process consistent and more robust.
5098 * expression.cs, linq.cs, report.cs: Update.
5100 2007-11-02 Marek Safar <marek.safar@gmail.com>
5102 A fix for bug #332909
5103 * attribute.cs: Resolve attributes in correct context using error
5106 * rootcontext.cs: Define Obsolete attribute members as core members.
5108 2007-11-02 Marek Safar <marek.safar@gmail.com>
5110 * statement.cs: Removed unused methods.
5112 2007-10-31 Wade Berrier <wberrier@novell.com>
5114 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
5115 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
5118 2007-10-31 Marek Safar <marek.safar@gmail.com>
5120 A fix for bug #338102
5121 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
5122 methods registered as non-generics.
5124 2007-10-31 Marek Safar <marek.safar@gmail.com>
5126 A fix for bugs #337712, #324490
5127 * delegate.cs: Delegate covariance and contravariance is not allowed for
5130 2007-10-31 Marek Safar <marek.safar@gmail.com>
5132 A fix for bug #337719
5133 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
5136 2007-10-30 Marek Safar <marek.safar@gmail.com>
5138 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
5140 2007-10-29 Marek Safar <marek.safar@gmail.com>
5142 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
5145 2007-10-29 Raja R Harinath <rharinath@novell.com>
5147 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
5149 2007-10-29 Marek Safar <marek.safar@gmail.com>
5151 A fix for bug #334652
5152 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
5153 extension methods when we have not found the best candidate in normal
5156 2007-10-27 Marek Safar <marek.safar@gmail.com>
5158 * AssemblyInfo.cs: Keep up-to-date.
5160 2007-10-27 Marek Safar <marek.safar@gmail.com>
5162 * Makefile: Fixed generics compiler name.
5164 2007-10-27 Marek Safar <marek.safar@gmail.com>
5166 * lambda.test: removed, lambda parsing is done differently.
5168 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
5170 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
5172 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
5174 2007-10-27 Marek Safar <marek.safar@gmail.com>
5176 * Makefile, *.sources : All C# compilers are in mcs folder.
5178 * *.cs: Use existing 2_1 define for smcs.
5180 2007-10-26 Marek Safar <marek.safar@gmail.com>
5182 A fix for bug #335847
5183 * assign.cs, expression.cs: Couple of changes to avoid creating a
5184 temporary variable for each object initializer assignment statement. It
5185 simplifies struct initialization too, otherwise two temporary variables
5187 Implemented optimization of redundant default element initializers.
5189 2007-10-25 Marek Safar <marek.safar@gmail.com>
5191 A fix for bug #336766
5192 * expression.cs (Class.CheckBase): Use generic name when method is
5195 2007-10-25 Marek Safar <marek.safar@gmail.com>
5197 A fix for bug #334737
5198 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
5199 variable and not variable argument for prepared copies.
5201 2007-10-24 Marek Safar <marek.safar@gmail.com>
5203 A fix for bug #325110
5204 * class.cs, expression.cs, attribute.cs: Use open generic method when
5205 checking conditional attribute.
5207 2007-10-24 Marek Safar <marek.safar@gmail.com>
5209 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
5210 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
5211 FeatureIsNotAvailable.
5213 2007-10-24 Marek Safar <marek.safar@gmail.com>
5215 ** C# 3.0 Partial methods
5217 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
5218 methods support. Because of member cache issue with generics only
5219 non-generics partial methods are fully supported.
5221 2007-10-23 Marek Safar <marek.safar@gmail.com>
5223 * class.cs, decl.cs: Rewrote member overloads check to cope with
5224 generics and to use member cache for member checking. It also improves
5225 performance and fixes remaining overloads issues.
5227 2007-10-20 Marek Safar <marek.safar@gmail.com>
5229 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
5230 roottypes.cs, typemanager.cs:
5232 A member cache creation logic changed to add members immediately and
5233 not rely on fallback. The member cache is now only prefered way
5234 how to access and find type declaration members. It saves 5 MB of memory
5235 during MWF compilation and makes code ready for more optimizations and
5236 clean-ups, it's also a pre-requirement for partial methods.
5238 2007-10-18 Raja R Harinath <harinath@gmail.com>
5240 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
5241 handling for generic parameters.
5243 2007-10-15 Marek Safar <marek.safar@gmail.com>
5245 * class.cs (FixedField): Removed redundant volatile check.
5247 2007-10-15 Marek Safar <marek.safar@gmail.com>
5249 * class.cs, decl.cs: Fixed overload members verification to do only one
5250 check per possible collision.
5252 2007-10-13 Marek Safar <marek.safar@gmail.com>
5254 A fix for bug #325478
5255 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
5256 and create only one disposable flags container.
5258 2007-10-12 Marek Safar <marek.safar@gmail.com>
5260 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
5261 * statement.cs (Fixed): Fixed variables cloning.
5263 2007-10-12 Marek Safar <marek.safar@gmail.com>
5265 A fix for bug #333342
5266 * class.cs (EventField): Don't mark value type event as synchronized.
5268 2007-10-12 Marek Safar <marek.safar@gmail.com>
5270 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
5271 inference to identify best candidate method correctly.
5272 (ProperyExpr): A range variable is read only and cannot be modified.
5274 2007-10-11 Marek Safar <marek.safar@gmail.com>
5276 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
5277 logic to identify best candidate method correctly.
5279 2007-10-11 Marek Safar <marek.safar@gmail.com>
5281 * location.cs (Equals, GetHashCode): Removed.
5283 2007-10-11 Marek Safar <marek.safar@gmail.com>
5285 * report.cs: Implemented message recorder. It is used mainly for lambda
5286 expressions to capture otherwise swallowed error messages.
5288 * anonymous.cs, lambda.cs.cs: Do full parameters check.
5290 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
5292 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
5294 * expression.cs (MemberAccess): Always report lookup failure.
5296 * location.cs: Implemented Equals, GetHashCode.
5298 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
5300 2007-10-10 Jb Evain <jbevain@novell.com>
5302 * codegen.cs: re-enable assembly version check.
5304 2007-10-09 Marek Safar <marek.safar@gmail.com>
5306 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
5309 * namespace.cs (UsingAlias): Do correct version check.
5311 2007-10-08 Marek Safar <marek.safar@gmail.com>
5313 * expresison.cs, ecore.cs: Issue extension method error message when
5316 * rootcontext.cs: Added ISO_2 compiler mode option.
5318 2007-10-08 Marek Safar <marek.safar@gmail.com>
5320 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
5323 2007-10-08 Marek Safar <marek.safar@gmail.com>
5325 * attribute.cs (GetString, GetBoolean): Work with both literal and
5328 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
5329 Moved method overload specific methods to MethodGroupExpr.
5331 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
5332 it should be less memory consuming.
5334 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5336 * codegen.cs: remove the assembly version check until the buildbot is
5339 2007-10-07 Jb Evain <jbevain@novell.com>
5341 * attribute.cs (Attribute.GetString): if the value
5342 expression is a StringConstant, return its string value.
5344 2007-10-07 Jb Evain <jbevain@novell.com>
5346 * typemanager.cs: add `assembly_version_attribute_type`.
5347 * codegen.cs: on attribute emission, check that the
5348 AssemblyVersionAttribute doesn't overflow.
5350 2007-10-05 Marek Safar <marek.safar@gmail.com>
5352 A fix for bug #324677
5353 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
5354 parent container of a scope container with currently resolved one.
5356 2007-10-05 Marek Safar <marek.safar@gmail.com>
5358 A fix for bug #325534
5359 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
5362 2007-10-05 Marek Safar <marek.safar@gmail.com>
5364 A fix for bug #327504
5365 * class.cs (Operator.Define): Refactored implicit and explicit user
5366 operator conversion rules.
5368 2007-10-05 Marek Safar <marek.safar@gmail.com>
5370 A fix for bug #327520
5371 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
5373 2007-10-04 Marek Safar <marek.safar@gmail.com>
5375 A fix for bug #328022
5376 * class.cs (MethodData.Define): Use correct method to check whether
5377 a method implementents an accessor.
5379 2007-10-04 Marek Safar <marek.safar@gmail.com>
5381 A fix for bug #330069
5382 * statement.cs (Fixed.Resolve): Read the first array element only when
5383 an array is instantiated.
5385 2007-10-04 Marek Safar <marek.safar@gmail.com>
5387 * expression.cs, assign.cs, generics.cs: Print correct operator when
5388 compound assignment is used.
5390 2007-10-04 Marek Safar <marek.safar@gmail.com>
5392 A fix for bug #325841
5393 * expression.cs (ArrayAccess): Use full argument cloning only for
5394 string compound concatenation.
5396 2007-10-03 Marek Safar <marek.safar@gmail.com>
5398 A fix for bug #328774
5399 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5401 (PropertyExpr.EmitAssign): Fixed string concatenation compound
5404 2007-10-03 Raja R Harinath <rharinath@novell.com>
5407 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5408 Event accessibility checks here. Remove some bogus code that
5409 accidently made GenericMethods work.
5410 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5412 2007-09-25 Marek Safar <marek.safar@gmail.com>
5414 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5416 * statement.cs (Block): Refactored AddVariable to allow error handling
5419 * generic.cs: New stub.
5421 2007-09-23 Marek Safar <marek.safar@gmail.com>
5423 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5426 2007-09-17 Marek Safar <marek.safar@gmail.com>
5428 * class.cs: Use partial container to record whether any partial part
5429 contains static field initializer and therefore default contructor has
5432 2007-09-14 Marek Safar <marek.safar@gmail.com>
5434 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5435 mono-list when only one of two partial parts has defined accessibility
5438 2007-09-14 Marek Safar <marek.safar@gmail.com>
5440 A fix for bug #82845
5442 * class.cs (TypeContainer): Set correct resolve context for all field
5445 2007-09-13 Marek Safar <marek.safar@gmail.com>
5447 * assign.cs: Fixed a crash when field is resolved twice with an error.
5449 * codegen.cs: Changed InFieldInitializer to be flag.
5451 * anonymous.cs, ecore.cs, expression.cs: Update after
5452 IsInFieldInitializer rename.
5454 * const.cs: Removed unused parameter.
5456 * class.cs: Changed the way how we resolve and emit field initializers.
5457 The field initilizers have to have access to contructor block to emit
5458 compiler generated code.
5460 2007-09-13 Marek Safar <marek.safar@gmail.com>
5462 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5463 generics use TypeContainer instead.
5465 2007-09-12 Marek Safar <marek.safar@gmail.com>
5467 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5469 * lambda.cs (ResolveParameters): Use more powerful
5470 InflateGenericArgument.
5472 * parameters.cs: Better exception message.
5474 2007-09-10 Marek Safar <marek.safar@gmail.com>
5476 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5477 correct expression block type.
5479 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5481 * expression.cs (Invocation): Extracted method group resolve to
5484 2007-09-07 Marek Safar <marek.safar@gmail.com>
5486 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5487 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5489 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5490 generic extension methods.
5492 2007-09-06 Marek Safar <marek.safar@gmail.com>
5494 A fix for bug #82676 (Do I get it right now?)
5495 * convert.cs (Binary.ResolveOperator): An interface is converted to the
5496 object before a standard conversion is applied.
5498 2007-09-06 Marek Safar <marek.safar@gmail.com>
5500 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5503 2007-09-05 Marek Safar <marek.safar@gmail.com>
5505 A fix for bug #82676
5506 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5507 non-generic interface types.
5509 2007-09-05 Marek Safar <marek.safar@gmail.com>
5511 A fix for bug #82690
5512 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5514 2007-09-05 Marek Safar <marek.safar@gmail.com>
5516 A fix for bug #82571
5517 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
5518 modifier for container based methods.
5520 2007-09-05 Marek Safar <marek.safar@gmail.com>
5522 A fix for bug #82676
5523 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5524 any interface-type T means to any of interface type T.
5526 2007-09-04 Marek Safar <marek.safar@gmail.com>
5528 * namespace.cs: We have 2 versions of System.Core assembly.
5530 2007-09-04 Marek Safar <marek.safar@gmail.com>
5532 A fix for bug #82652
5533 * class.cs (Class.GetClassBases): Compare types and not expressions.
5535 2007-09-04 Marek Safar <marek.safar@gmail.com>
5537 A fix for bug #82620
5538 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5539 actually never worked before.
5540 (IndexerAccess): Emit prepared arguments before they are modified.
5542 2007-09-04 Marek Safar <marek.safar@gmail.com>
5544 A fix for bug #82563
5545 * assign.cs: Revert wrong fix.
5547 * expression.cs (VariableReference.EmitAssign): Handle ref reference
5549 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5550 Instead of ldelema/stdind we have to use temporary variables to handle
5551 cases like String.Concat (params string[]).
5553 2007-08-31 Marek Safar <marek.safar@gmail.com>
5555 * class.cs: EmitAttributes to Emit rename.
5557 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5559 (MemberCore.HasClsCompliantAttribute): Don't depend on
5560 GetClsCompliantAttributeValue execution.
5562 2007-08-31 Marek Safar <marek.safar@gmail.com>
5564 * anonymous.cs: Use shorter type prefix.
5566 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5569 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5570 variables when probing is on.
5572 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
5573 unresolved variables.
5574 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5575 handle transparent identifiers.
5577 2007-08-26 Marek Safar <marek.safar@gmail.com>
5579 * attribute.cs (IsClsCompliant): Add nullable types test.
5581 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
5583 * doc.cs : catch other types of exception than XmlException to
5584 report CS1570. Fixed bug #82565.
5586 2007-08-23 Marek Safar <marek.safar@gmail.com>
5588 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
5589 The number of delegate parameters has to match.
5590 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5593 2007-08-21 Marek Safar <marek.safar@gmail.com>
5595 * anonymous.cs (AnonymousMethod): Generate private anonymous method
5596 to fix problem with private arguments.
5598 2007-08-20 Marek Safar <marek.safar@gmail.com>
5600 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5602 * decl.cs (MemberName): Ignore generic type with no generic arguments.
5604 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5605 empty. Add cloning suport.
5607 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5609 2007-08-20 Marek Safar <marek.safar@gmail.com>
5611 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
5612 to create EmptyCast. It handles EmptyConstantCast specialization for
5615 2007-08-18 Marek Safar <marek.safar@gmail.com>
5617 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5618 (EmitArrayArgument): One routine for array arguments.
5619 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
5621 2007-08-17 Marek Safar <marek.safar@gmail.com>
5623 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5625 2007-08-17 Marek Safar <marek.safar@gmail.com>
5627 * anonymous.cs: MemberLookupFinal update.
5629 * class.cs (ConstructorInitializer): Is expression based.
5631 * delegate.cs: MethodGroupExpr update.
5633 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
5635 (Error_MemberLookupFailed): Customizable error override.
5636 (MethodGroupExpr): Keep queried type for later usage.
5637 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5640 * expression.cs: Error_MemberLookupFailed refactoring.
5641 (New.DoResolve): Resolve as much as possible.
5642 (ElementInitializer.Error_MemberLookupFailed): Object initializer
5643 customization for invalid member types.
5645 * statement.cs: MethodGroupExpr update.
5647 2007-08-16 Marek Safar <marek.safar@gmail.com>
5649 * modifier.cs (Check): Check all modifiers and not only accessibility
5652 2007-08-16 Marek Safar <marek.safar@gmail.com>
5654 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5655 type and not an expression.
5657 2007-08-16 Marek Safar <marek.safar@gmail.com>
5659 * statement.cs (Catch.Clone): Type and variable can be null.
5661 2007-08-16 Marek Safar <marek.safar@gmail.com>
5663 A fix for bug #81979
5664 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5665 I am really not sure whether this is the best fix.
5667 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5670 2007-08-14 Marek Safar <marek.safar@gmail.com>
5672 ** C# 3.0 Object and collection initializers (major re-write)
5674 * assign.cs (DoResolve): Initializers are not assign related.
5676 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5677 used during collection or object initialization.
5679 * expression.cs (Error_InvalidArguments): Add initializers specific
5680 messages. More will come later because it requires some general
5682 (New.DoResolve): Better error handling for unsafe types.
5683 (EmptyExpressionStatement): New class.
5684 (ElementInitializer): An object initializer expression.
5685 (CollectionElementInitializer): A collection initializer expression.
5686 (CollectionOrObjectInitializers): A block of object or collection
5688 (NewInitialize): New expression with element/object initializers.
5690 * statement.cs: Reverted object/collection initializer hacks.
5692 * typemanager.cs (CSharpName): Filter __arglist type.
5694 2007-08-09 Marek Safar <marek.safar@gmail.com>
5696 ** C# 3.0 Anonymous Types (update to the latest standard)
5698 * expression.cs (Binary.ResolveOperator): Threat all null based types
5700 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5701 (AnonymousTypeParameter): Updated.
5703 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5704 (AnonymousTypeClass): New anonymous type container.
5706 * class.cs (AddField): Return operation result.
5708 * generic.cs: Another empty TypeArguments overload.
5710 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5711 are stored at top of normal hierarchy.
5713 * typemanager.cs (CSharpName): Filter anonymous types.
5715 2007-08-09 Marek Safar <marek.safar@gmail.com>
5717 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5718 as single Concat call. How could we miss that :-(
5720 2007-08-08 Marek Safar <marek.safar@gmail.com>
5722 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5724 2007-08-07 Miguel de Icaza <miguel@novell.com>
5726 * expression.cs: Fix the previous commit, the creation of the
5727 arguments array list needs also to be conditional on the arguments
5730 * class.cs: Add a little bit of help to help narrow down problems.
5732 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5733 not try to copy in that case.
5735 * driver.cs: When building SMCS, include a new different set of
5736 default assemblies here. Do this here so we can control whether
5737 to include the default assemblies with /noconfig.
5739 2007-08-03 Marek Safar <marek.safar@gmail.com>
5741 A fix for bug #81979
5742 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5745 2007-08-03 Marek Safar <marek.safar@gmail.com>
5747 A fix for bug #82300
5749 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5750 we are in probing scope.
5752 2007-08-03 Marek Safar <marek.safar@gmail.com>
5754 A fix for bug #82301
5756 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5757 (Statement.CloneTo): Clone and not map children blocks.
5759 2007-08-03 Marek Safar <marek.safar@gmail.com>
5761 A fix for bug #82299
5763 * expression.cs (LocalVariableReference.CloneTo): Remap local info
5766 * statement.cs (Statement.CloneTo): Clone variables before statements
5767 to allow remaping of local variables.
5769 2007-08-03 Marek Safar <marek.safar@gmail.com>
5771 A fix for bug #82296
5774 * report.cs: Log crash details for future clone problems.
5776 * statement.cs (Return.Clone): Don't clone non-existent expression.
5778 2007-08-03 Raja R Harinath <harinath@gmail.com>
5780 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5781 (Class.AddBasesForPart): Move CS0537 check here from ...
5782 * cs-parser.jay (class_declaration): ... here. Move calling of
5783 'AddBasesForPart' to ...
5784 (class_bases): ... here.
5785 (struct_declaration, interface_declaration): Update to changes.
5787 2007-08-02 Marek Safar <marek.safar@gmail.com>
5789 A fix for bug #81923
5791 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5792 conversion is allowed.
5794 2007-08-02 Marek Safar <marek.safar@gmail.com>
5796 A fix for bug #81564
5798 * ecore.cs (EventExpr): Add IsBase handling.
5800 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5803 2007-08-02 Raja R Harinath <harinath@gmail.com>
5805 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5806 * cs-parser.jay: Some whitespace cleanups.
5807 (current_delegate): New.
5809 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5810 a dummy code block, and use 'type_name' instead of 'member_name'.
5811 (interface_declaration, class_declaration): Likewise.
5812 (delegate_declaration): Likewise. Rearrange slightly and use
5814 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5815 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
5817 2007-08-02 Marek Safar <marek.safar@gmail.com>
5819 A fix for bug #82039
5821 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5824 * typemanager.cs (CSharpName): Split to string overload.
5826 2007-08-02 Marek Safar <marek.safar@gmail.com>
5829 * report.cs: Updated warning CS0472.
5831 2007-08-01 Marek Safar <marek.safar@gmail.com>
5833 A fix for bug #82181
5835 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5837 2007-08-01 Marek Safar <marek.safar@gmail.com>
5839 A fix for bug #82277
5840 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5842 2007-08-01 Marek Safar <marek.safar@gmail.com>
5844 ** C# 3.0 Type Inference (major bits are working)
5846 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5847 (.ImplicitStandardConversionExists): Uses compatible.
5848 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5849 (.InferReturnType): New method.
5850 (.Compatible): Refactored.
5851 (.ResolveParameters): Uses factory to create resolved parameters.
5852 (.CompatibleMethod): Add probing mode support.
5853 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5854 clearly distinguish between 2 different operations.
5855 (LambdaMethod): Moved to lambda.cs.
5856 (AnonymousMethod): Removed unused fields and methods.
5857 (AnonymousDelegate): Simplified.
5859 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5861 * convert. cs (ImplicitConversionStandard): Compatible works differently.
5863 * delegate.cs (Delegate): New mehods to reduce code duplication.
5864 (.GetConstructor): New method.
5865 (.GetInvokeMethod): New method.
5866 (DelegateCreation): Updated.
5868 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5870 (OverloadResolve): Made probing little bit faster.
5872 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5875 * generic.cs (TypeInferenceContext): Dummy implementation.
5877 * iterators.cs: Updated after Resolve/Define rename.
5879 * lambda.cs (LambdaExpression)
5880 (.ResolveParameters): Handles both type of arguments and type inference too.
5882 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5883 (InflateTypes): Updated.
5885 * support.cs (InflateTypes): Changed signature and updated.
5887 * typemanager.cs (LookupMemberCache): Better dynamic type check.
5888 (MemberLookup_FindMembers): More MS tricks.
5889 (GetParameterData): Ditto.
5890 (GetDelegateParameters): Uses quick path for dynamic types.
5892 2007-08-01 Marek Safar <marek.safar@gmail.com>
5894 * class.cs (MethodData.Define): EmitContext is required for generic stuff
5897 2007-07-31 Marek Safar <marek.safar@gmail.com>
5899 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5902 2007-07-26 Jb Evain <jbevain@novell.com>
5904 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5905 which takes a boolean 'report_errors', similar to the GetMethod.
5906 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5907 in .net 2.1, do not report errors here.
5909 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5910 System.Runtime.CompilerServices.RequiredAttributeAttribute and
5911 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5914 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5915 of the type InternalsVisibleToAttribute before the first call
5916 to CoreLookupType which is allowed to fail (third boolean parameter
5917 to true). Because, during the resolution for a type that is not
5918 immediately found, we try to check if the type is not defined in
5919 a friend assembly, and to do so, we need the
5920 InternalVisibleToAttribute.
5922 2007-07-23 Miguel de Icaza <miguel@novell.com>
5924 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5925 feature that allows structs to be compared against null and inline
5926 the result as true or false.
5928 Notice that the same code is not permitted inside a generic block
5929 of code that would do:
5931 class Foo<T> where T : struct {
5938 It is only allowed if the type of T is not bound (no where
5939 clause). In my opinion, this CSC 2 behavior is broken but people
5940 seem to be using it (IronRuby does, a few bug reports on bugzilla
5941 have it and some people have complained about it).
5943 All of the users that depend on this behavior have code that is
5946 * report.cs (Warning, Error): make these take object arguments,
5947 not strings, as that allows us to take advantage of Format.
5949 2007-07-20 William Holmes <billholmes54@gmail.com>
5951 * decl.cs: Changed MemberName.CountTypeArguments to also check the
5952 Left member variable for the Count.
5953 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
5954 MemberName.CountTypeArguments to avoid a NRE.
5956 This code is contributed under the MIT X11 license
5958 2007-07-18 Marek Safar <marek.safar@gmail.com>
5960 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5962 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5964 * doc.cs : generic method arguments are written as ``x while generic
5965 type arguments are `x. Combined with the previous change, fixed bug
5968 2007-07-18 Raja R Harinath <rharinath@novell.com>
5971 * expression.cs (Binary.ResolveOperator): When converting
5972 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5974 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5976 * doc.cs : when T: or whatever x: is specified, it does not really
5977 check the doc comment's syntax correctness. Fixed bug #82006.
5979 2007-07-18 Marek Safar <marek.safar@gmail.com>
5981 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5982 LambdaExpression better.
5984 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5986 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5988 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5989 as it can be generated.
5991 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5994 * lambda.cs (LambdaExpression): Refactored to share same code with
5995 AnonymousMethodExpression.
5997 2007-07-17 Marek Safar <marek.safar@gmail.com>
5999 * anonymous.cs (MakeName): Include host name for easier debugging.
6000 (LambdaMethod): New class for lambda spcecific stuff.
6002 * attribute.cs: Set EmitContext return type.
6004 * class.cs: Set EmitContext return type.
6006 * codegen.cs (EmitContext): Return type cannot be null to stop messing
6007 with null/void meaning.
6009 * iterators.cs (ContainerType): Implemented.
6011 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
6013 * statement.cs (Return): Updated to lambda expressions.
6014 (Block.CloneTo): Parent can be null.
6016 2007-07-13 Marek Safar <marek.safar@gmail.com>
6018 A fix for bug #81917
6019 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
6021 * class.cs (FixedField): Check whether field is in unsafe scope.
6023 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
6024 (FieldExpr.Emit): Fixed buffers cannot be volatile.
6026 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
6029 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
6031 2007-07-13 Marek Safar <marek.safar@gmail.com>
6033 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
6034 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
6037 2007-07-13 Marek Safar <marek.safar@gmail.com>
6039 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
6041 2007-07-13 Marek Safar <marek.safar@gmail.com>
6043 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
6044 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
6046 * codegen.cs(EmitContext): Add ProbingMode flag.
6048 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
6050 * driver.cs: For now set both warning values.
6052 * ecore.cs (SimpleName): Name is readonly.
6053 (MethodGroup.OverloadResolve): One quick path for probing.
6055 * expression.cs (Unary): Set Oper r/o.
6056 (Binary): Set Oper r/o.
6057 (ParameterReference): Set few instance variables as r/o.
6058 (ParameterReference.DoResolveBase): Don't capture aruments when
6060 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
6061 (Arglist): arguments are private.
6062 (SizeOf): type is private and r/o.
6063 (MemberAccess): arguments are private.
6065 * report.cs: Enhanced reporting on/off capabilities.
6067 * lambda.cs: Uses ec.IsInProbingMode.
6068 (ContextualReturn): Derives from return.
6070 * rootcontext.cs: For now set both warning values.
6072 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
6074 (Return.Resolve): Don't die immediately.
6075 (Block.Resolve): Speed-up probing.
6076 (Block.CloneTo): Clone only child blocks.
6078 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
6080 * iterators.cs: reverted Miguel's latest change (r81925) as it
6081 breaks the build in System.
6083 2007-07-13 Miguel de Icaza <miguel@novell.com>
6085 * iterators.cs (Yield.CheckContext): Check for the iterator type
6086 also here as we can call into Yield even in codepaths that are not
6088 (MethodOrOperator is the only path that was checked).
6090 In addition to the standard check, use a more specific check for
6091 constructors to report a more verbose error.
6093 2007-07-12 Miguel de Icaza <miguel@novell.com>
6095 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
6096 report the warning and continue
6098 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
6099 values on the stack on the call to Emit. Use EmitStatement if
6100 possible, or using Emit + Pop if not possible. Fixes #82064
6102 2007-07-12 Raja R Harinath <rharinath@novell.com>
6104 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
6105 avoid try...finally in some cases.
6107 2007-07-10 Marek Safar <marek.safar@gmail.com>
6109 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
6111 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
6112 instead of method. Re-use standard error handling.
6113 (ConstructorInitializer.Emit): Simplified.
6115 * delegate.cs: Updated after Invocation.EmitCall change.
6117 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
6118 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
6119 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
6120 method and don't permanently changing input arguments.
6121 (MethodGroupExpr): Introduced resolved best_candidate, when method group
6122 is resolved it has one of the candidates is the best one which is later
6123 used to emit. Removed a few unused method.
6124 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
6126 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
6127 (Binary.ResolveOperator): Ditto.
6128 (ConditionalLogicalOperator.DoResolve): Ditto.
6129 (Invocation): Uses method group.
6130 (Invocation.DoResolve): Simplified.
6131 (Invocation.EmitCall): Removed useless is_static.
6132 (Invocation.Emit): Delegate to method group.
6133 (Invocation.EmitStatement): Simplified.
6134 (New): Uses method group.
6135 (MemberAccess.DoResolve): Don't destroy original expression.
6137 * statement.cs (ForEach.Resolve): Use null for no method arguments.
6139 2007-07-04 Marek Safar <marek.safar@gmail.com>
6141 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
6144 * lambda.cs: Add custom error message type.
6146 2007-07-03 Marek Safar <marek.safar@gmail.com>
6148 * lambda.cs: Simplified little bit.
6150 * parameter.cs: Introduced ImplicitLambdaParameter.
6151 (Parameters.CreateFullyResolved): New factory instead of ctor.
6155 * delegate.cs: Updated parameter creation.
6157 2007-07-03 Marek Safar <marek.safar@gmail.com>
6159 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
6162 * generic.cs: Synchronized with gmcs.
6164 2007-07-03 Marek Safar <marek.safar@gmail.com>
6166 * class.cs (Indexer): Check return type as soon as possible.
6168 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
6171 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
6173 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
6175 * parameter.cs (Parameter): Use expression type when it is available.
6177 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
6178 method modifier for the first parameter only.
6180 2007-06-24 Marek Safar <marek.safar@gmail.com>
6182 A fix for bug #81938
6183 * typemanager.cs (ChangeType): Fixed couple of char conversions.
6185 * constant.cs: Tide up an exception message.
6187 2007-06-22 Marek Safar <marek.safar@gmail.com>
6189 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
6190 an uninitialized variable is used.
6192 * expression.cs (LocalVariableReference.DoResolve): Ditto.
6194 2007-06-22 Marek Safar <marek.safar@gmail.com>
6196 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
6197 not found error handling.
6199 * expression.cs (ArrayCreation): Removed redundant fields and little bit
6201 (ArrayCreation.ResolveArrayElement): To be ready to customization.
6202 (ArrayCreation.DoResolve): Simplified.
6203 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
6204 its own resolve process.
6205 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
6207 2007-06-20 Marek Safar <marek.safar@gmail.com>
6209 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
6212 2007-06-20 Marek Safar <marek.safar@gmail.com>
6214 * cs-tokenizer.cs: Removed var related stuff.
6216 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
6217 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
6218 a type and a keyword at same time.
6220 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
6223 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
6224 implicitly typed arrays, more changes will follow.
6226 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
6228 2007-06-19 Marek Safar <marek.safar@gmail.com>
6230 * ecore.cs (VarExpr): Removed Handled field.
6232 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
6233 build-in assign functionality.
6234 (ForEach.Resolve): Removed all implicitly typed local variable code and
6236 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
6237 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
6239 2007-06-18 Marek Safar <marek.safar@gmail.com>
6241 * assign.cs: Removed implicitly typed local variable check.
6243 * expression.cs (LocalVariableReference.DoResolve): Add check for self
6244 referencing implicitly typed local variable.
6245 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
6248 * statement.cs (Fixed): Removed unsupported implicitly typed local
6251 2007-06-15 Marek Safar <marek.safar@gmail.com>
6253 * decl.cs (MemberName): Moved all Unbound stuff to parser.
6255 2007-06-14 Marek Safar <marek.safar@gmail.com>
6257 A fix for bugs #81855 and #76274
6258 * attribute.cs (AttachTo): Always set owner for global attributes to
6261 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
6264 * cs-parser.jay: Assembly and module attributes must precede all other
6265 elements except using clauses and extern alias declarations.
6267 2007-06-13 Marek Safar <marek.safar@gmail.com>
6269 A fix for bug #81748
6271 * expression.cs: More checks for non ISO-1 features.
6273 2007-06-12 Marek Safar <marek.safar@gmail.com>
6275 A fix for bug #81807
6276 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
6277 present inside switch statement and it is required by nullable check.
6279 2007-06-12 Marek Safar <marek.safar@gmail.com>
6281 A fix for bug #81840
6282 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
6283 when type matching fails.
6285 * namespace.cs: Tiny error message change.
6287 2007-06-12 Marek Safar <marek.safar@gmail.com>
6289 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
6290 reporting. Added automatic property check.
6292 * class.cs: Updated after CheckAbstractAndExtern relocation.
6293 (AEventPropertyAccessor.GetSignatureForError): Customized.
6295 2007-06-11 Marek Safar <marek.safar@gmail.com>
6297 * class.cs (DefineBaseTypes): Base type can be undefined.
6299 * ecore.cs (TypeLookup): Minor refactoring.
6300 (DoResolveAsTypeStep): Removed redundant check.
6302 * namespace.cs (Lookup): Removed redundant check.
6304 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
6305 ResolveAsTypeTerminal step.
6306 (BootstrapCorlib_*): Simplified.
6307 (PopulateCoreType): Core types can be now external.
6309 2007-06-07 Marek Safar <marek.safar@gmail.com>
6311 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
6313 (InferTypeArguments): Infers anonymous expression type arguments.
6314 (Compatible): Split to Compatible and InferTypeArguments.
6316 * lambda.cs: Updated.
6318 2007-06-08 Marek Safar <marek.safar@gmail.com>
6320 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
6322 2007-06-07 Raja R Harinath <harinath@gmail.com>
6324 Fix #80477, cs0135-2.cs, cs0135-3.cs
6325 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
6326 names to the "known" variables list.
6327 (Block.CheckInvariantMeaningInBlock): Handle the fact the
6328 parameter names are also "known".
6329 (Block.CheckError136): Remove.
6330 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
6333 2007-06-07 Marek Safar <marek.safar@gmail.com>
6335 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
6337 2007-06-06 Marek Safar <marek.safar@gmail.com>
6339 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
6340 internal error not an user error.
6342 * expression.cs (IsApplicable): Refactored to make debugging easier.
6344 * support.cs: More tricks for non-mono runtimes.
6346 * typemanager.cs (CoreLookupType): Made public.
6347 (InitSystemCore): All linq specific stuff moved to linq.cs
6349 2007-06-05 Marek Safar <marek.safar@gmail.com>
6351 * typemanager.cs (CSharpSignature): One more missing build-in types
6353 More tricks for non-mono runtime.
6355 2007-06-05 Raja R Harinath <harinath@gmail.com>
6357 * statement.cs (Block.CheckError136_InParents): Remove.
6358 (Block.AddVariable): Use GetParameterInfo instead.
6359 (ToplevelBlock.ProcessArguments): Likewise.
6361 2007-06-04 Raja R Harinath <rharinath@novell.com>
6363 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
6365 (ToplevelBlock.GetParameterInfo): Split out of ...
6366 (ToplevelBlock.GetParameterRefernce): ... this.
6367 (ToplevelBlock.ParameterMap): Remove.
6368 * expression.cs (ParameterReference): Update to use
6369 ToplevelParameterInfo.
6371 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
6374 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
6375 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
6377 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
6378 (ToplevelBlock.ProcessParameters) ... here.
6379 (ToplevelBlock..ctor): Invoke it.
6381 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
6384 * statement.cs (IKnownVariable): New interface.
6385 (LocalInfo): Implement it.
6386 (ToplevelParameterInfo): New class.
6387 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
6388 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
6389 GetKnownVariableInfo.
6391 2007-06-03 Raja R Harinath <harinath@gmail.com>
6393 Partly speed up CS0136 error checks.
6394 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
6395 'recurse' parameter.
6396 (Block.DoCheckError136): Only check errors in parameters. Move
6397 local variable checks ...
6398 (Block.AddVariable): ... here, and ...
6399 (ToplevelBlock.ResolveMeta): ... here.
6401 2007-06-02 Raja R Harinath <harinath@gmail.com>
6403 * statement.cs (Block.IsChildOf): Remove.
6405 * statement.cs (Statement.Clone): Move special case code ...
6406 (Block.CloneTo): ... here.
6408 2007-05-29 Raja R Harinath <rharinath@novell.com>
6410 * statement.cs (ToplevelBlock.container): Remove field. It's
6411 redundant with 'Parent'.
6412 (ToplevelBlock.ContainerBlock): Remove accessor.
6413 (ToplevelBlock..ctor): Update to changes. Register anonymous
6414 child with parent here, ...
6415 * cs-parser.jay (end_anonymous): ... not here. Don't modify
6417 (start_anonymous): Don't save current_block.
6418 (top_current_block): Remove.
6420 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6421 (Block.Resolve): Update to changes.
6422 (Block..ctor): Move setting of "correct" 'Toplevel'
6423 and 'Explicit' fields to ...
6424 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6426 2007-05-27 Raja R Harinath <harinath@gmail.com>
6429 * statement.cs (Block.Implicit): Remove.
6430 (Block): Update to changes.
6431 * flowanalysis.cs: Likewise.
6433 Mildly speed up CheckInvariantMeaningInBlock
6434 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6435 Recursively call AddKnownVariable to all enclosing blocks.
6436 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6437 Remove recursive calls.
6438 (Block): Update to changes.
6440 New ExplicitBlock invariants
6441 * statement.cs (Block.Explicit): New field. It points to the
6442 immediately enclosing non-implicit block.
6443 (Block..ctor): Maintain the invariant.
6444 * cs-parser.jay: Take advantage of invariant.
6446 Introduce ExplicitBlock
6447 * statement.cs (ExplicitBlock): New.
6448 (ToplevelBlock): Derive from it.
6449 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6451 (Block.Implicit): Update to changes.
6452 * cs-parser.jay: Update to changes.
6455 * codegen.cs (EmitContext.IsLastStatement): Remove.
6456 * statement.cs (Block.DoEmit): Update to changes.
6458 2007-05-25 Raja R Harinath <rharinath@novell.com>
6460 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6461 modifying current_block directly.
6463 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
6465 * class.cs: Implemented automatic properties (C# 3.0)
6466 Thanks to Marek for the help.
6468 2007-05-23 Raja R Harinath <rharinath@novell.com>
6470 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6471 variable as assigned, note also that all its components are
6473 (MyBitVector.SetRange): New. Function to set multiple bits to true.
6475 2007-05-19 Marek Safar <marek.safar@gmail.com>
6477 * anonymous.cs, class.cs: Emit Compiler generated attribute when
6478 member is marked as compiler generated.
6480 * decl.cs (MemberCore): Refactored ModFlags into property.
6482 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6483 (Check): Check only accessibility modifiers.
6485 2007-05-18 Raja R Harinath <rharinath@novell.com>
6487 Track all assignable slots in one bit array
6488 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6489 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
6490 logic from VariableMap constructor here. Use the same 'offset'
6491 variable that's later used for computing offsets of local
6493 * flowanalysis.cs (UsageVector.parameters): Remove.
6494 (UsageVector): Update to changes.
6495 (VariableMap): Remove.
6497 Avoid creating ParameterMap in every block
6498 * statement.cs (Block.ParameterMap): Move ...
6499 (ToplevelBlock.ParameterMap): ... here.
6500 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6502 * flowanalysis.cs (FlowBranching.param_map): Remove.
6503 (FlowBranching.UsageVector): Update to changes.
6504 (FlowBranchingToplevel.CheckOutParameters): Likewise.
6506 * statement.cs (Block.CloneTo): Clone Toplevel field too.
6508 * expression.cs (ParameterReference): Distinguish between block
6509 where parameter was referenced and declared.
6511 2007-05-18 Marek Safar <marek.safar@gmail.com>
6513 * flowanalysis.cs, statement.cs: Put back improved error handling.
6515 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
6519 Imporved object and collection initialization (C# 3.0).
6521 2007-05-15 Marek Safar <marek.safar@gmail.com>
6523 A fix for bug #81380
6524 * expression.cs (Is.DoResolve): Only value types have constant `is'
6527 2007-05-15 Raja R Harinath <rharinath@novell.com>
6529 * statement.cs (ToplevelBlock.child): Remove.
6531 2007-05-15 Raja R Harinath <harinath@gmail.com>
6533 Rationalize ResolveMeta: refactoring
6534 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
6535 out constant handling code into ...
6536 (Block.DoResolveConstants): ... this.
6538 Rationalize ResolveMeta: kill local_map
6539 * statement.cs (Block.local_map, Block.LocalMap): Remove.
6540 (Block.AssignableSlots): New.
6541 (Block.ResolveMeta): Make protected. Don't create a VariableMap
6542 for locals -- move code from VariableMap here. Avoid unnecessary
6544 * flowanalysis.cs (FlowBranching.local_map): Remove.
6545 (FlowBranching..ctor): Use Block.AssignableSlots.
6546 (VariableMap): Remove unused constructors.
6548 2007-05-11 Raja R Harinath <rharinath@novell.com>
6550 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6552 2007-05-11 Marek Safar <marek.safar@gmail.com>
6554 * typemanager.cs (IsFriendAssembly): Should not be called for building
6557 2007-05-09 Marek Safar <marek.safar@gmail.com>
6559 * literal.cs (NullConstant): Print null in all cases.
6561 * expression.cs (Binary.ResolveOperator): Implemented delegate
6562 comparison based on C# 2.0 changes.
6564 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
6566 This code is contributed under the MIT X11 license
6568 The following enables support for several C# 3.0 language features:
6570 * cs-tokenizer.cs: Added support for the "var" keyword.
6572 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6573 Added VarExpr class to facilitate type inferencing.
6575 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6576 to support anonymous types.
6578 * assign.cs: Added support for type inferencing and initialization.
6580 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6582 * expression.cs: Added implicit array support to ArrayCreation.
6583 Added 5 types and 1 interface:
6585 IInitializable Implementing classes can inject initializing
6586 statements after object instantiation.
6588 Initializer Stores data for object initialization.
6590 AnonymousType An expression for anonymous types.
6592 AnonymousTypeParameter Stores data about an anonymous type's field.
6594 NewInitialize An expression for object initialization.
6596 CollectionInitialize An expression for collection initialization.
6598 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6601 2007-05-06 Marek Safar <marek.safar@gmail.com>
6603 A fix for bug #81500
6604 * cs-tokenizer.cs: Add special handling for coalescing operator.
6606 2007-05-06 Marek Safar <marek.safar@gmail.com>
6608 A fix for bug #81529
6609 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6610 its value from base class until it is redefined.
6612 2007-05-02 Raja R Harinath <rharinath@novell.com>
6614 Fix regression in cs0631-3.cs
6615 * cs-parser.jay (operator_declarator): Add opt_attributes to error
6616 fallback. Make error fallback catch more cases.
6618 2007-05-01 Miguel de Icaza <miguel@novell.com>
6620 * cs-parser.jay: Allow parameters in operator declarations to have
6623 2007-04-27 Miguel de Icaza <miguel@novell.com>
6625 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6628 * lambda.cs (ContextualReturn.Resolve): An expression is valid
6629 inside the ContextualReturn, it does not have to be an
6630 ExpressionStatement.
6632 2007-04-24 Miguel de Icaza <miguel@novell.com>
6634 * lambda.cs (ContextualReturn.Resolve): if the return type is not
6637 2007-04-23 Miguel de Icaza <miguel@novell.com>
6639 * anonymous.cs (AnonymousContainer): split the virtual Resolve
6640 method in two methods: ResolveNoDefine and Resolve.
6642 ResolveNoDefine will stop just after ResolveTopBlock has been
6645 Resolve will then continue by creating a method and issuing the
6646 call to method.Define ().
6648 (AnonymousMethod): Split and implement the new Resolve and
6649 ResolveNoDefine as well.
6651 * lambda.cs (LambdaExpression): Split the anonymous method
6652 resolution code into a separate routine (CoreCompatibilityTest)
6653 from DoCompatibleTest.
6655 (LambdaExpression.TryBuild): New method, this method tries to
6656 build the LambdaExpression with the given set of types to be used
6657 as the types for the various parameters of the lambda expression.
6659 If the compilation succeed with the given types, the infered type
6660 of the Anonymous method is returned, otherwise null is returned.
6662 2007-04-23 Marek Safar <marek.safar@gmail.com>
6664 A fix for bug #81414
6665 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6667 2007-04-22 Miguel de Icaza <miguel@novell.com>
6669 * cs-tokenizer.cs: Change various identifiers here from the
6670 camelCasing to the recommended Linux-like style for instance
6671 variables from the Coding Guidelines.
6673 2007-04-19 Martin Baulig <martin@ximian.com>
6676 (Convert.ImplicitReferenceConversionCore): Allow conversions from
6677 System.Enum to System.ValueType.
6679 2007-04-13 Martin Baulig <martin@ximian.com>
6681 Rewrote implicit reference conversions. We need to distinguish
6682 between implicit reference conversions (13.1.4) and implicit
6683 boxing conversions (13.1.5).
6685 According to the spec, there's an an implicit conversion
6686 "From a one-dimensional array-type S[] to IList<T> and base
6687 interfaces of this interface, provided there is an implicit
6688 reference conversion from S to T." Note that this does not
6689 include boxing conversions.
6692 (Convert.ImplicitTypeParameterBoxingConversion): New method.
6693 (Convert.ImplicitReferenceConversion): Split into
6694 ImplicitReferenceConversionCore() and
6695 ImplicitBoxingConversionExist().
6696 (Convert.ImplicitReferenceConversionExists): Use the new
6697 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6699 2007-04-12 Martin Baulig <martin@ximian.com>
6701 * convert.cs (Convert.ImplicitReferenceConversion): Move the
6702 `TypeManager.null_type' checks up to the top of the method.
6704 2007-04-11 Marek Safar <marek.safar@gmail.com>
6706 A fix for bug #81350
6707 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6710 2007-04-11 Martin Baulig <martin@ximian.com>
6712 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6713 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6714 to make this work for generic classes; fixes #79561.
6716 2007-04-11 Martin Baulig <martin@ximian.com>
6718 * expression.cs (As): Add support for nullable types; fixes #79371.
6720 2007-04-11 Martin Baulig <martin@ximian.com>
6722 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6723 `type.FullName' is null; fixes #80243.
6725 2007-04-11 Martin Baulig <martin@ximian.com>
6727 * expression.cs (Invocation.IsApplicable): Don't modify the method
6728 if type inference succeeded, but the method was not applicable.
6731 2007-04-10 Marek Safar <marek.safar@gmail.com>
6733 A fix for bug #81324
6734 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6735 internal and external namespaces containers.
6737 2007-04-10 Martin Baulig <martin@ximian.com>
6739 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6740 TypeManager.DropGenericMethodArguments() so we also call
6741 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
6743 2007-04-10 Martin Baulig <martin@ximian.com>
6745 * iterators.cs (Iterator.CreateIterator): Don't crash if
6746 `method.ReturnType' is null. This happens if something went wrong
6747 while resolving that typ (we already reported an error in this case).
6749 2007-04-10 Martin Baulig <martin@ximian.com>
6751 * expression.cs (New.DoResolve): Don't call CheckComImport() on
6752 generic interfaces; report the CS0144 directly.
6754 2007-04-10 Martin Baulig <martin@ximian.com>
6756 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6757 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6759 2007-04-10 Martin Baulig <martin@ximian.com>
6761 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6763 2007-04-09 Raja R Harinath <rharinath@novell.com>
6766 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6767 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6770 * statement.cs (For.Resolve): If resolution fails, use
6773 2007-04-08 Marek Safar <marek.safar@gmail.com>
6775 * anonymous.cs (MakeName): Make faster and zero-based.
6776 (VerifyExplicitParameterCompatibility): Back to mode where generic
6777 parameter is ignored.
6778 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6780 * class.cs (EmitType): Method can emit another new method.
6782 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6784 * driver.cs: Updated.
6786 * lambda.cs: Reuse predefined empty parameters.
6788 * parameter.cs: Updated
6790 * support.cs: Implemented InflateTypes.
6792 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6793 (InitSystemCore): Introduced to isolate 3.0 dependencies.
6795 2007-04-03 Martin Baulig <martin@ximian.com>
6799 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6800 version of TypeManager.IsOverride() which also works with generic
6803 2007-04-03 Martin Baulig <martin@ximian.com>
6808 (Convert.ExplicitReferenceConversion): We need to cast when
6809 converting from IList<T> to S[].
6811 2007-04-01 Marek Safar <marek.safar@gmail.com>
6813 * decl.cs (FindExtensionMethods): Consider all candidates with same name
6816 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6818 2007-03-31 Marek Safar <marek.safar@gmail.com>
6820 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6821 argument and return type inferring.
6823 * codegen.cs (InferReturnType): Flag whether return can be inferred.
6824 (ReturnType): Turned to property.
6826 * statement.cs (Return): Implemented return type inferring.
6828 * support.cs (ReflectionParameters): Use local types if possible.
6830 2007-03-30 Raja R Harinath <rharinath@novell.com>
6832 * flowanalysis.cs (FlowBranching.Reachability): Remove.
6833 (FlowBranching.UsageVector): Update to changes.
6835 Prepare to kill 'Reachability'
6836 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6837 argument of constructor.
6839 2007-03-29 Raja R Harinath <rharinath@novell.com>
6841 Prepare to kill 'Reachability'
6842 * flowanalysis.cs (UsageVector.is_unreachable): New.
6843 (UsageVector): Update to maintain 'is_unreachable' in parallel to
6844 'reachability', and verify they're consistent.
6847 * expression.cs (New.EmitStatement): Handle type parameters here too.
6849 2007-03-29 Martin Baulig <martin@ximian.com>
6854 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6855 CompilerGeneratedClass.
6856 (ScopeInfo.EmitScopeInstance): Make this protected.
6857 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6858 `ec.CurrentAnonymousMethod.Scope == Scope'.
6860 * statement.cs (Block.ScopeInfo): Make this a property.
6862 2007-03-27 Raja R Harinath <harinath@gmail.com>
6864 Prepare to kill 'Reachability'
6865 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6866 (FlowBranching.UsageVector.Reachability): Remove property.
6867 (FlowBranching.UsageVector.IsUnreachable): New property.
6868 (FlowBranching.UsageVector.ResetBarrier): New.
6869 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6870 * codegen.cs, statement.cs: Update to changes.
6872 2007-03-27 Martin Baulig <martin@ximian.com>
6877 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6880 2007-03-26 Raja R Harinath <rharinath@novell.com>
6882 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6883 instead of TriState. Remove all mention of TriState.
6885 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6886 replaced by a boolean. Add boolean 'is_unreachable' field, check
6887 and maintain invariants.
6889 2007-03-25 Marek Safar <marek.safar@gmail.com>
6891 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6893 2007-03-25 Marek Safar <marek.safar@gmail.com>
6895 * expression.cs: Stop using obsolete 2.0 opcodes.
6897 2007-03-25 Marek Safar <marek.safar@gmail.com>
6899 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6900 one of the latests Martin's fixes.
6902 2007-03-23 Miguel de Icaza <miguel@novell.com>
6904 * expression.cs: On BigEndian systems, swap the bytes, temporary
6905 solution until we get a new bitconverter class.
6907 2007-03-23 Martin Baulig <martin@ximian.com>
6911 * decl.cs (MemberCache.AddMembers): Add generic methods both as
6912 "Method" and "Method`1". Normally, a cache lookup is done on the
6913 "Method" form (ie. without the generic arity), but this one makes
6914 lookups on the full form work as well.
6916 2007-03-22 Raja R Harinath <rharinath@novell.com>
6918 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6921 2007-03-20 Bill Holmes <billholmes54@gmail.com>
6923 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6924 ordered_member_list, to TypeBuilder to store members to be defined
6925 in the order they were parsed in.
6926 - ordered_explicit_member_list contains all properties indexers
6927 and methods that are defined as explicit implementation of an
6928 interface or base class.
6929 - ordered_member_list contains all properties indexers and methods
6930 that are not defined as explicit implementation of an interface
6933 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
6934 functionality in these removed classes has been replaced with
6935 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
6936 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6938 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6939 to CheckForDuplications inside GetMethod and SetMethod Define Method
6940 to handle method property and indexer name conflicts.
6944 All code is contributed under the MIT/X11 license.
6946 2007-03-20 Martin Baulig <martin@ximian.com>
6948 * class.cs (TypeContainer.Interfaces): Removed; they're now
6949 included in `TypeContainer.Types'.
6951 2007-03-20 Martin Baulig <martin@ximian.com>
6953 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
6955 * class.cs (TypeContainer.CreateType): New public method. This is
6956 now called before DefineType() to create the TypeBuilders.
6957 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6958 has already been created by CreateType().
6959 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6960 don't resolve our base classes here; this has been moved into
6961 DefineBaseTypes(). We're now called from CreateType().
6962 (TypeContainer.DefineBaseTypes): New private method; resolve our
6963 base classes here. We're now called from DefineType().
6966 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6967 our types first to create all the TypeBuilders. After that, call
6968 TypeContainer.DefineType() on all the types which'll resolve their
6969 base classes and setup the resolve order.
6971 2007-03-20 Martin Baulig <martin@ximian.com>
6973 * class.cs (TypeContainer.Enums): Removed; they're now included in
6974 `TypeContainer.Types'.
6976 2007-03-20 Martin Baulig <martin@ximian.com>
6979 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6980 (TypeContainer.DoResolveMembers): Call DefineType() on our
6981 `compiler_generated' classes; moved here from DefineNestedTypes().
6984 (RootContext.ResolveTree): Call ResolveMembers() on all
6985 TypeContainer's in the `type_container_resolve_order'.
6987 2007-03-19 Marek Safar <marek.safar@gmail.com>
6989 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6991 2007-03-17 Marek Safar <marek.safar@gmail.com>
6993 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6994 implementation flags.
6996 2007-03-17 Marek Safar <marek.safar@gmail.com>
6998 * class.cs: More optimizations for type parameters.
7000 2007-03-15 Marek Safar <marek.safar@gmail.com>
7002 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
7004 * ecore.cs, parameter.cs: More common code for both corlibs.
7006 * typemanager.cs (IsGenericMethod): Simplified.
7008 2007-03-15 Raja R Harinath <rharinath@novell.com>
7010 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
7012 * statement.cs, iterators.cs, lambda.cs: Update to changes.
7014 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
7015 unconditionally. Simplify explanation.
7016 (Try.Resolve, Using.Resolve): Likewise.
7018 2007-03-15 Martin Baulig <martin@ximian.com>
7022 * decl.cs (DeclSpace): If we're a partial class, use our
7023 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
7025 2007-03-15 Raja R Harinath <rharinath@novell.com>
7027 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
7029 (FlowBranching.UsageVector): Update to changes.
7030 (FlowBranching.MergeSiblings): Likewise.
7031 * statement.cs: Likewise.
7033 2007-03-15 Martin Baulig <martin@ximian.com>
7038 (MemberCache): Added a special .ctor for type parameters.
7041 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
7044 2007-03-09 Martin Baulig <martin@ximian.com>
7046 * enum.cs (Enum): Make this a TypeContainer.
7047 (EnumMember): Derive from `Const'.
7050 (Const.DoResolveValue): New protected virtual method; move most of
7051 the functionality of ResolveValue() here so we can override it in
7053 (Const.CreateConstantReference): Make this virtual.
7055 * class.cs (Kind): Add `Kind.Enum'.
7056 (TypeContainer.Emit): Don't emit the enums here; they're already
7057 in the `RootContext.typecontainer_resolve_order'.
7059 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
7060 here; they're already in the `typecontainer_resolve_order'.
7062 * ecore.cs (EnumConstant.ConvertImplicitly): Add
7063 TypeManager.DropGenericTypeArguments().
7066 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
7067 (TypeManager.IsEnumType): Likewise.
7068 (TypeManager.EnumToUnderlying): Likewise.
7069 (TypeManager.IsEqual): Add support for enums.
7071 2007-03-12 Raja R Harinath <rharinath@novell.com>
7073 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
7074 DefaultParameterValueAttribute to be undefined, say if System.dll
7077 2007-03-11 Marek Safar <marek.safar@gmail.com>
7079 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
7082 2007-03-10 Marek Safar <marek.safar@gmail.com>
7084 * class.cs, parameter.cs: Unified parameters verification.
7086 2007-03-08 Martin Baulig <martin@ximian.com>
7088 * cs-parser.jay (constructor_header): Pass the location to the
7089 newly created TopLevelBlock.
7091 2007-03-07 Martin Baulig <martin@ximian.com>
7093 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
7095 2007-03-06 Miguel de Icaza <miguel@novell.com>
7097 * convert.cs (ExplicitReferenceConversionExists): Sync this method
7098 with the changes from David, fixes the build.
7100 2007-03-05 David Mitchell <dmitchell@logos.com>
7102 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
7103 and its base interfaces to a one-dimensional array type S[],
7104 provided there is an implicit or explicit reference conversion
7107 2007-03-03 Marek Safar <marek.safar@gmail.com>
7109 * cs-tokenizer.cs: Implemented basic linq grammar.
7111 * driver.cs: Set linq lang version on demand.
7113 2007-02-26 Marek Safar <marek.safar@gmail.com>
7115 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
7117 2007-02-25 Marek Safar <marek.safar@gmail.com>
7119 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
7122 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
7124 Check property and event extern attributes.
7126 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
7129 2007-02-24 Marek Safar <marek.safar@gmail.com>
7131 A fix for bug #80407
7132 * ecore.cs: Don't report ambiguity error when methods have same parent.
7134 2007-02-23 Marek Safar <marek.safar@gmail.com>
7136 A fix for bug #80878
7137 * class.cs, cs-parser.jay: Event property can host anonymous methods.
7139 2007-02-22 Marek Safar <marek.safar@gmail.com>
7141 * attribute.cs: Enable ExtensionAttribute presence test.
7143 2007-02-22 Marek Safar <marek.safar@gmail.com>
7145 * class.cs: Warn about missing GetHashCode only when Equals is override.
7147 * decl.cs: Check accessibility of type arguments.
7149 * typemanager.cs: Correctly report nullable array.
7151 2007-02-20 Marek Safar <marek.safar@gmail.com>
7153 * class.cs, report.cs: Capture more details when things go wrong.
7155 2007-02-20 Marek Safar <marek.safar@gmail.com>
7157 A fix for bug #80650
7158 * cs-parser.jay: Anonymous container starts at constructor declaration
7159 and not at block beginning because it has to be usable in constructor
7162 * statement.cs: Use context location and not block one for error reporting.
7164 2007-02-18 Marek Safar <marek.safar@gmail.com>
7166 A fix for bug #78712
7167 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
7170 2007-02-18 Marek Safar <marek.safar@gmail.com>
7172 A fix for bug #80493 by Atsushi Enomoto
7173 * cs-parser.jay: Ignore invalid attribute target.
7175 2007-02-18 Marek Safar <marek.safar@gmail.com>
7177 * cs-tokenizer.cs: Ignore '\0' as white space character.
7179 2007-02-17 Miguel de Icaza <miguel@novell.com>
7181 * cs-parser.jay: Add support for lambda expressions to the mcs
7184 * lambda.cs: Only clone when we are probing, not on the final call
7185 (Compatible is the final call).
7187 * statement.cs (CloneContext): Introduce class to provide block
7188 remapping during clone.
7190 All statements Clone themselves now.
7192 (Clone): special handling for blocks, when we clone a block, we
7193 register the block inside this routine, as children of the block
7194 might trigger a lookup.
7196 * expression.cs: Add support for CloneContext in all expressions.
7198 2007-02-17 Marek Safar <marek.safar@gmail.com>
7200 A fix for bug #80493
7201 * statement.cs: Report ambiguous warning when interfaces are not related.
7203 2007-02-15 Marek Safar <marek.safar@gmail.com>
7205 C# 3.0 extension methods.
7207 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
7208 cannot be used directly.
7210 * class.cs (Class.Emit): Emit extension attribute if any class method
7211 is extension method.
7212 (Method.Define): Add basic extension method validation conditions.
7213 (Method.Emit): Emit extension attribute for method.
7215 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
7216 extension method exists. Currently we follow same approach as Microsoft
7217 does, emit even if a method or a class are private but this can change
7220 * cs-parser.jay: Add handling of `this' keyword in method parameters
7223 * decl.cs (DeclSpace.IsStaticClass): New property.
7224 (MemberCache.FindExtensionMethods): Looks for extension methods with
7225 defined name and extension type.
7227 * doc.cs: Updated after OverloadResolve changes.
7229 * driver.cs: Add new soft reference to System.Core.dll.
7231 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
7232 (ExtensionMethodGroupExpr): Represents group of extension methods.
7234 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
7235 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
7236 to MethodGroupExpr and made non-static for easier customization.
7237 (Invocation.DoResolve): Add extension method lookup when no standard
7239 (MemberAccess.DoResolve): Try extension methods if no member exists.
7241 * modifiers.cs: Add METHOD_EXTENSION modifier.
7243 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
7244 as well as candidate extension type.
7245 (ComputeNamespaces): When assembly constains extension methods registers
7247 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
7248 extension method lookup.
7249 (Namespace.LookupExtensionMethod): Looks for extension method in this
7251 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
7252 find a method which matches name and extensionType.
7254 * parameter.cs (Parameter): Add This modifer.
7255 (HasExtensionMethodModifier): New property.
7256 (Resolve): Add extension parameter check.
7257 (ModFlags): turned to property to exclude this modifier as it is not real
7259 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
7261 * support.cs (ParameterData): Add ExtensionMethodType.
7262 (ReflectionParameters): Implemented ExtensionMethodType interface property.
7264 * typemanager.cs: Add type and ctor extension attribute type.
7266 2007-02-15 Miguel de Icaza <miguel@novell.com>
7268 * report.cs (DisableErrors, EnableErrors): used to prevent error
7269 output when we are "trying" to compile various methods with
7272 * ecore.cs (Expression): Add Clone method that calls the virtual
7273 CloneTo method. The current CloneTo method in Expression throws
7274 an exception so we can track down all the places where this must
7275 be implemented (not using abstract, because that would be a lot of
7276 up-front-work before we can start testing the implementation
7279 Important: we only need Clone capabilities for expressions created
7280 by the parser, as the expressions we will be cloning are
7281 expressions in the pre-resolved state. This vastly simplifies
7284 (SimpleName): Add CloneTo that does nothing.
7285 (EmptyCast): Add CloneTo.
7287 * expression.cs (Binary): Implement CloneTo.
7288 (Invocation.IsApplicable): Store the current ec in
7289 EmitContext.TempEc and restore it on return. This is used so we
7290 do not have to sprinkle hundres of methods with an extra
7291 EmitContext, we know that the only user is the lambda expression
7292 ImplicitConversionExists code.
7294 (Argument): Add Cloning capabilities.
7295 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
7296 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
7297 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
7298 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
7299 IndexerAccess): Add Clone capability.
7301 (LocalVariableReference, This): TODO: needs cloned Block mapping.
7303 (Argument): Add cloning capability.
7305 * assign.cs (Assign): Implement CloneTo.
7307 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
7309 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
7310 version by calling Convert with the EmitContext (that we are
7311 currently storing in ec, this is not great, but will do for now,
7312 to avoid passing EmitContext parameters to hundreds of functions
7313 that do not need them now).
7315 (SetExpression): Remove, it is not needed.
7317 (ContextualReturn): Implement CloneTo.
7319 * statement.cs (Statement): Implement cloning infrastructure,
7320 similar to expressions.
7322 (Block): Partial implementation of Clone for statements.
7324 (Return): Implement clone.
7326 * constant.cs (Constant.CloneTo): New method, does nothing.
7328 * codegen.cs (TempEc): Add a static EmitContext as a temporary
7329 solution, until we decide how to exactly do this.
7331 2007-02-14 Marek Safar <marek.safar@gmail.com>
7333 A fix for bug #80493
7334 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
7335 a property is override we need to use second accessor.
7337 2007-02-13 Marek Safar <marek.safar@gmail.com>
7339 A fix for bug #80418
7340 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
7343 2007-02-13 Marek Safar <marek.safar@gmail.com>
7345 Another fix for bug #80749
7346 * pending.cs: Abstract class has priority over interfaces.
7348 2007-02-13 Marek Safar <marek.safar@gmail.com>
7350 Another fix for bug #80749
7351 * pending.cs: Abstract class has priority over interfaces.
7353 2007-02-13 Marek Safar <marek.safar@gmail.com>
7355 Another fix for bug #80749
7356 * pending.cs: Abstract class has priority over interfaces.
7358 2007-02-13 Marek Safar <marek.safar@gmail.com>
7360 Another fix for bug #80749
7361 * pending.cs: Abstract class has priority over interfaces.
7363 2007-02-13 Marek Safar <marek.safar@gmail.com>
7365 * class.cs Better error message.
7367 * driver.cs: Add shorter versions of -optimize option.
7369 2007-02-13 Martin Baulig <martin@ximian.com>
7371 * class.cs (Constructor.Emit): Check the return value of
7372 ec.ResolveTopBlock() and return on error.
7374 2007-02-13 Raja R Harinath <rharinath@novell.com>
7376 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
7377 message to fix error message regression.
7379 2007-02-12 Marek Safar <marek.safar@gmail.com>
7381 * delegate.cs: Delegate creation expression cannot be of Nullable type.
7383 2007-02-12 Marek Safar <marek.safar@gmail.com>
7385 A fix for bug #80749
7386 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7387 its parent container.
7389 * class.cs (DefineFieldInitializers): Each initializer can has different
7392 * const.cs: Updated.
7394 2007-02-11 Miguel de Icaza <miguel@novell.com>
7396 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7397 now all the heavy lifting to check that embedded statements or
7398 expressions have the right form is done in the ContextualReturn.
7400 (ContextualReturn): New class.
7402 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7403 method that can be invoked to report 201, so we do not replicate
7406 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7408 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7409 treating tabs as spaces.
7411 2007-02-09 Marek Safar <marek.safar@gmail.com>
7413 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7414 * assign.cs: Use full implicit conversion for right side check.
7416 2007-02-09 Marek Safar <marek.safar@gmail.com>
7418 * statement.cs (Switch): Switch over boolean type is not standardized.
7420 2007-02-08 Marek Safar <marek.safar@gmail.com>
7422 A fix for bug #80755
7423 * decl.cs (FindBaseEvent): Don't use method cache for events.
7425 2007-02-07 Marek Safar <marek.safar@gmail.com>
7427 * cs-parser.jay: Better syntax error handling.
7429 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7430 instead of underlying type value.
7432 2007-02-06 Marek Safar <marek.safar@gmail.com>
7434 * driver.cs: Check define identifier before is registered.
7436 * namespace.cs: Use existing error message.
7438 * report.cs: New warning.
7440 2007-02-06 Marek Safar <marek.safar@gmail.com>
7442 A fix for bug #80742
7443 * expression.cs: Delegate Invoke method can be called directly.
7445 2007-02-06 Marek Safar <marek.safar@gmail.com>
7447 A fix for bug #80676
7448 * class.cs (IsEntryPoint): The Main method can have params modifier.
7450 2007-02-04 Miguel de Icaza <miguel@novell.com>
7452 * parameter.cs (Parameter, Parameters): Add Clone method.
7454 * anonymous.cs (Compatible): Turn method into virtual method, so
7455 LambdaExpression can implement a different behavior.
7457 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7458 out the basic checking here, so it can be used by
7461 * lambda.cs: Introduce "Compatible" function that will do the
7464 2007-02-02 Marek Safar <marek.safar@gmail.com>
7466 * attribute.cs: Unified one error message.
7468 * class.cs (Class): Use type attributes and not properties to test static
7470 (IsEntryPoint): Don's pass local variable.
7472 * convert.cs: Removed duplicate check.
7474 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7476 * driver.cs: Don't crash when soft reference does not exist.
7478 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7479 (UsingEntry): Removed redundant allocation.
7481 * parameter.cs: Add fast path for type parameters.
7483 * support.cs: Don't allocate attribute when it's not used.
7485 2007-01-30 Miguel de Icaza <miguel@novell.com>
7488 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7489 this into a virtual method, so we can override it in LambdaExpression.
7491 * driver.cs: Improve diagnostics in case of failure.
7493 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7494 write a function that is slightly more complex and that parses:
7496 type identifier [, type identifier]* )
7498 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7501 (canEmpty ? i >= 0 : i > 0)
7503 2007-01-30 Raja R Harinath <rharinath@novell.com>
7505 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7506 exception on possibly valid code.
7508 2007-01-29 Raja R Harinath <rharinath@novell.com>
7510 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7512 (parse_opt_type_arguments): Remove. It's almost the same as
7514 (parse_namespace_or_typename): Use parse_less_than.
7516 2007-01-28 Miguel de Icaza <miguel@novell.com>
7518 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7519 this bug took a few hours to find, because the state saved and
7520 restored by PushPosition and PopPosition was ignoring the state of
7521 parse_generic_less_than.
7523 I can also now remove the handling of OP_LT and OP_GT, this solves
7526 * cs-tokenizer.cs: store the location for the ARROW token, we use
7529 (PushPosition, PopPosition): save/restore also `current_token',
7530 restore `parse_generic_less_than' (was missing).
7532 (parse_opt_type_arguments): use parse_type, not
7533 parse_namespace_or_typename to parse types.
7535 * lambda.cs: Empty new file, will eventually have the lambda
7536 expression implementation.
7538 * lambda.test: used to test the internal tokenizer.
7540 * report.cs (FeatureIsNotISO1): Rename from
7541 FeatureIsNotStandardized, because it was about the language level
7542 (1 vs 2) it was not about standarization.
7544 (FeatureRequiresLINQ): New.
7546 * support.cs (SeekableStreamReader): Only require that the reader
7547 is a TextReader, not a StreamReader, so we can plug StringReader.
7549 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7550 given position in the input stream the following tokens can be
7551 parsed as a type followed by an identifier.
7553 (is_punct): after a '(' if parse_type_and_parameter returns true,
7554 then return a special token OPEN_PARENS_LAMBDA which is used to
7555 avoid reduce/reduce errors in the grammar for the
7556 lambda_expression rules.
7558 (parse_type): implement a type parser inside the
7559 tokenizer, the parser only returns true or false depending on
7560 whether the input at a given position can be parsed as a type.
7562 (peek_token): new method used during type parsing.
7564 2007-01-28 Raja R Harinath <rharinath@novell.com>
7567 * anonymous.cs (ScopeInfo.InflateParameters): New.
7568 (AnonymousContainer.Resolve): Use it to redirect types of
7569 delegate parameters.
7571 2007-01-27 Raja R Harinath <rharinath@novell.com>
7574 * expression.cs (Error_InvalidArguments): Don't use two different
7575 messages for CS1503. Use ExtraInformation and
7576 SymbolRelatedToPreviousError instead.
7579 * decl.cs (DeclSpace.initialize_type_params): Don't access
7580 'type_params' of a partial class directly.
7582 2007-01-26 Miguel de Icaza <miguel@novell.com>
7584 * constant.cs: Removed a handful of out-of-range checks that were
7587 2007-01-25 Marek Safar <marek.safar@gmail.com>
7589 * expression.cs (CheckUselessComparison): Add additional check for char
7592 * namespace.cs: Fixed typo.
7594 2007-01-23 Miguel de Icaza <miguel@novell.com>
7596 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7597 gone, instead we inline the test, preventing the needless casts to
7598 longs, ulongs and doubles for the parameters, avoiding calls to
7599 methods that overchecked stuff, and instead inlined things
7602 2007-01-20 Marek Safar <marek.safar@gmail.com>
7604 * cs-parser.jay: Better parameter error handling.
7606 2007-01-17 Marek Safar <marek.safar@gmail.com>
7608 A fix for bug #80368, #80522
7609 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7610 whether array initializer contains constants only.
7611 (ArrayCreation.Emit): Use better formula to decide when
7612 are array initializers for static initialization.
7613 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7614 have to emit even constants otherwise they are pre-initialized.
7616 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
7617 Raja R Harinath <rharinath@novell.com>
7619 Fix emit order of 'get' vs. 'set'.
7620 * support.cs (Accessors): New.
7621 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7622 Note the order in which accessors are declared in the source.
7623 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7624 Refactored from Property.Define and Indexer.Define.
7625 (PropertyBase.DefineAccessors): New helper that calls the above in
7626 appropriate order as noted by the parser.
7627 (Property.Define, Indexer.Define): Update to changes.
7628 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7630 2007-01-17 Raja R Harinath <rharinath@novell.com>
7632 Fix cs0029-6.cs and gcs0029-2.cs (regression)
7633 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7634 there's an implicit conversion from the current type to the target
7635 type before converting the underlying constant.
7637 2007-01-16 Marek Safar <marek.safar@gmail.com>
7639 * const.cs (ResolveValue): Updated after constant conversion was made more
7642 * constant.cs (GetAttributableValue): constant to object conversion is
7643 used for attributes only.
7644 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7645 constant conversions.
7646 (LongConstant.ConvertImplicitly): Ditto.
7648 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7649 (ImplicitConversionStandard): Handle constant conversion as extra step.
7650 It solves the issue when constant conversion was called indirectly like
7651 inside array initializer and constant folding was skipped.
7653 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7656 * statement.cs(ImplicitConversionStandard): Updated after constant
7657 conversion was made more generic.
7659 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
7661 * expression.cs (As.DoResolve): Use GenericConstraints instead of
7662 Constraints, solves the problem where the compiler incorrectly
7663 reported that a type parameter was not constrained to a class (Bug
7666 2007-01-14 Marek Habersack <grendello@gmail.com>
7668 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7670 2007-01-14 Marek Safar <marek.safar@gmail.com>
7672 A fix for bug #80368
7673 * assign.cs (FieldInitializer): New class implements field
7674 initializer statement.
7676 * attribute.cs: Update after FieldMember rename.
7678 * class.cs (PropertyBasedMember): New common class for property based
7680 (InterfaceMemberBase): New base class for all members which can be used as
7681 an interface members.
7682 (MethodCore): Moved really common code to InterfaceMemberBase.
7683 (Method.Define): Equal and GetHasCode detection is relevant for methods
7685 (MethodData.Define): Don't assume that public event implements an
7686 interface automatically.
7687 (MethodData.DefineMethodBuilder): Issue an error even if only extern
7689 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7690 (FieldMember): Merged with FieldBase.
7691 (EventProperty.AEventPropertyAccessor): New specialization to check whether
7692 event extern modifier can be used.
7693 (EventField.EventFieldAccessor): Moved event field specific code here.
7694 (Event.AllowedModifiers): Even event can be extern.
7695 (Event.FindOutBaseMethod): New override specific to events.
7696 (Indexer.parameters): Reintroduce parameters because base class holds
7697 only properties common data.
7698 (Indexer.CheckForDuplications): Indexers are threated as methods so we
7699 need do extra parameters check.
7701 * const.cs: Update after FieldMember rename.
7703 * decl.cs (MemberCache.FindBaseEvent): New method.
7705 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7706 to reflect that indexer is now derived from PropertyBased.
7708 * ecore.cs (GetMemberType): Made public.
7709 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7712 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7714 * typemanager.cs (CSharpSignature): Correctly print event accessors.
7715 (RegisterEvent): Removed.
7716 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7717 (GetPrivateFieldOfEvent): Renamed to GetEventField.
7719 2007-01-11 Raja R Harinath <rharinath@novell.com>
7722 * statement.cs (CollectionForeach.TryType): Prefer generic
7723 GetEnumerator over non-generic variant. Fix code to follow comments.
7725 2007-01-09 Raja R Harinath <rharinath@novell.com>
7728 * support.cs (ReflectionParameter): Don't use an invalid index on
7729 the generic parameter data.
7731 2007-01-08 Miguel de Icaza <miguel@novell.com>
7733 * driver.cs: Just add a tiny bit of infrastructure.
7735 2007-01-02 Marek Safar <marek.safar@gmail.com>
7737 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7738 where field type is struct from current assembly.
7740 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7743 2007-01-02 Marek Safar <marek.safar@gmail.com>
7745 A fix for bug #80381
7746 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7749 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7751 (Namespace.LookupType): Always use core types from corlib when speficied.
7753 * report.cs: A new warning.
7755 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7756 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7757 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7759 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7760 (InitCoreTypes): Set expression type of object_type and value_type
7761 immediately after lookup.
7763 2007-01-01 Miguel de Icaza <miguel@novell.com>
7765 * cs-tokenizer.cs: Accept Pc class characters (Connector
7766 Punctuation) as valid identifiers. Fixes #78259
7768 * expression.cs (Invocation.DoResolve): Moved the check for the
7769 use of `this' for doing method calls to the Invocation resolution
7770 step, after overload resolution has taken place instead of doing
7771 the check at the low-level `This.DoResolve' level.
7773 The `This.DoResolve'(appens before overload resolution, so it has
7774 no way of knowing if the method that will be called will be
7775 instace or static, triggering an erroneous report for cs0188 (Bug
7778 We now do the check for instance method invocations after we know
7779 what method will be called.
7781 (This.CheckThisUsage): Move the actual use of this structure
7782 checking into its own method and expose it.
7784 * Everywhere that called Error_ValueCannotBeConverted: pass a new
7787 Exceptions: Null.ConvertImplicitly,
7788 Constant.ImplicitConversionRequired as there are too many call
7789 sites for passing the ec.
7791 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7792 EmitContext, if the value is null, then we do not try to provide
7793 the extra information from the error (If a userdefined conversion
7794 exists, as UserDefinedConversion requires a non null-EmitContext).
7798 2006-12-30 Raja R Harinath <rharinath@novell.com>
7800 * flowanalysis.cs (MyBitVector): Document some invariants.
7801 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7802 introduced below, and add a couple of others,
7804 2006-12-30 Marek Safar <marek.safar@gmail.com>
7806 * attribute.cs (GetMethodObsoleteAttribute): Uses new
7807 GetPropertyFromAccessor and GetEventFromAccessor.
7809 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7810 overrides non-obsolete one.
7811 (Indexer.Define): Error message has been moved to the parser.
7813 * cs-parser.jay: Better syntax errors handling.
7815 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7816 when an invocation has no arguments.
7818 * ecore.cs: Removed not used caching.
7820 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7823 * report.cs: Add a new warning.
7825 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7827 * typemanager.cs (enumeration_type): Removed.
7828 (CSharpSignature): Reuses IsSpecialMethod.
7829 (IsEqual): Hack for MS BCL.
7830 (GetPropertyFromAccessor): New method.
7831 (GetEventFromAccessor): New method.
7832 (IsSpecialMethod): Fixed to handle more cases.
7834 2006-12-30 Marek Safar <marek.safar@gmail.com>
7836 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7837 Made white spaces array static.
7839 * ecore.cs (RemoveGenericArity): Optimized.
7841 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7843 (MyBitVector.initialize_vector): Simplified.
7845 2006-12-22 Miguel de Icaza <miguel@novell.com>
7847 * ecore.cs: Am not entirely happy with this hack, but it seems to
7848 address the issue in 80257 (a small test case for
7851 I set the MethodGroupExpr.Type to an internal compiler type
7852 (itself in this case) to force the resolution to take place. Why
7853 it does not take place with a null is beyond me.
7855 2006-12-20 Marek Safar <marek.safar@gmail.com>
7857 A fix for bug #80288
7858 * expression.cs (ResolveOperator): Consider user defined conversion for
7859 logical and operator too.
7860 (EmitBranchable): Optimization for logical and when full constant folding
7861 could not be applied but one operand is constant.
7863 2006-12-19 Marek Safar <marek.safar@gmail.com>
7865 * class.cs (GetClassBases): Write 5 times every day, will never use
7866 FullName for error reporting.
7868 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7870 2006-12-19 Martin Baulig <martin@ximian.com>
7872 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7873 the symbol file info here.
7875 2006-12-18 Marek Safar <marek.safar@gmail.com>
7877 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7878 of `elseif' is taking then following sections are not taking.
7879 Fixes an issue reported on mono mailing list.
7881 2006-12-18 Marek Safar <marek.safar@gmail.com>
7883 A fix for bug #80300
7884 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7885 a caller is not taking.
7887 2006-12-18 Raja R Harinath <rharinath@novell.com>
7889 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7890 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7891 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7892 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7893 * class.cs: Update to changes.
7895 2006-12-17 Marek Safar <marek.safar@gmail.com>
7897 A fix for bug #79934
7898 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7901 * class.cs (ResolveMembers): Register an iterator in current container and
7904 2006-12-16 Raja R Harinath <rharinath@novell.com>
7907 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7908 satisfy a params annotated parameter.
7910 2006-12-16 Marek Safar <marek.safar@gmail.com>
7912 A fix for bug #77014
7913 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7914 paramters correctly and not rely on hacks in Parameters class.
7915 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7917 (Invocation.VerifyArgumentsCompat): Ditto.
7918 (Invocation.EmitArguments): Changed to correctly emit params arguments at
7921 * parameter.cs (HasParams): Don't assume that params is the last one.
7923 * support.cs (ReflectionParameters.ctor): Look for params attribute
7925 (ReflectionParameters.ParameterType): Removed hack when we returned last
7926 parameter for out of range parameters.
7927 (ParameterName, ParameterModifier): Ditto.
7929 2006-12-14 Marek Safar <marek.safar@gmail.com>
7931 A fix for bug #79987
7932 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7933 when assembly is not CLS compliant but type is. I have no idea why is this
7936 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7938 2006-12-13 Miguel de Icaza <miguel@novell.com>
7940 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7941 in struct constructors, they are basically no-ops.
7943 2006-12-12 Marek Safar <marek.safar@gmail.com>
7945 * cs-tokenizer.cs (Position): Save preprocessor status too.
7947 2006-12-12 Marek Safar <marek.safar@gmail.com>
7949 A fix for bug #77794
7950 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7952 2006-12-12 Marek Safar <marek.safar@gmail.com>
7954 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7956 (pp_expr): Report error for an invalid expression.
7957 (handle_preprocessing_directive): Simplified; add more error checking.
7959 2006-12-11 Marek Safar <marek.safar@gmail.com>
7961 A fix for bug #74939
7962 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7963 directives handling.
7965 2006-12-10 Marek Safar <marek.safar@gmail.com>
7967 A fix for bugs #80093, and #75984
7968 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7969 logic, it seems to me as it worked before "by coincidence".
7970 (xtoken): Simplified to use reworked handle_preprocessing_directive.
7971 (cleanup): Enabled endif check.
7973 2006-12-09 Marek Safar <marek.safar@gmail.com>
7975 A fix for bug #80162
7976 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7977 enumerators are never ambiguous.
7979 2006-12-08 Raja R Harinath <rharinath@novell.com>
7982 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7984 2006-12-06 Marek Safar <marek.safar@gmail.com>
7986 A fix for bug #80144
7987 * class.cs (EventProperty.Define): Explicit implementation means
7988 that an even is used.
7990 2006-12-06 Marek Safar <marek.safar@gmail.com>
7992 Fixes the operators implementation (part II)
7994 * cfold.cs (DoConstantNumericPromotions): Renamed to
7995 DoBinaryNumericPromotions and simplified.
7996 (BinaryFold): Couple of conversion fixes; simplified.
7998 * constant.cs, ecore.cs, literal.cs
7999 (ToType): Renamed to ConvertImplicitly.
8000 (Reduce): Renamed to ConvertExplicitly.
8002 * class.cs, convert.cs: Updated.
8004 * expression.cs: TryReduce doesn't throw an exception.
8006 2006-12-01 Marek Safar <marek.safar@gmail.com>
8008 A fix for bug #80108
8009 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
8012 2006-11-30 Marek Safar <marek.safar@gmail.com>
8014 Fixes unary operators implementation (part I)
8017 * cfold.cs (Error_CompileTimeOverflow): Made internal
8019 * const.cs (IConstant): Changed to use reference to constant and
8020 not constant itself.
8021 Updated IConstant implementations.
8023 * constant.cs (CreateConstant): New factory method.
8024 Updated IConstant implementation.
8026 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
8028 * ecore.cs: Updated to use CreateConstantReference.
8030 * enum.cs: Reflects IConstant changes.
8032 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
8034 * literal.cs (NullConstant): Change to be independently usable.
8036 2006-11-29 Martin Baulig <martin@ximian.com>
8038 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
8039 we need to emit the scope initializer before calling the base .ctor.
8041 * anonymous.cs: Merged back from the new anonymous methods branch.
8042 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
8044 * expression.cs (ParameterReference.DoResolveBase): Create a
8045 "normal" ScopeInfo when capturing parameters rather than using the
8046 root scope; this makes things work with anonymous methods having
8050 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
8052 2006-11-22 Marek Safar <marek.safar@gmail.com>
8054 A fix for bug #79987
8055 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
8056 check to a base class.
8057 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
8058 only when assembly has missing attribute.
8059 * report.cs: Update.
8061 2006-11-21 Marek Safar <marek.safar@gmail.com>
8063 * cs-tokenizer.cs: Merged with gmcs version.
8065 2006-11-20 Marek Safar <marek.safar@gmail.com>
8068 * cs-parser.jay: Better error message when partial keyword is misplaced.
8070 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
8072 A fix for bug #79810
8073 report.cs: CS1058 only applies to 2.0 profile (gmcs).
8074 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
8075 a RuntimeWrappedException by default.
8077 2006-11-18 Marek Safar <marek.safar@gmail.com>
8079 A fix for bug #79843
8080 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
8082 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
8084 2006-11-18 Marek Safar <marek.safar@gmail.com>
8086 * driver.cs, namespace.cs: Uses faster IndexOf version.
8088 2006-11-17 Marek Safar <marek.safar@gmail.com>
8090 A fix for bug #79941
8091 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
8093 (Operator.Define): Implicit/Explicit operator of same type is duplicate
8094 even if internal name is different.
8095 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
8096 (UserDefinedConversion): Simplified as the operators cannot be internal.
8097 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
8099 (MethodLookup): Replaced EmitContext with parentType.
8100 * expression.cs: Updated.
8102 2006-11-09 Raja R Harinath <rharinath@novell.com>
8104 * driver.cs (BadAssembly): Handle all the ugliness of
8105 DefineDynamicAssembly.
8107 2006-11-08 Raja R Harinath <rharinath@novell.com>
8109 Address parts of #58244 -- most of what's left is in the runtime
8110 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
8111 CS1509 error checks, and handle them for all assembly loads, not
8112 just the first invocation.
8113 (LoadModule): Likewise. Move handling of 'adder_method' ...
8114 * codegen.cs (AssemblyClass.AddModule): ... here.
8116 2006-11-02 Marek Safar <marek.safar@gmail.com>
8118 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
8119 IEnumerable<T> is ambiguous.
8121 2006-10-31 Marek Safar <marek.safar@gmail.com>
8123 A fix for bug #67689
8124 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
8125 GetEnumerator is ambiguous.
8127 * report.cs: Add new warning.
8129 2006-10-29 Marek Safar <marek.safar@gmail.com>
8131 A fix for bug #78602
8132 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
8133 to protected member can be nested type.
8135 2006-10-28 Marek Safar <marek.safar@gmail.com>
8137 A fix for bug #78965
8138 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
8139 to protected member must derive from current type.
8141 2006-10-27 Marek Safar <marek.safar@gmail.com>
8143 assign.cs: Reuses error method.
8145 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
8146 instead of type for constants.
8147 (Expression.Error_ValueAssignment): Common error method.
8149 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
8152 2006-10-27 Marek Safar <marek.safar@gmail.com>
8154 A fix for bug #79081
8155 * expression.cs (MemberAccess.DoResolve): Check nested type
8158 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
8160 * doc.cs : nested delegates were not handled. Fixed bug #79754.
8162 2006-10-26 Marek Safar <marek.safar@gmail.com>
8164 A fix for bug #76591
8165 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
8167 2006-10-26 Marek Safar <marek.safar@gmail.com>
8169 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
8170 type forwarder of the same type multiple times.
8172 2006-10-26 Raja R Harinath <rharinath@novell.com>
8175 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
8176 instance as an rvalue, even when we later resolve as an lvalue.
8178 2006-10-25 Martin Baulig <martin@ximian.com>
8180 * anonymous.cs: Fix #79673.
8182 2006-10-24 Marek Safar <marek.safar@seznam.cz>
8184 A fix for bug #79666
8185 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
8186 ignored when is optimized (= default value) as its value is already set.
8188 2006-10-23 Marek Safar <marek.safar@seznam.cz>
8190 A fix for bug #79724
8191 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
8192 TypeContainer for type lookup.
8194 2006-10-23 Marek Safar <marek.safar@seznam.cz>
8196 A fix for bug #79231
8197 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
8198 * expression.cs (OverloadResolve): Always convert type name for
8200 (ResolveNamespaceOrType): Don't confuse a nested type with any
8203 2006-10-18 Martin Baulig <martin@ximian.com>
8205 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
8207 2006-10-17 Miguel de Icaza <miguel@novell.com>
8209 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
8210 an int32, but requesting an int64 from the conversion
8212 2006-10-12 Martin Baulig <martin@ximian.com>
8215 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
8217 2006-10-12 Martin Baulig <martin@ximian.com>
8220 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
8222 2006-10-11 Miguel de Icaza <miguel@novell.com>
8224 * convert.cs: Remove broken code: I was doing the "Existance"
8225 tests for Implicit conversions.
8227 2006-10-10 Miguel de Icaza <miguel@novell.com>
8229 * convert.cs: Added one missing case in
8230 ImplicitStandardConversionExists uint64 to intptr.
8234 * typemanager.cs (uintptr_type): another core known type.
8236 * ecore.cs (OperatorCast): routine used to do cast operations that
8237 depend on op_Explicit. We could change some of the Decimal
8238 conversions to use this.
8240 This one has a probe mechanism that checks both types for an op_
8241 which it coudl be used to eliminate two classes: CastToDecimal
8242 and CastFromDecimal.
8244 * convert.cs: Implement the conversions documented in #59800
8246 2006-10-10 Martin Baulig <martin@ximian.com>
8248 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
8249 before RootScope.ResolveMembers().
8251 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
8252 `CurrentType' if appropriate.
8254 2006-10-09 Marek Safar <marek.safar@seznam.cz>
8256 A fix for bug #78568
8257 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
8258 when contains binary operators.
8259 * cs-parser.jay: Updated.
8261 2006-10-09 Martin Baulig <martin@ximian.com>
8264 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
8265 moved that into Define() and also do the other type parameter
8266 checks there. Fixes #79094. Added gtest-292.cs.
8269 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
8270 since that doesn't include type parameters; don't use `Ldelema'
8271 for type parameters. Fixes #78980. Added gtest-293.cs.
8273 2006-10-08 Marek Safar <marek.safar@seznam.cz>
8276 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
8277 conversion is allowed.
8279 2006-10-06 Marek Safar <marek.safar@seznam.cz>
8281 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
8282 error reporting when no error occurs.
8284 2006-10-06 Marek Safar <marek.safar@seznam.cz>
8286 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
8289 2006-10-06 Raja R Harinath <rharinath@novell.com>
8292 * class.cs (DefineTypeBuilder): Check circular dependencies before
8293 setting the parent of the TypeBuilder.
8294 (CheckRecursiveDefinition): Don't use 'BaseType', since
8295 it may not be valid until after DefineTypeBuilder. Use
8296 'base_type' instead.
8298 2006-10-04 Martin Baulig <martin@ximian.com>
8300 Merged the Anonymous Methods patch.
8302 * anonymous.cs, iterators.cs: The new anonymous methods code.
8304 * statement.cs (Variable): New public abstract class.
8305 (LocalInfo.Variable): New public property.
8306 (LocalInfo.ResolveVariable): New public method.
8307 (Block.Flags): Add `IsIterator'.
8308 (Block.AddVariable): Improved the CS0136 check.
8309 (Block.AnonymousChildren): New public property.
8310 (Block.AddAnonymousChild): New public method.
8311 (ToplevelBlock): Update to use the new anonymous method framework.
8312 (ToplevelBlock.ctor): `container' is now a `Block' and not a
8313 `ToplevelBlock'; this is required to correctly implement the
8315 (Fixed, Using): Use `TemporaryVariable' instead of directly
8316 creating the `LocalBuilder'.
8318 * parameter.cs (Parameter.ResolveVariable): New public method.
8319 (Parameters.ResolveVariable): Likewise.
8321 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
8323 * class.cs (TypeContainer): Replaced the `iterators' list and
8324 corresponding methods with a list of `CompilerGeneratedClass'es.
8325 (TypeContainer.ResolveMembers): New public method.
8326 (Method): `IIteratorContainer' has been replaced by
8329 * expression.cs (VariableReference): New public abstract base
8330 class for `LocalVariableReference', `ParameterReference' and
8333 * codegen.cs (EmitContext): Removed `capture_context',
8334 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
8335 (EmitContext.EmitThis): Removed.
8337 * cs-parser.jay: Replace `iterator_container' with
8340 2006-10-04 Martin Baulig <martin@ximian.com>
8342 * generic.cs (GenericMethod): Don't make this abstract.
8343 (Constraints.Clone): Added dummy implementation.
8345 2006-10-04 Raja R Harinath <harinath@gmail.com>
8348 * namespace.cs (LookForAnyGenericType): Avoid nullref on
8349 'declspaces'. Avoid allocating arrays willy-nilly.
8352 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
8353 cases out of the switch.
8355 2006-09-28 Marek Safar <marek.safar@seznam.cz>
8357 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
8358 message when non-generic type is used with the type arguments.
8359 * expression.cs: Updated.
8361 2006-09-28 Raja R Harinath <rharinath@novell.com>
8364 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
8365 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8366 Change semantics slightly. Don't insist on having only one
8367 temporary EmptyExpression -- just throttle the creation of new ones.
8370 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
8371 non-interfaces too. If no methods are found, don't try to create
8374 2006-09-28 Marek Safar <marek.safar@seznam.cz>
8376 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
8379 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
8380 us produce better error message.
8382 2006-09-27 Marek Safar <marek.safar@seznam.cz>
8384 * expression.cs (Binary.ResolveOperator): Warn about a side effect
8385 of the `|' operator.
8387 * report.cs: A new warning added.
8389 2006-09-27 Martin Baulig <martin@ximian.com>
8391 * generic.cs (GenericMethod): Don't make this abstract.
8393 2006-09-27 Martin Baulig <martin@ximian.com>
8396 (InternalErrorException): Added overloaded ctor taking a params array.
8398 2006-09-26 Marek Safar <marek.safar@seznam.cz>
8400 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8401 Fixed the cases when same error was reported twice.
8403 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8404 now report symbol information.
8406 2006-09-25 Martin Baulig <martin@ximian.com>
8408 * class.cs: Completely unified with the gmcs version.
8410 2006-09-25 Martin Baulig <martin@ximian.com>
8412 * typemanager.cs (TypeManager.IsNullableType): New public function.
8413 (TypeManager.IsNullableTypeOf): Likewise.
8414 (TypeManager.IsNullableValueType): Likewise.
8416 * class.cs (MethodCore): Added the `GenericMethod' argument from
8417 gmcs and also unified all classes derived from `MethodCore' with gmcs.
8419 2006-09-24 Raja R Harinath <harinath@gmail.com>
8421 * convert.cs: Unify with gmcs version.
8423 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8425 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8426 verify them as well.
8428 * report.cs: New warning.
8430 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8432 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8433 for anonymous block with out argument.
8435 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8437 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8438 not used private events only.
8440 2006-09-23 Marek Safar <marek.safar@seznam.cz>
8442 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8444 * const.cs (Const.Define): Check for constant type.
8445 (Const.IsConstantTypeValid): Looks for valid constant types.
8447 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8449 * ecore.cs (EmptyConstantCast): New common class for all constant based
8452 * expression.cs (Is.DoResolve): Handle null constant especially.
8453 (New.DoResolve): Check for new void().
8454 (MemberAccess.DoResolve): Cope with all kind of nulls.
8456 * literal.cs (NullConstant): Uses EmptyConstantCast.
8457 (NullDefault): Based on EmptyConstantCast.
8458 (NullLiteral): Uses EmptyConstantCast.
8460 * statement.cs (Block.ResolveMeta): Check for constant type.
8462 2006-09-22 Martin Baulig <martin@ximian.com>
8464 * delegate.cs, attribute.cs: Merged with the gmcs versions.
8466 2006-09-22 Raja R Harinath <rharinath@novell.com>
8468 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8472 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8473 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
8476 2006-09-22 Martin Baulig <martin@ximian.com>
8478 * ecore.cs: Merged with the gmcs version.
8480 * generic.cs (ConstructedType): New dummy class.
8481 (TypeArguments): Don't make this abstract.
8484 (TypeManager.IsGenericTypeDefinition): New method.
8485 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8487 2006-09-22 Raja R Harinath <rharinath@novell.com>
8489 * expression.cs (ComposedCast): Check for arrays of TypedReference
8490 before creating the type, not after.
8492 2006-09-21 Marek Safar <marek.safar@seznam.cz>
8494 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8495 after ToType change.
8497 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8498 when constant must be implicitly convertible.
8500 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8502 * ecore.cs (NullCast): Derives from NullConstant.
8504 * expression.cs (Is.DoResolve): Removed useless variables.
8505 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8506 (New.Constantify): Add enum support.
8507 (MemberAccess.DoResolve): Add warning when accessing null constant or
8510 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8513 * literal.cs (NullConstant): New abstract class with common
8514 functionality for all null specializations.
8515 (NullDefault): Represents default(X) when result can be
8517 (NullLiteral): Updated.
8519 * report.cs: Add new warning.
8521 2006-09-21 Martin Baulig <martin@ximian.com>
8523 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8525 2006-09-21 Martin Baulig <martin@ximian.com>
8527 * generic.cs (GenericConstraints): New dummy class.
8528 (Constraints): Likewise.
8529 (TypeParameter): Likewise.
8530 (TypeParameterName): Likewise.
8531 (GenericMethod): Likewise.
8533 * typemanager.cs (TypeManager.GetGenericArguments): New method.
8535 * decl.cs: Merged with the gmcs version.
8537 2006-09-21 Raja R Harinath <rharinath@novell.com>
8539 * generic.cs (TypeParameter): Implement IMemberContainer.
8540 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
8542 * rootcontext.cs: Unify with gmcs version.
8544 * report.cs: Unify with gmcs version.
8545 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8546 from gmcs/generics.cs.
8547 * generics.cs (TypeParameter): New dummy class.
8549 * support.cs: Unify with gmcs version.
8551 2006-09-20 Raja R Harinath <rharinath@novell.com>
8553 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8554 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8556 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8557 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8558 * mcs.exe.sources: Add generic.cs.
8560 * codegen.cs: Unify with gmcs version.
8562 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8563 (EmitContext): Add GenericDeclContainer implementation.
8564 * decl.cs (MemberCore, DeclSpace): Likewise.
8565 * namespace.cs: Remove #ifdef GMCS_SOURCE.
8567 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8568 MCS TypeManager has a corresponding dummy method.
8570 2006-09-19 Martin Baulig <martin@ximian.com>
8572 * expression.cs: Completely merged with the gmcs version.
8574 2006-09-19 Martin Baulig <martin@ximian.com>
8576 * expression.cs (Invocation): Merged with the gmcs version.
8577 (ArrayAccess.GetStoreOpcode): Likewise.
8579 2006-09-19 Martin Baulig <martin@ximian.com>
8582 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8583 (TypeManager.IsGenericMethodDefinition): Likewise.
8585 2006-09-19 Martin Baulig <martin@ximian.com>
8588 (TypeManager.IsEqual): Moved the gmcs implementation here.
8589 (TypeManager.DropGenericTypeArguments): Likewise.
8590 (TypeManager.DropGenericMethodArguments): Likewise.
8591 (TypeManager.GetTypeArguments): Moved here from gmcs.
8592 (TypeManager.HasGenericArguments): Likewise.
8594 2006-09-19 Martin Baulig <martin@ximian.com>
8596 * expression.cs (Binary): Merged with the gmcs version.
8598 2006-09-19 Martin Baulig <martin@ximian.com>
8600 * expression.cs (Probe, As, Is): Merged with the gmcs version.
8602 2006-09-19 Martin Baulig <martin@ximian.com>
8604 * typemanager.cs: Merged with the gmcs version.
8606 2006-09-16 Raja R Harinath <rharinath@novell.com>
8608 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8609 * driver.cs: Likewise.
8611 2006-09-16 Marek Safar <marek.safar@seznam.cz>
8614 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8615 only if parent type is class.
8616 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8619 2006-09-15 Marek Safar <marek.safar@seznam.cz>
8622 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8624 * typemanager.cs(CSharpName): Converts NullType to null.
8626 2006-09-15 Martin Baulig <martin@ximian.com>
8629 (TypeManager.GetMethodName): Added mcs implementation.
8630 (TypeManager.IsEqual): Likewise.
8633 (SimpleName.RemoveGenericArity): Added dummy implementation.
8635 * pending.cs: Merged with the gmcs version.
8637 2006-09-15 Martin Baulig <martin@ximian.com>
8639 * statement.cs: Merge with the gmcs version.
8641 2006-09-15 Martin Baulig <martin@ximian.com>
8643 * statement.cs (Switch): Merge with the gmcs implementation
8644 (without nullables), which is newer.
8646 2006-09-15 Martin Baulig <martin@ximian.com>
8648 * statement.cs (Block.Variables): Make this public.
8649 (ToplevelBlock.Parameters): Make this a property.
8650 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8652 2006-09-15 Martin Baulig <martin@ximian.com>
8654 * namespace.cs: Merge with the gmcs version.
8656 2006-09-15 Martin Baulig <martin@ximian.com>
8658 * decl.cs (MemberName): Minor code cleanups.
8660 2006-09-15 Martin Baulig <martin@ximian.com>
8662 * parameter.cs: Merge with the gmcs version.
8664 2006-09-15 Martin Baulig <martin@ximian.com>
8666 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8667 and an error in mcs.
8669 2006-09-15 Martin Baulig <martin@ximian.com>
8671 * flowanalysis.cs: Merged from GMCS; added the generics code into
8672 a `GMCS_SOURCE' conditional so we can share this file.
8674 2006-09-08 Martin Baulig <martin@ximian.com>
8676 * typemanager.cs (TypeManager.interlocked_type): New public field.
8677 (TypeManager.int_interlocked_compare-exchange): New public field.
8678 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8679 enumerator types here and call InitGenericCoreTypes().
8680 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8681 after calling InitEnumUnderlyingTypes().
8684 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8685 `classes_second_stage'.
8687 2006-09-14 Marek Safar <marek.safar@seznam.cz>
8689 * assign.cs, ecore.cs, expression.cs: Share error message text.
8690 * class.cs (FieldMember.Define): Check for varible of static type.
8691 * driver.cs (LoadAssembly): Uses error output for errors.
8692 * statement.cs: Updated.
8694 2006-09-08 Marek Safar <marek.safar@seznam.cz>
8696 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8699 2006-09-07 Martin Baulig <martin@ximian.com>
8702 (MainDriver): Revert r62663 from Marek; see #70506 for details.
8704 2006-08-29 Miguel de Icaza <miguel@novell.com>
8706 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8708 2006-08-17 Miguel de Icaza <miguel@novell.com>
8710 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8711 #52019 and #79064, the use of the \uXXXX sequence in source code
8712 to represent unicode characters.
8714 2006-08-15 Marek Safar <marek.safar@seznam.cz>
8716 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8718 * class.cs, ecore.cs, statement.cs: Merged to one error message.
8720 2006-08-13 Miguel de Icaza <miguel@novell.com>
8722 * assign.cs: Catch attempts to assign to a method groups in += and
8725 2006-08-13 Marek Safar <marek.safar@seznam.cz>
8728 * cs-parser.jay: Don't destroy current array type by typeof of array's.
8730 2006-08-12 Marek Safar <marek.safar@seznam.cz>
8732 * class.cs (Method.Define): Issue a warning when generic method looks like
8734 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8737 2006-08-09 Marek Safar <marek.safar@seznam.cz>
8739 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8741 * decl.cs (MemberCache.FindMembers): When container is interface we need to
8742 search all base interfaces as a member can be ambiguous.
8743 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8744 Constructor member type filter.
8745 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8746 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8747 reporting for returned memberinfos.
8748 * report.cs: Updated.
8749 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8750 version to work on all runtimes.
8751 (TypeManager.RealMemberLookup): Removed members filtering.
8753 2006-08-08 Raja R Harinath <rharinath@novell.com>
8755 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8756 (PropertyExpr.EmitAssign): Likewise.
8757 * expression.cs (Indirection.EmitAssign): Likewise.
8758 (LocalVariableReference.EmitAssign): Likewise.
8759 (ParameterReference.EmitAssign): Likewise.
8760 (Invocation.EmitArguments): Likewise.
8761 (ArrayAccess.EmitAssign): Likewise.
8762 (IndexerAccess.EmitAssign): Likewise.
8763 (This.EmitAssign): Likewise.
8764 (ConditionalLogicalOperator.Emit): Likewise.
8767 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
8768 instead of ArrayList. If the hashtable has a LocalBuilder, don't
8769 leave it in after returning it.
8770 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
8772 2006-08-06 Marek Safar <marek.safar@seznam.cz>
8774 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8777 2006-08-03 Raja R Harinath <rharinath@novell.com>
8779 Fix cs0146-3.cs and cs0146-4.cs.
8780 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8781 enclosing types don't depend on the current type.
8783 2006-08-02 Raja R Harinath <rharinath@novell.com>
8786 * class.cs (TypeContainer.DoDefineMembers): Use
8787 FindBaseMemberWithSameName on Parent, since we're interested in
8788 whether we hide inherited members or not.
8789 (FindBaseMemberWithSameName): Make slightly more robust.
8791 Fix the non-generic testcase from #77396
8792 * decl.cs (DeclSpace.DeclContainer): Remove override.
8794 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8795 declspaces for doppelgangers too.
8796 (UsingEntry): Implement IResolveContext.
8797 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
8798 'this' as the resolve context.
8799 (LocalAliasEntry): Likewise.
8801 Implement parts of #77403
8802 * roottypes.cs (RootDeclSpace): New. Used to represent the
8803 toplevel declaration space. Each namespace declaration introduces
8804 a "partial" root declaretion space.
8805 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8806 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8807 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8808 from 'current_namespace.SlaveDeclSpace'.
8809 (namespace_declaration): Likewise.
8810 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8811 check. It can't happen now.
8812 * decl.cs (DeclSpace.LookupType): Likewise.
8813 * driver.cs (MainDriver): Sanity check.
8815 2006-08-01 Raja R Harinath <rharinath@novell.com>
8817 * decl.cs (DeclSpace.FindNestedType): Remove.
8818 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8819 LookupTypeContainer to get the container of the nested type.
8820 * class.cs (TypeContainer.FindNestedType): Make non-override.
8822 2006-07-31 Raja R Harinath <rharinath@novell.com>
8824 * decl.cs (DeclSpace.PartialContainer): Move field from ...
8825 * class.cs (TypeContainer.PartialContainer): ... here.
8826 (TypeContainer.AddBasesForPart): New helper.
8827 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
8829 * cs-parser.jay (current_class): Convert to DeclSpace.
8830 (struct_declaration, interface_declaration, class_declaration):
8831 Use AddBasesForPart instead of .Bases directly.
8832 * const.cs, iterators.cs: Update to changes.
8834 2006-07-28 Raja R Harinath <rharinath@novell.com>
8836 * class.cs (TypeContainer.AddMemberType): Rename from
8838 (TypeContainer.AddMember): Rename from AddToMemberContainer.
8839 (AddTypeContainer): New. Combine AddClassOrStruct and
8841 (AddPartial): Update. Add 'is_partial' argument.
8842 * roottypes.cs: Update to changes.
8843 * cs-parser.jay (push_current_class): New helper for handling
8844 current_container and current_class.
8845 (struct_declaration, interface_declaration, class_declaration):
8848 2006-07-26 Raja R Harinath <rharinath@novell.com>
8850 * roottypes.cs: Rename from tree.cs.
8852 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8853 * tree.cs (Tree, ITreeDump): Remove types.
8854 * rootcontext.cs (tree, Tree): Remove fields.
8855 (root, ToplevelTypes): New.
8856 * *.cs: Update to rename.
8858 * tree.cs (Tree.RecordDecl): Remove.
8859 (RootTypes.AddToTypeContainer): Record the toplevel type in its
8861 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8863 2006-07-23 Raja R Harinath <harinath@gmail.com>
8865 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8866 DoFlowAnalysis and OmitStructFlowAnalysis here.
8867 (ec.With): Rename from WithUnsafe and generalize.
8868 (ec.WithCheckState): Remove. All users can be handled by 'With'.
8869 (ec.WithFlowAnalyis): New.
8870 * ecore.cs, expression.cs, statement.cs: Update.
8872 2006-07-22 Raja R Harinath <harinath@gmail.com>
8874 * statement.cs (Block.ResolveMeta): Simplify slightly.
8876 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
8877 multiple boolean fields. Convert InUnsafe, constant_check_state,
8878 check_state to flags.
8879 (CheckState, ConstantCheckState): Update.
8880 (InUnsafe): New read-only property.
8881 (FlagsHandle): Rename from CheckStateHandle and convert to handle
8883 (WithUnsafe): New helper similar to WithCheckState.
8884 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8885 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8887 2006-07-21 Raja R Harinath <rharinath@novell.com>
8889 Make comparisons use the same IL irrespective of whether they're
8890 in a 'checked' or 'unchecked' context: one of the issues in #78899
8891 * codegen.cs (EmitContext.CheckState): Make read-only property.
8892 (EmitContext.ConstantCheckState): Likewise.
8893 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8894 helper that implement a save/restore stack for CheckState
8895 values. This is the only way to change check-state.
8896 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8897 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8898 (CheckedExpr.EmitBranchable): New forwarding method.
8899 (UnCheckedExpr): Likewise.
8900 * statement.cs (Block.ResolveMeta): Use WithCheckState.
8901 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8902 (Checked.Resolve, checked.DoEmit): Likewise.
8904 2006-07-20 Miguel de Icaza <miguel@novell.com>
8906 * anonymous.cs: Cache the resolved anonymous delegate, and return
8907 this so that the ResolveTopBlock is only triggered once, not
8910 Currently we trigger ResolvetopBlock twice due to a first pass of
8911 argument check compatibility, and a second pass that does the
8914 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8916 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8918 * rootcontext.cs (Reset): Add helper_classes.
8920 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8923 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8926 2006-07-13 Miguel de Icaza <miguel@novell.com>
8928 * statement.cs (Lock): Handle expressions of type
8929 TypeManager.null_type specially. Fixes #78770
8931 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8933 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8936 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8938 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8939 for accessors as well.
8940 * ecore.cs (EventExpr): Add AccessorTable.
8942 2006-07-01 Marek Safar <marek.safar@seznam.cz>
8945 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8946 for CS0122 where appropriate.
8947 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8949 (Filter): Assembly can be null in the case of top level attributes.
8951 2006-06-25 Marek Safar <marek.safar@seznam.cz>
8955 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8956 is done at global level.
8958 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8960 A fix for #77002, Implemented TypeForwarder support.
8962 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8963 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8964 * typemanager.cs (): Add type_forwarder_attr_type.
8966 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8968 * report.cs: Add CS0469 warning.
8970 2006-06-21 Martin Baulig <martin@ximian.com>
8972 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8973 the `try'-block, so we also report CS0016 etc. there.
8975 2006-06-21 Martin Baulig <martin@ximian.com>
8978 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8980 2006-06-21 Martin Baulig <martin@ximian.com>
8982 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8983 also report CS1686 for parameters.
8985 2006-06-21 Martin Baulig <martin@ximian.com>
8987 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8988 instead of an error if the value is not implicitly convertible to
8989 the switch types; fixes #77964.
8991 2006-06-21 Raja R Harinath <rharinath@novell.com>
8994 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8995 FieldBuilder is null.
8998 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8999 'left' and 'right' before error-checking.
9001 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
9003 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
9005 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
9006 (FieldExpr.DoResolve): likewise.
9007 (PropertyExpr.InstanceResolve): likewise.
9008 (EventExpr.InstanceResolve): likewise.
9010 2006-06-04 Marek Safar <marek.safar@seznam.cz>
9012 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
9013 attribute applicable tests for attribute argument.
9015 2006-06-02 Raja R Harinath <rharinath@novell.com>
9018 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
9019 (Binary.OverloadResolve_PredefinedIntegral): New.
9020 (Binary.OverloadResolve_PredefinedFloating): New.
9021 (Binary.OverloadResolve_PredefinedString): New.
9022 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
9023 Follow the standard more closely, and treat numeric promotions in
9024 terms of overload resolution.
9025 (Binary.CheckShiftArguments): Simplify.
9027 2006-06-01 Raja R Harinath <rharinath@novell.com>
9029 * flowanalysis.cs (MyBitVector): Simplify representation.
9030 (MyBitVector.Clone): Avoid allocating BitArray.
9031 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
9032 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
9033 (*): Update. Change all references to MyBitVector.And and
9034 MyBitVector.Or to &= and |=.
9036 2006-05-29 Raja R Harinath <rharinath@novell.com>
9039 * cs-parser.jay (formal_parameter_list): Extend the pattern below
9040 to param arguments too.
9042 2006-05-26 Miguel de Icaza <miguel@novell.com>
9044 * cs-parser.jay: Catch another parsing form for arglist being
9045 followed by other arguments. Fixes #78313.
9047 2006-05-24 Raja R Harinath <rharinath@novell.com>
9049 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
9050 checking of out parameters to ...
9051 (FlowBranchingToplevel.Merge): ... here.
9052 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
9053 set, propagate the origin upward, and only complain if there was
9055 (FlowBranchingException.AddContinueOrigin): Likewise.
9056 (FlowBranchingException.AddReturnOrigin): Likewise.
9057 (FlowBranchingException.AddGotoOrigin): Likewise.
9059 2006-05-23 Raja R Harinath <rharinath@novell.com>
9061 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
9062 unreachable, skip it.
9063 (FlowBranchingException.Merge): Always propagate jumps, even if
9064 the finally block renders subsequent code unreachable.
9066 2006-05-18 Raja R Harinath <rharinath@novell.com>
9069 * statement.cs (Goto.Resolve): Move responsibility for resolving
9070 'goto' to FlowBranching.AddGotoOrigin.
9071 (Goto.SetResolvedTarget): New. Callback to set the
9072 LabeledStatement that's the target of the goto.
9073 (Goto.DoEmit): Use Leave instead of Br when crossing an
9074 unwind-protect boundary.
9075 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
9076 LookupLabel and adjust to new semantics.
9077 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
9078 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
9079 Goto.SetResolvedTarget to update target.
9080 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
9081 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
9082 AddBreakOrigin & co. Delay propagation until ...
9083 (FlowBranchingException.Merge): ... this.
9085 * statement.cs (Block.Resolve): Always depend on flow-branching to
9086 determine unreachability. Kill workaround that originally emitted
9087 only one statement after an "unreachable" label (see infloop in
9090 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
9091 This is still "wrong", but anything better would probably need a
9092 multi-pass algorithm.
9093 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
9094 usage vector. Force current usage vector to be reachable, to
9095 optimistically signify backward jumps.
9096 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
9098 (FlowBranchingLabeled.Merge): New. If no backward jump was
9099 detected, return the original salted-away usage vector instead,
9100 updated with appropriate changes. Print unreachable warning if
9102 * statement.cs (Block.Resolve): Don't print unreachable warning on
9103 a labeled statement.
9105 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
9107 * driver.cs: Pass filename without path to AssemblyBuilder's
9108 AddResourceFile. Fixes bug #78407.
9110 2006-05-17 Raja R Harinath <rharinath@novell.com>
9112 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
9113 * flowanalysis.cs (FlowBranchingLabeled): ... here.
9114 (FlowBranching.MergeChild): Overwrite
9115 reachability information from Labeled branchings too.
9117 2006-05-16 Raja R Harinath <rharinath@novell.com>
9119 * statement.cs (Goto.Resolve): Merge jump origins here ...
9120 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
9122 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
9123 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
9124 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
9125 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
9127 * statement.cs (Goto.Resolve): ... not here.
9128 (Goto.Emit): Remove CS1632 check.
9130 2006-05-14 Marek Safar <marek.safar@seznam.cz>
9132 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
9135 2006-05-11 Raja R Harinath <rharinath@novell.com>
9137 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
9138 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
9139 (FlowBranchingException.Label): Likewise.
9141 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
9143 (MyBitVector.Or): Use it to avoid losing information (Count).
9144 (FlowBranching.MergeOrigins): Likewise.
9146 * flowanalysis.cs (UsageVector.IsDirty): Remove.
9147 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
9148 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
9149 (UsageVector.ToString): Simplify.
9150 (UsageVector.MergeSiblings): Move here from ...
9151 (FlowBranching.Merge): ... here.
9152 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
9155 2006-05-10 Raja R Harinath <rharinath@novell.com>
9157 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
9158 null bitvector is treated as all-true.
9160 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
9161 (MyBitVector): Rationalize invariants. 'vector != null' implies
9162 that we have our own copy of the bitvector. Otherwise,
9163 'InheritsFrom == null' implies all inherited bits are true.
9165 2006-05-09 Marek Safar <marek.safar@seznam.cz>
9167 * statement.cs (LocalInfo): Add IsConstant.
9168 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
9169 local variable for constants.
9171 2006-05-09 Raja R Harinath <rharinath@novell.com>
9173 * flowanalysis.cs (MyBitVector.Empty): New.
9174 (MyBitVector): Don't allow InheritedFrom to be null.
9175 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
9176 (UsageVector, FlowBranching): Update to changes.
9178 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
9179 recursion. The 'Parent == null' condition isn't sufficient for
9181 (FlowBranching.AddBreakOrigin): Likewise.
9182 (FlowBranching.AddContinueOrigin): Likewise.
9183 (FlowBranching.AddReturnOrigin): Likewise.
9184 (FlowBranching.StealFinallyClauses): Likewise.
9185 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
9186 (FlowBranching.CheckOutParameters): Likewise.
9187 (FlowBranchingToplevel): Terminate all the above recursions here.
9188 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
9189 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
9191 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
9193 (FlowBranchingToplevel): New. Empty for now.
9194 (FlowBranching.MergeTopBlock): Update.
9195 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
9196 branching for the anonymous delegate.
9197 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
9199 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
9200 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
9201 information at the start of the merge. Reorganize.
9203 2006-05-07 Marek Safar <marek.safar@seznam.cz>
9205 * class.cs (MethodData.Define): Method cannot implement interface accessor.
9207 2006-05-07 Marek Safar <marek.safar@seznam.cz>
9209 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
9210 to newly introduced ctor.
9212 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
9213 message to one place.
9214 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
9217 2006-05-07 Marek Safar <marek.safar@seznam.cz>
9219 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
9221 * ecore.cs (Expression.ResolveAsConstant): Updated.
9223 * statement.cs (ResolveMeta): Updated.
9225 2006-05-06 Marek Safar <marek.safar@seznam.cz>
9227 * cs-parser.jay: __arglist cannot be used in initializer.
9229 2006-05-06 Marek Safar <marek.safar@seznam.cz>
9232 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
9235 2006-05-05 Raja R Harinath <rharinath@novell.com>
9237 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
9238 (LabeledStatement): Add 'name' parameter.
9239 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
9240 (Block.AddLabel): Update to changes.
9241 * cs-parser.jay (labeled_statement): Likewise.
9243 * flowanalysis.cs (BranchingType.Labeled): New.
9244 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
9245 (FlowBranchingLabeled): New. Does nothing for now, but will
9246 eventually handle 'goto' flows.
9247 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
9248 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
9249 that's terminated ...
9250 (Block.Resolve): ... here.
9252 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
9253 (UsageVector.MergeFinallyOrigins): Likewise.
9254 (FlowBranching.InTryOrCatch): Likewise.
9255 (FlowBranching.AddFinallyVector): Likewise.
9256 (FlowBranchingException): Update to changes.
9259 * statement.cs (Return.Resolve): Move error checking to ...
9260 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
9261 (FlowBranchingException): Handle return origins like break and
9263 (FlowBranching.UsageVector.CheckOutParameters): Remove.
9265 2006-05-04 Marek Safar <marek.safar@seznam.cz>
9268 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
9271 2006-05-04 Marek Safar <marek.safar@seznam.cz>
9274 * class.cs (MethodData.Define): Do public accessor check only when method
9275 implements an interface.
9277 2006-05-04 Raja R Harinath <rharinath@novell.com>
9279 Remove special handling of 'break'
9280 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
9281 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
9282 (UsageVector.Break): Remove.
9283 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
9285 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
9287 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
9288 UsageVector.Breaks (). Don't set NeedsReturnLabel.
9290 2006-05-03 Marek Safar <marek.safar@seznam.cz>
9293 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
9294 be the interface member.
9296 2006-05-03 Marek Safar <marek.safar@seznam.cz>
9299 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
9300 for emitting small (int) values.
9302 2006-05-03 Raja R Harinath <rharinath@novell.com>
9305 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
9306 control-flow passes through the 'finally' after merging-in all the
9307 control-flows from 'try' and the 'catch' clauses.
9309 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
9310 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
9311 always true at the only non-recursive entry point.
9312 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
9313 FlowBranchingBreakable.
9314 (FlowBranchingLoop): Remove.
9315 * statement.cs (Return.DoResolve): Update to changes.
9318 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
9319 (FlowBranching.CreateBranching): Handle it: create a
9320 FlowBranchingContinuable.
9321 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
9322 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
9323 except that it handles the 'continue' command.
9324 (FlowBranching.UsageVector.MergeOrigins): Rename from
9326 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
9327 except that it overrides AddContinueOrigin.
9328 (FlowBranchingException): Override AddContinueOrigin, similar to
9330 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
9331 Create a new branching around the embedded statement.
9332 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
9333 control flow after the embedded statement.
9334 (Continue.Resolve): Move all error checking to AddContinueOrigin.
9336 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
9337 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
9338 FlowBranchingBreakable.
9339 (FlowBranchingSwitch): Remove.
9342 * statement.cs (Break.Resolve): Simplify. Move responsibility for
9343 error reporting to ...
9344 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
9345 Rename from 'AddBreakVector'. Add new location argument. Return
9346 a bool indicating whether the 'break' crosses an unwind-protect.
9347 (FlowBranchingException.AddBreakOrigin): Add.
9348 (FlowBranchingException.Merge): Propagate 'break's to surrounding
9349 flowbranching after updating with the effects of the 'finally'
9351 (FlowBranchingBreakable): New common base class for
9352 FlowBranchingLoop and FlowBranchingSwitch.
9354 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
9356 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
9358 2006-05-02 Raja R Harinath <rharinath@novell.com>
9360 * statement.cs (Do.Resolve): If the loop is infinite, set the
9362 (While.Resolve, For.Resolve): Set a barrier after the embedded
9363 statement. There's no direct control flow that goes from the end
9364 of the embedded statement to the end of the loop.
9365 * flowanalysis.cs (FlowBranching.Infinite): Remove.
9366 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
9367 above ensure that the reachability is correctly computed.
9369 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
9370 (UsageVector.MergeBreakOrigins): If the current path is
9371 unreachable, treat it as if all parameters/locals are initialized.
9372 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
9373 infinite loops before merging-in break origins.
9375 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
9376 (Reachability.Reachable): Split part into ...
9377 (Reachability.Unreachable): ... this. Simplify.
9378 (Reachability.IsUnreachable): Use 'Unreachable' instead.
9380 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
9381 (Reachability.SetThrowsSometimes): Likewise.
9382 (FlowBranchingBlock.MergeTopBlock): Don't compare against
9383 TriState.Always, use corresponding property.
9384 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
9385 (Block.Resolve): Likewise. Remove some redundant checks.
9387 2006-05-02 Raja R Harinath <harinath@gmail.com>
9389 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
9390 (Reachability.Meet): Don't bother checking AlwaysThrows --
9391 barrier is always set.
9392 (FlowBranchingBlock.Merge): Likewise.
9394 2006-05-01 Raja R Harinath <harinath@gmail.com>
9396 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9397 checks for unreachable.
9399 2006-05-01 Marek Safar <marek.safar@seznam.cz>
9402 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9404 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9405 whether field is really assigned.
9407 2006-04-30 Raja R Harinath <harinath@gmail.com>
9409 * flowanalysis.cs (Reachability): Make 4-argument constructor
9411 (Reachability.Meet): Rename from 'And'. Remove static variant.
9412 (Reachability.Always): Rename from the highly misleading
9413 'Reachability.Never'.
9414 (FlowBranching.Merge): Update to changes. Mark an impossible
9415 situation with a 'throw'.
9416 (*): Update to changes.
9418 2006-04-29 Raja R Harinath <harinath@gmail.com>
9420 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9422 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9423 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9424 (*): Update to changes.
9425 * statement.cs: Update to changes.
9427 2006-04-28 Marek Safar <marek.safar@seznam.cz>
9430 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9432 2006-04-28 Raja R Harinath <harinath@gmail.com>
9434 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9437 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9438 argument to two arguments: an usage-vector and a bool. Move call
9439 to FlowBranching.Merge () ...
9440 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9442 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9443 handling of loop and switch reachability to ...
9444 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9446 2006-04-27 Raja R Harinath <harinath@gmail.com>
9448 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9449 handling to FlowBranchingLoop.InLoop.
9450 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9452 2006-04-26 Marek Safar <marek.safar@seznam.cz>
9455 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9456 anonymous method is allowed from AnonymousContainer here.
9458 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9460 2006-04-24 Raja R Harinath <rharinath@novell.com>
9463 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9465 2006-04-23 Marek Safar <marek.safar@seznam.cz>
9468 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9469 (DoubleConstant.Reduce): Ditto.
9471 2006-04-23 Raja R Harinath <rharinath@novell.com>
9473 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9474 Remove 'lvalue_right_side' argument. Move parts to ...
9475 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9476 (LocalVariable.DoResolveLValue): ... these.
9478 2006-04-21 Raja R Harinath <rharinath@novell.com>
9481 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9482 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9483 (LocalVariableReference.DoResolveBase): Use it to implement new
9485 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9486 (Argument.Resolve): Simplify. Move CS1510 check ...
9487 * ecore.cs (Expression.ResolveLValue): ... here.
9488 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9489 (PropertyExpr.DoResolveLValue): Likewise.
9490 (FieldExpr.Report_AssignToReadonly): Likewise.
9491 (FieldExpr.DoResolve): Add 'out_access' argument. Use
9492 LValueMemberAccess or LValueMemberOutAccess on instance depending
9494 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9495 DoResolve as appropriate.
9497 2006-04-20 Raja R Harinath <rharinath@novell.com>
9500 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9501 implicit conversions on 'out' and 'ref' arguments.
9503 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9504 improve clarity. Remove dead code.
9507 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9508 (Catch.Resolve): Resolve VarBlock if it exists.
9510 2006-04-19 Miguel de Icaza <miguel@novell.com>
9512 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9513 twice, this was some residual code, the enumerator was emitted
9514 properly in the two branche of if later.
9516 2006-04-19 Raja R Harinath <rharinath@novell.com>
9518 * expression.cs (Cast.ResolveLValue): Remove. The result of a
9519 cast is never an lvalue.
9520 (Cast.DoResolve, Cast.ResolveRest): Combine.
9521 (Argument.Emit): Simplify slightly. Move 'Expr is
9522 IMemoryLocation' check ...
9523 (Argument.Resolve): ... here.
9524 (Argument.Error_LValueRequired): Remove. Inline into only user.
9526 Simplifications. Fix cs0191-2.cs
9527 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9528 CS1649 and CS1651 to ...
9529 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
9530 the actual selection of the error code and message to a lookup
9531 table. Add a dummy return value to simplify callsites.
9532 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9533 readonly fields of other instances of the same type. Move CS0197
9535 * expression.cs (Argument.Resolve): ... here. Simplify code.
9536 Ensure that ec.InRefOutArgumentResolving is only set during LValue
9537 resolution of an out or ref argument. The code simplification
9538 above uses this invariant.
9540 2006-04-18 Raja R Harinath <rharinath@novell.com>
9542 Possibly fix #77752. Fix cs1690-[4-7].cs.
9543 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9544 CheckMarshallByRefAccess. Drop parameter.
9545 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
9547 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9549 * report.cs (AllWarnings): Add CS1690.
9550 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9552 (LocalVariableReference.DoResolveBase): Update.
9554 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9556 * class.cs (MethodOrOperator): Moved common parts from method class.
9557 detect obsolete attributes.
9558 (Method.Define): Simplified as it reuses code from base.
9559 (Constructor.ValidAttributeTargets): Fixed issue found during
9561 (Destructor.ValidAttributeTargets): Fixed issue found during
9563 (Operator): Finished refactoring set off by #78020. Operator class is now
9564 ordinary method class.
9566 * anonymous.cs: Updated.
9568 * decl.cs (DeclSpace): Add IsGeneric
9570 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9572 * class.cs (Constructor.Emit): Don't emit the attributes twice.
9574 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9576 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9577 detect obsolete attributes.
9578 (Method.CreateEmitContext): Moved to MethodOrOperator.
9580 2006-04-09 Marek Safar <marek.safar@seznam.cz>
9583 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9584 customized exception to make crash detection easier.
9585 (MethodOrOperator): Started to work on new base class for methods and
9587 (Method): Derives from MethodOrOperator.
9588 (Constructor.Emit): Emits its own attributes.
9589 (AbstractPropertyEventMethod.Emit): Ditto.
9590 (Operator): Derives from MethodOrOperator, will refactor fully in extra
9592 (Operator.Emit): It's temporary more tricky than should be.
9594 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9596 * report.cs (InternalErrorException): Add ctor with inner exception.
9598 2006-04-08 Marek Safar <marek.safar@seznam.cz>
9601 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9604 2006-04-07 Marek Safar <marek.safar@seznam.cz>
9607 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9610 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9612 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9613 attribute is present and Guid not.
9614 (Interface.ApplyAttributeBuilder): Ditto.
9616 * attribute.cs: Add error message.
9618 2006-04-06 Marek Safar <marek.safar@seznam.cz>
9622 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9623 sources (it's composite) so hold them in extra array as they are used in
9624 Emit phase only. It worked in the previous versions by mistake.
9625 (Attribute.Emit): Emit attribute for more owners when exist.
9627 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9628 it has now different behaviour.
9630 2006-04-04 Marek Safar <marek.safar@seznam.cz>
9632 * constant.cs (Constant.IsDefaultInitializer): New method.
9634 * class.cs: Updated.
9636 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9637 re-initialize default values. It saves KBs almost for every assembly.
9638 Thanks Zoltan for the idea.
9639 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9640 (ArrayCreation.DoResolve): Resolve only once.
9641 (ArrayCreation.Emit): Emit static initializer only when it is faster.
9642 (ArrayCreation.GetAttributableValue): Cope with optimized values.
9644 2006-04-03 Zoltan Varga <vargaz@gmail.com>
9646 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9649 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9651 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9652 in an embedded statement too.
9654 2006-04-01 Raja R Harinath <rharinath@novell.com>
9657 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9659 2006-04-01 Marek Safar <marek.safar@seznam.cz>
9663 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9666 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9668 2006-03-31 Marek Safar <marek.safar@seznam.cz>
9670 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9673 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9674 LocalTemporary change.
9676 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9678 (ClassOrStruct.DefineFieldInitializers): Implemented static field
9679 initializers optimization.
9680 (ClassOrStruct.TypeAttr): Moved from modifiers.
9681 (Constructor.CheckBase): Don't crash when static ctor has parameters.
9682 (FieldBase.ResolveInitializer): Resolves initializer.
9683 (FieldBase.HasDefaultInitializer): New property.
9685 * cs-parser.jay: Removed message.
9687 * expression.cs (CompilerGeneratedThis): New specialization.
9689 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9691 2006-03-28 Marek Safar <marek.safar@seznam.cz>
9693 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9695 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9697 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9698 be now EnumConstants only.
9700 2006-03-27 Marek Safar <marek.safar@seznam.cz>
9702 * attribute.cs, driver.cs: Reset more caches.
9704 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9706 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9708 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9710 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9711 for easier reuse. Updated all overrides.
9712 (IntegralConstant): New base class for all integral constants.
9713 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9714 of the constant range, report custom error.
9715 (UIntConstant.Reduce): Fixed uint conversion.
9717 * ecore.cs, literal.cs: Reduce updates.
9719 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9723 * class.cs (Constructor.Define): Removed extra if for default ctors.
9724 A patch from Atsushi Enomoto.
9726 2006-03-26 Marek Safar <marek.safar@seznam.cz>
9728 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9729 GetAttributableValue.
9731 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9734 * convert.cs (ImplicitConversionRequired): Error message moved to
9737 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9738 automatic implicit conversion of an output value.
9739 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9741 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9743 (TypeOf.GetAttributableValue): Add extra handling for object type.
9745 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9746 special error message.
9748 2006-03-25 Marek Safar <marek.safar@seznam.cz>
9750 * class.cs (Constructor.Emit): Don't crash when struct ctor is
9752 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9753 compatible with MS runtime.
9755 2006-03-23 Marek Safar <marek.safar@seznam.cz>
9757 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9758 attribute arguments here.
9760 * class.cs (Indexer.Define): The check was moved to attribute class.
9762 2006-03-22 Marek Safar <marek.safar@seznam.cz>
9764 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9765 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9768 2006-03-22 Raja R Harinath <rharinath@novell.com>
9770 Support ParameterDefaultValueAttribute in gmcs. Also applied to
9771 mcs to keep code differences small.
9772 * attribute.cs (Attribute.GetParameterDefaultValue): New.
9773 * typemanager.cs (parameter_default_value_attribute_type): New.
9774 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
9777 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9779 * expression.cs (StringConcat.Append): Reverted back to no warning state.
9781 2006-03-21 Marek Safar <marek.safar@seznam.cz>
9783 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9785 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9788 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
9790 * doc-bootstrap.cs : fix build.
9792 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9794 * expression.cs (StringConcat.Append): Issue a warning when empty string
9797 2006-03-20 Marek Safar <marek.safar@seznam.cz>
9799 * assign.cs (CompoundAssign.ResolveSource): Removed.
9801 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9804 * class.cs (TypeContainer.FindMethods): Removed.
9805 (TypeContainer.CheckMemberUsage): Made static.
9807 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9809 * constant.cs (CheckRange): Removed unused type argument.
9810 (CheckUnsigned): Removed unused type argument.
9812 * cs-parser.jay: Updated after MemberAccess clean up.
9813 Uses Length for empty string test.
9815 * cs-tokenizer.cs: Uses Length for empty string test.
9816 (IsCastToken): Made static.
9817 (is_hex): Made static.
9818 (real_type_suffix): Made static.
9820 * decl.cs (SetupCache): Made static.
9821 (OnGenerateDocComment): Removed unused ds argument.
9823 * delegate.cs (VerifyDelegate): Removed unused argument.
9825 * doc.cs: Uses Length for empty string test.
9827 * driver.cs: Uses Length for empty string test.
9829 * enum.cs (IsValidEnumType): Made static
9831 * expression.cs (EnumLiftUp): Removed unused argument.
9832 (ResolveMethodGroup): Ditto.
9833 (BetterConversion): Ditto.
9834 (GetVarargsTypes): Ditto.
9835 (UpdateIndices): Ditto.
9836 (ValidateInitializers): Ditto.
9837 (MemberAccess.ctor): Ditto.
9838 (GetIndexersForType): Ditto.
9840 * flowanalysis.cs: (MergeFinally): Removed unused argument.
9842 * iterators.cs: Updated after MemberAccess clean up.
9844 * location.cs: Uses Length for empty string test.
9846 * namespace.cs: Uses Length for empty string test.
9848 * report.cs (CheckWarningCode): Made static.
9850 * statement.cs (LabeledStatement): Removed unused argument.
9852 * typemanager.cs (FilterNone): Removed.
9854 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9856 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9859 * class.cs: Updated.
9861 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9863 * cs-parser.jay.cs: __arglist is not allowed for delegates.
9865 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9869 * expression.cs (VerifyArgumentsCompat): Reverted to double error
9870 reporting, it's more tricky than I thought.
9872 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9876 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
9878 (AnonymousMethod.ImplicitStandardConversionExists): New method.
9879 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9880 Add more error reporting; Fixed issue with params.
9882 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9884 * cs-parser.jay: AnonymousMethod requires host container.
9886 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9888 2006-03-18 Raja R Harinath <harinath@gmail.com>
9890 * class.cs: Change 'TypeContainer ds' constructor argument to
9891 'DeclSpace parent'. Some classes were missed below due to
9892 different naming convention.
9894 * class.cs (MemberCore.Parent): Delete. This makes the
9895 ParentContainer changes below enforceable by the compiler.
9897 Treat pointers to enclosing declaration space as 'DeclSpace', not
9899 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9900 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9902 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9904 (Block.AddThisVariable): Likewise.
9905 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9906 (AbstractPropertyEventMethod.Emit): Likewise.
9907 (AbstractPropertyEventMethod.EmitMethod): Likewise.
9908 (GetMethod.Define, SetMethod.Define): Likewise.
9909 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9910 (DelegateMethod.EmitMethod): Likewise.
9912 Fix regression test-partial-13.cs.
9913 Rationalize use of PartialContainer. Ensure that the partial
9914 class semantics can be tied to type-correctness, i.e., any
9915 violation will cause a compile error.
9916 * class.cs, const.cs: Access all fields that belong to class
9917 TypeContainer via ParentContainer. Arguments of EmitContexts and
9918 Resolve()-like functions still use 'Parent'.
9920 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9921 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9922 (PropertyMethod.CheckModifiers): Remove unused argument.
9923 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9926 2006-03-17 Raja R Harinath <harinath@gmail.com>
9928 Make semantics of PartialContainer simpler.
9929 * decl.cs (DeclSpace.IsPartial): Remove.
9930 * class.cs (TypeContainer.IsPartial): Likewise.
9931 (TypeContainer..ctor): Set PartialContainer to point to self.
9932 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9933 (TypeContainer.FindNestedType): Likewise.
9934 (MemberCore.ParentContainer): Simplify. Remove deprecation.
9936 2006-03-17 Marek Safar <marek.safar@seznam.cz>
9938 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9940 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9942 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9945 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9947 * class.cs (Operator.Define): An error for base conversion was not
9950 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
9952 * iterator.cs : yield break is allowed in try statement which has
9953 catch clauses. Fixed bug #77767.
9955 2006-03-13 Marek Safar <marek.safar@seznam.cz>
9957 A fix for #77593, #77574.
9959 * class.cs (MethodCore.CheckBase): Another if for operator.
9961 2006-03-09 Marek Safar <marek.safar@seznam.cz>
9963 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9966 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9967 (DelegateCreation.ImplicitStandardConversionExists): New method for just
9970 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9973 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9974 Updated after another emitcontext usage was clean up. It should help us to
9975 synchronize with gmcs easier.
9977 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9981 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9982 (Event.Define): ditto
9983 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9985 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9986 Removed redundant code and set NewSlot for Invoke method too.
9988 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9989 (Parameters.MergeGenerated): New method. Use this method when you merge
9990 compiler generated argument with user arguments.
9992 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9994 * attribute.cs (ResolveAsTypeTerminal): Removed.
9996 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9997 specialization for predefined types; 30% speed up.
9998 Finally placed obsolete check to right place.
9999 (Expression.ResolveType): Removed.
10001 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
10002 Updated after ResolveType was removed.
10004 * expression.cs (Cast.ctor): Check void cast.
10005 (Binary.ResolveAsTypeTerminal): Is never type.
10006 (Conditional.ResolveAsTypeTerminal): Is never type.
10008 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
10010 2006-03-01 Raja R Harinath <rharinath@novell.com>
10013 * expression.cs (ParameterReference.DoResolveBase): Change return
10015 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
10019 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
10022 * typemanager.cs (GetFullNameSignature): Don't nullref on
10023 protected accessors.
10025 2006-02-27 Marek Safar <marek.safar@seznam.cz>
10027 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
10028 these two separated members to simplify the code.
10029 (Attribute.Resolve): Refactored to use new fields and methods.
10030 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
10031 implemented obsolete attribute checking.
10032 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
10033 implemented obsolete checking again. It look line never ending quest ;-)
10034 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
10036 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
10038 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
10040 *class.cs (Property.Define): Add RegisterProperty call.
10042 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
10043 argument groups (only 2).
10045 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
10046 encoding expression to arguments.
10047 (Expression.ExprClassToResolveFlags): Just turned to property.
10049 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
10050 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
10051 optimized as well as implemented support for zero-length attributes.
10053 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
10054 Add caching of PropertyInfo's.
10056 2006-02-25 Marek Safar <marek.safar@seznam.cz>
10058 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
10059 error multiple times.
10061 2006-02-25 Marek Safar <marek.safar@seznam.cz>
10063 New partial class implementation.
10064 A fix for #77027, #77029, #77403
10066 * attribute.cs (Attributable): Made attributes protected.
10068 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
10069 the replacements of ClassPart and PartialContainer.
10070 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
10071 (TypeContainer.AddInterface): Ditto.
10072 (TypeContainer.AddPartial): The main method for partial classes. It checks
10073 for errors and merges ModFlags and attributes. At the end class is added to
10074 partial_parts list.
10075 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
10077 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
10078 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
10079 from the rest of partial classes.
10080 (TypeContainer.GetClassBases): Simplified.
10081 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
10083 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
10084 (TypeContainer.HasExplicitLayout): Uses Flags now.
10085 (PartialContainer): Removed.
10086 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
10087 (StaticClass): Was merged with Class.
10088 (Class.GetClassBases): class and static class bases are verified here.
10089 (Class.TypeAttr): Added static attributes when class is static.
10090 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
10091 (MemberBase): In some cases we need to call parent container for partial
10092 class. It should be eliminated but it's not easy now.
10094 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
10096 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
10097 partial classed to accumulate class comments.
10098 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
10100 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
10102 * driver.cs (MainDriver): Tree.GetDecl was removed.
10104 * modifiers.cs (Modifiers): Add partial modifier.
10106 * tree.cs (Tree.decl): Removed.
10107 (RootTypes): Started to use this class more often for root types
10110 2006-02-22 Marek Safar <marek.safar@seznam.cz>
10114 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
10115 external interface does not have an attribute.
10117 2006-02-22 Marek Safar <marek.safar@seznam.cz>
10119 Another prerequisites for new partial classs implementation.
10121 * attribute.cs (Attribute.Equal): Implemented.
10122 (Attribute.Emit): Changed as attributes can be applied more than twice.
10123 (Attributes.Emit): Check for duplicate attributes here.
10125 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
10126 as a parameter, clean-up.
10128 2006-02-11 Marek Safar <marek.safar@seznam.cz>
10132 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
10133 contains obsolete attribute check which can in some cases look for base
10134 type of current class which is not initialized yet.
10135 (TypeContainer.BaseType): Replacement of ptype.
10137 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
10139 2006-02-11 Marek Safar <marek.safar@seznam.cz>
10141 First of prerequisites for new partial classs implemention.
10143 * attribute.cs (Attributable): Extended by ResolveContext;
10144 Attributes finally have correct context for resolving in all cases.
10145 (AttachTo): Attribute owner is assigned here.
10147 * codegen.cs (IResolveContext): Introduce new interface to hold
10148 all information needed in resolving phase.
10149 (EmitContext): Implements IResolveContext; more clean-up needed here.
10151 * decl.cs (MemberCore): Implemented IResolveContext.
10153 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
10154 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
10155 parameter.cs, statement.cs, tree.cs, typemanager.cs:
10156 Refactored to use new IResolveContext instead of EmitContext; cleanup
10158 2006-02-06 Miguel de Icaza <miguel@novell.com>
10160 * codegen.cs (EmitScopeInitFromBlock): check here the
10161 capture_context, there is no need to make two calls to the
10164 * anonymous.cs: Add some debugging messages that might help me
10165 track other instances of this problem in the future (the
10166 regression of test 467).
10168 * cs-parser.jay: track the variable block, as we need to initalize
10169 any captured variables declared in this block for the "catch"
10170 portion of the "Try" statement.
10172 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
10173 scope initialization for captured variables.
10175 Also, move the emit for the variables after the block location has
10178 2006-02-06 Marek Safar <marek.safar@seznam.cz>
10180 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
10182 2006-02-02 Miguel de Icaza <miguel@novell.com>
10184 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
10185 commit yesterday, the initialization for the roots is necessary.
10186 What is not necessary is the scope activation.
10188 2006-02-02 Raja R Harinath <rharinath@novell.com>
10190 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
10191 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
10193 (Argument.Resolve): Remove CS0206 checks.
10195 2006-02-01 Miguel de Icaza <miguel@novell.com>
10197 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
10198 scopes for all the roots, the scopes will now be emitted when the
10199 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
10201 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
10202 code. This reduces a lot of existing cruft.
10204 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
10205 that the ScopeInfo is generated as we enter the scope, not at the
10206 time of use, which is what we used to do before.
10208 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
10209 every time a Block is about to be emitted if we have a
10212 2006-02-01 Raja R Harinath <rharinath@novell.com>
10214 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
10216 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
10218 * typemanager.cs (cons_param_array_attribute): Make private.
10219 (Reset): Set it to null.
10220 (InitCoreHelpers): Don't initialize it.
10221 (ConsParamArrayAttribute): New. Initialize it as needed.
10222 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
10224 2006-01-31 Miguel de Icaza <miguel@novell.com>
10226 * expression.cs: There might be errors reported during the
10227 selection of applicable methods. If there are errors, do not
10228 continue execution as it will lead the compiler to crash.
10230 2006-01-30 Miguel de Icaza <miguel@novell.com>
10232 * expression.cs: Member access is not allowed on anonymous
10233 methods. Fixes #77402.
10235 2006-01-30 Raja R Harinath <rharinath@novell.com>
10238 * cs-parser.jay (VariableDeclaration): Don't set
10239 current_array_type to null.
10240 (field_declaration, event_declaration, declaration_statement):
10241 Set it to null here.
10243 2006-01-28 Raja R Harinath <harinath@gmail.com>
10245 * typemanager.cs (GenericParameterPosition): New.
10248 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
10250 * doc.cs : To process "include" elements, first we should create
10251 another list than XmlNodeList, because it could result in node
10252 removal, which could result in that the XmlNodeList gives up
10253 yielding next node.
10255 (Also made code identical to gmcs again.)
10257 2006-01-25 Miguel de Icaza <miguel@novell.com>
10259 * ecore.cs: Introduce an error report that we were not catching
10260 before, if not silent, we must report the error. Gonzalo ran into
10263 2006-01-23 Miguel de Icaza <miguel@novell.com>
10265 A fix for bug: #76957
10267 * iterators.cs (MoveNextMethod.CreateMethodHost): call
10268 ComputeMethodHost before creating the method, this is a new
10271 * anonymous.cs (AnonymousContainer): Now we track all the scopes
10272 that this method references (RegisterScope). The actual scope
10273 where the method is hosted is computed with the ComputeMethodHost
10274 before we create the method.
10276 Moved the Deepest routine here.
10278 (AnonymousContainer.ComputeMethodHost): New routine used to
10279 compute the proper ScopeInfo that will host the anonymous method.
10281 (ScopeInfo): Deal with multiple roots. The problem was that we
10282 did not have a unique root where all ScopeInfos could be hanged
10283 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
10286 Remove AdjustMethodScope which is now computed at the end. Remove
10287 LinkScope which did a partial link, instead link all ScopeInfos
10288 before code generation from the new "LinkScopes" routine.
10290 Simplify all the Add* routines as they no longer need to maintain
10291 the tree, they just need to record that they are using variables
10294 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
10295 routines to produce the forest of ScopeInfo trees.
10297 * class.cs (TypeContainer.AppendMethod): This is just like
10298 AddMethod, but ensures that an interface implementation method
10299 (IEnumerable.XXX) is not inserted at the beginning of the queue of
10300 methods, but at the end.
10302 We use this functionality to ensure that the generated MoveNext
10303 method in the iterator class is resolved/emitted before the
10304 enumerator methods created.
10306 This is required because the MoveNext method computes the right
10307 ScopeInfo for the method. And the other methods will eventually
10308 need to resolve and fetch information computed from the anonymous
10311 2006-01-21 Raja R Harinath <harinath@gmail.com>
10312 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10314 Fix rest of #76995.
10315 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
10316 the 'aliases' hash.
10317 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
10318 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
10320 2006-01-18 Raja R Harinath <rharinath@novell.com>
10322 Fix #76656, cs0231-2.cs.
10323 * cs-parser.jay (formal_parameter_list): Make error case catch
10325 (parenthesized_expression_0): Add CS1026 check.
10326 (invocation_expression): Remove unused { $$ = lexer.Location }.
10328 2006-01-17 Raja R Harinath <rharinath@novell.com>
10331 * cs-parser.jay (statement_expression): Don't list out the
10332 individual statement-expressions. Convert syntax error into
10335 2006-01-16 Raja R Harinath <rharinath@novell.com>
10338 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
10339 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
10340 CheckIntermediateModification.
10341 (FieldExpr.DoResolve): Add new two-argument version that
10342 allows us to resolve the InstanceExpression as an lvalue.
10343 The one-argument variant is now just a wrapper.
10344 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
10345 Resolve the lhs as an lvalue if the it has a value type.
10346 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
10347 from Assign.DoResolve.
10348 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
10349 resolved as an lvalue.
10350 (PropertyExpr.DoResolve): Update.
10351 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
10352 has a value type. Move CS1612 check here from
10353 CheckIntermediateModification.
10354 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
10355 * expression.cs (EmptyExpression.OutAccess): New. Used as the
10356 'right_side' of a ResolveLValue on an 'out' argument.
10357 (EmptyExpression.LValueMemberAccess): New. Used as the
10358 'right_side' of a propagated ResolveLValue on a value type.
10359 (LocalVariableReference.DoResolveBase): Recognize
10360 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
10362 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
10363 EmptyExpression.Null.
10365 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
10367 * typemanager.cs : added IsGenericParameter(). In mcs it always
10369 * doc.cs : for generic parameters, use GenericParameterPosition,
10372 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
10374 * expression.cs: Fix Console.WriteLine ((this = x).foo);
10376 2006-01-12 Miguel de Icaza <miguel@novell.com>
10378 This fixes the problem where we used ldfld instead of ldflda to
10379 load the "THIS" pointer on captured parameters, when THIS is a
10380 value type. See bug #77205.
10382 * iterators.cs (CapturedThisReference.Emit): Pass false to
10383 EmitThis (we do not need the address).
10385 * codegen.cs (EmitThis): it needs to know whether we need the
10386 address of `this' or not. This is used by value types.
10388 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
10389 every other call passes false.
10391 2006-01-12 Raja R Harinath <rharinath@novell.com>
10394 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
10396 * expression.cs (Invocation.OverloadResolve): Update.
10397 (Invocation.DoResolve): Avoid double resolution of invocation.
10399 2006-01-11 Raja R Harinath <rharinath@novell.com>
10402 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10403 unary negation of floating point types as 0-expr; negation cannot
10404 overflow in floating point types.
10407 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10408 on operands of 'void' type.
10411 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10412 and ExclusiveOr for boolean constants too.
10414 2006-01-09 Raja R Harinath <rharinath@novell.com>
10417 * expression.cs (Invocation.OverloadResolve): Replace reflected
10418 override methods with their base virtual methods, rather than
10419 skipping over them.
10420 * typemanager.cs (TypeManager.GetOverride): New.
10422 2006-01-05 Jb Evain <jbevain@gmail.com>
10424 * class.cs (Property.Define, Indexer.Define): do not tag the
10425 properties as SpecialName | RTSpecialName.
10427 2006-01-04 Miguel de Icaza <miguel@novell.com>
10429 * class.cs (MethodCore.IsDuplicateImplementation): This method was
10430 doing a low-level comparission of parameter types. It was lacking
10431 a check for __argslist.
10433 2005-12-30 Miguel de Icaza <miguel@novell.com>
10435 * expression.cs (ParameterReference.DoResolveBase): Allow
10436 reference parameters if they are local to this block.
10438 This allows the ref and out parameters of a delegate to be used in
10439 an anonymous method, for example:
10441 delegate void set (out int x);
10443 set s = delegate (out int x){
10447 This is used by functionality introduced late in the C# language.
10449 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10450 method that take ref and out parameters.
10452 Fixes #77119 which was a late change in the spec.
10454 2005-12-23 Miguel de Icaza <miguel@novell.com>
10456 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10457 parent if its the same scope. Fixes #77060.
10459 2005-12-21 Miguel de Icaza <miguel@novell.com>
10461 * driver.cs: Report the case of no source files and no -out:
10464 2005-12-20 Raja R Harinath <rharinath@novell.com>
10467 * expression.cs (ComposedCast.GetSignatureForError): Define.
10469 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10473 * namespace.cs (NamespaceEntry): Add extern_aliases as a
10474 ListDictionary, to contain the ExternAliasEntry entries (in
10475 addition to the NamespaceEntry.aliases hashtable). This field is
10476 shared between the original entry and its doppelganger (bodyless
10478 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10479 extern_aliases field.
10480 (NamespaceEntry.Lookup): Move the IsImplicit check after the
10481 lookup in extern_aliases.
10483 2005-12-16 Raja R Harinath <rharinath@novell.com>
10486 * class.cs (TypeContainer.Mark_HasEquals): New.
10487 (TypeContainer.Mark_HasGetHashCode): New.
10488 (ClassPart): Override them.
10489 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10492 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10493 'parent' argument to the base constructor.
10495 Remove all mention of TypeContainer from decl.cs.
10496 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10497 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10498 (DeclSpace.DeclSpace): Likewise.
10499 (DeclSpace.DefineMembers): Remove unused argument.
10500 * cs-parser.jay (pop_current_class): Update to changes. Simplify
10501 debugging check -- we don't care if the debug code throws an
10502 InvalidCastException instead of an InternalErrorException.
10503 * class.cs (TypeContainer.DefineMembers): Update to changes.
10504 (TypeContainer.DoDefineMembers): Likewise.
10505 (TypeContainer.GetMethods): Likewise.
10506 (PropertyMember.Define): Likewise.
10507 (MemberBase.Parent): New property that forwards to
10508 MemberCore.Parent, but ensures that we get a TypeContainer.
10509 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10510 (RootContext.PopulateTypes): Likewise. Remove special case code
10511 for !RootContext.StdLib: DefineMembers is idempotent.
10513 2005-12-14 Miguel de Icaza <miguel@novell.com>
10515 * convert.cs (ExplicitConversionCore): Check the return value from
10516 ExplicitConversionCore which can return null on failure. Fixes #76914
10518 2005-12-13 Marek Safar <marek.safar@seznam.cz>
10520 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10522 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
10524 * doc.cs : The search for referenced namespace was insufficient to
10525 get global one as it used to do. Fixed bug #76965.
10527 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
10529 * doc.cs : check name in cref in the last phase that whether it is
10532 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10534 * cs-tokenizer.cs : reverted the latest change: it somehow broke
10537 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10539 * doc.cs : so it turned out that we cannot skip override check for
10540 interface members. Fixed bug #76954.
10542 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
10544 * cs-tokenizer.cs : fixed bug #75984:
10545 - #warning and #error should not be handled when the source line
10547 - #line is not checked strictly when the source line is disabled.
10548 - #define and #undef is on the other hand checked strictly at any
10551 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
10553 * cs-tokenizer.cs : missing Location (actually, filename) in one of
10556 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10558 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10560 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10561 event initializers.
10562 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10563 (FieldBase.Initializer): Initializer is now optional.
10564 (EventField.Define): Only event field can have initializer.
10566 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10568 * const.cs (Const): Reuse initializer.
10570 * cs-parser.jay: Updated after FieldBase changes.
10571 Added current_array_type to simplify array initializers.
10573 * ecore.cs (NullCast.IsDefaultValue): Implemented.
10575 * expression.cs, iterators.cs: Updated.
10577 * namespace.cs (NamespaceEntry): Made UsingFound private.
10579 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10581 * parameterCollection.cs: Obsolete, removed.
10582 * parser.cs: Obsolete, removed.
10584 2005-12-05 Marek Safar <marek.safar@seznam.cz>
10587 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10589 * enum.cs (Enum.Define): Set obsolete context here.
10591 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10594 - FindDocumentedMember() now expects 1) paramList as null
10595 when "we don't have to check the number of parameters" and
10596 2) Type.EmptyTypes when "there is no arguments".
10597 - Introduced FoundMember struct to hold the exact type which was
10598 used to find the documented member (the above change broke
10599 test-xml-044; it might be better just to use DeclaringType than
10600 what MS does, like this change does, but it depends on usage.)
10602 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
10604 * doc.cs : documented member might be from DeclaringType for nested
10605 types. Fixed bug #76782.
10607 2005-12-03 Ben Maurer <bmaurer@ximian.com>
10609 * anonymous.cs: Have the param code handle leaving copies on the
10610 stack etc. Allows anonymous params to take part in the assignment
10611 code (++, +=, etc). Fixes bug #76550
10613 * expression.cs: Handle the prepare_for_load/leave_copy by passing
10614 it down to the anon code.
10616 * iterators.cs: Use dummy var here
10618 * codegen.cs: Handle new vars
10620 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10623 * class.cs (MethodData.Define): Set proper Obsolete context.
10625 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10627 (FieldExpr.DoResolve): Ditto.
10629 2005-12-01 Marek Safar <marek.safar@seznam.cz>
10632 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10633 parent is not obsolete.
10635 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
10637 * doc.cs : (FindDocumentedMember) find parameterless members first
10638 and get CS0419 in the early stage. Fixed first case of bug #76727.
10640 2005-11-30 Marek Safar <marek.safar@seznam.cz>
10643 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10644 no error was reported.
10646 *expression.cs (Binary.DoResolve): left can be null.
10648 2005-11-22 Marek Safar <marek.safar@seznam.cz>
10651 * class.cs (MethodData.Emit): Parameters should be labeled first.
10653 2005-11-21 Marek Safar <marek.safar@seznam.cz>
10656 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10658 2005-11-18 Marek Safar <marek.safar@seznam.cz>
10660 * attribute.cs (AreParametersCompliant): Moved to Parameter.
10662 * class.cs (MethodCore): Parameter clean up.
10663 (IMethodData): Added ParameterInfo.
10664 (MethodData): Parameter clean up.
10665 (Indexer.Define): Parameter clean up.
10677 * typemanager.cs: Parameter clean up.
10679 * delegate.cs (Define): Get rid of duplicated code.
10681 * expression.cs (ParameterReference): Removed useless parameters
10683 (Invocation): Ditto.
10685 * parameter.cs (ParamsParameter): New class, params specialization.
10686 (ArglistParameter): Attemp to separate arglist.
10687 (Parameter): Refactored to be reusable and faster.
10688 (Parameter.Modifier): Made understandable.
10689 (Parameters): Changed to be used as a class for `this' assembly
10690 parameters. Refactored to use new specialized classes.
10692 * support.cs (ParameterData): Added Types property.
10693 (InternalParameters): Deleted.
10695 2005-08-20 Martin Baulig <martin@ximian.com>
10697 Merging this patch from GMCS to fix #75867.
10699 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10700 scope if we don't already have it.
10702 2005-11-17 Martin Baulig <martin@ximian.com>
10705 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10706 inherit the scope from our parent. Fixes #76653.
10708 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10710 * doc.cs : the previous patch does not actually fix the bug.
10711 PropertyInfo override check is now implemented and really fixed it.
10712 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10714 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10716 * doc.cs : apply "override filter" also to properties.
10719 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
10721 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10722 no need to check overrides. For classes, omit those results from
10723 interfaces since they must exist in the class. Fixed bug #76726.
10725 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10727 * typemanager.cs : (GetFullNameSignature) differentiate indexers
10728 with different parameters. Fixed the second problem in #76685.
10730 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10732 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10733 get expected 'protected' access in CheckValidFamilyAccess()).
10736 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
10738 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10739 Fixed bug #76705. CS1569 was incorrectly commented out.
10741 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10743 * doc.cs : use Invocation.IsOverride() to do real override check.
10744 * expression.cs : made Invocation.IsOverride() internal.
10746 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
10748 * doc.cs : use TypeManager.FindMembers() instead of (possible)
10749 TypeBuilder.FindMembers() and filter overriden base members out.
10752 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10754 * doc.cs : ref/out parameters are represented as '@' (instead of
10755 '&' in type FullName). Fixed bug #76630 (additionally crefs).
10757 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10759 * doc.cs : when there was no '.' in cref to methods in doc comment,
10760 then parameters were missing in the output. Fixed bug #76691.
10762 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10764 * driver.cs : don't output docs when there is an error.
10767 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10770 Now it should detect indexers. Fixed primary concern in bug #76685.
10771 Fixed CS0419 message to not show the identical member signature in
10774 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
10776 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10777 instead of Type.FindMembers() since it does not handle events.
10780 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
10782 * codegen.cs: Fixed typo (speficied -> specified).
10784 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10787 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10789 2005-11-11 Marek Safar <marek.safar@seznam.cz>
10791 * attribute.cs: Changed error message.
10793 * cs-tokenizer.cs: One more check.
10795 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10797 * statement.cs (Block.Resolve): Ignore empty statement.
10799 2005-11-10 Marek Safar <marek.safar@seznam.cz>
10801 * report.cs: Made error/warning methods more strict to avoid
10804 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10805 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10806 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10807 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10809 2005-11-08 Marek Safar <marek.safar@seznam.cz>
10811 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10812 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10814 * class.cs (TypeContainer.IsComImport): New property.
10815 (Constructor.Define): Create proper ctor for ComImport types.
10817 * expression.cs (New.CheckComImport): Fixed.
10819 2005-11-07 Miguel de Icaza <miguel@novell.com>
10821 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10822 that a parameter has been captured does not mean that we do not
10823 have to do the rest of the processing. This fixes the second part
10824 of #76592. If there was another anonymous method capturing
10825 values in the past, the Scope would never be set for the second
10826 method that captured the same parameter.
10828 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10829 properly manipulate the stack. Second part of fix for #76592.
10831 * expression.cs (New): Add support for invoking "new" on
10832 interfaces that have been flagged with the ComImport attribute and
10833 the CoClass. Fixes #76637
10835 * statement.cs (Try.DoEmit): When a variable is captured, do not
10836 try to emit the vi.LocalBuilder variable as it has been captured.
10837 Create a temporary variable and store the results on the
10838 FieldBuilder. Fixes #76642
10840 2005-11-07 Marek Safar <marek.safar@seznam.cz>
10842 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10844 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10846 * expression.cs (Binary.DoResolve): Added && optimalization.
10848 * typemanager.cs (AddUserType): Removed useless argument.
10850 2005-11-04 Marek Safar <marek.safar@seznam.cz>
10852 * statement.cs (Block.variables): Uses ListDictionary.
10854 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10857 * class.cs (PartialContainer.EmitType): Customized to emit
10858 security attributes.
10859 (ClassPart.ApplyAttributeBuilder): Transform security attribute
10860 for partial classes.
10862 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10865 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10866 access has to be fixed.
10868 * typemanager.cs (IsUnmanagedType): Wrong common field type.
10870 2005-11-01 Marek Safar <marek.safar@seznam.cz>
10873 * ecore.cs (NullCast.Reduce): Implemented.
10875 * expression.cs (ArrayCreation.CheckIndices): Correcly check
10878 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10880 (Foreach.Resolve): Catch null properly.
10882 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10884 * cs-tokenizer.cs: Warning text fix.
10886 * driver.cs: AllWarningNumbers exposed on public interface.
10888 * report.cs (): Reviewed warning numbers.
10889 (IsValidWarning): Use binary search.
10891 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10893 * driver.cs: Implemeted resource visibility.
10894 (Resources): New class for code sharing between /res: and
10897 2005-10-28 Marek Safar <marek.safar@seznam.cz>
10900 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10903 * convert (Convert.ImplicitReferenceConversion): NullCast holds
10906 * ecore.cs (NullCast): Child is contant only.
10908 * literal.cs (NullLiteral.Reduce): null can be converted to any
10911 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
10913 * driver.cs: Use Encoding.Default as default code page instead
10916 2005-10-27 Raja R Harinath <rharinath@novell.com>
10919 * expression.cs (Invocation.Error_InvalidArguments): Handle
10920 __arglist parameters.
10921 (Invocation.VerifyArgumentsCompat): Likewise.
10922 * support.cs (ReflectionParameters.GetSignatureForError): Print
10923 __arglist parameters.
10924 (InternalParamters.GetSignatureForError): Likewise.
10925 * parameter.cs (Parameters.GetSignatureForError): Likewise.
10927 2005-10-26 Marek Safar <marek.safar@seznam.cz>
10929 * attribute.cs (GetPropertyValue): Made public.
10931 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10933 Add new property WrapNonExceptionThrows to handle 2.0 assembly
10935 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10938 * driver.cs: Reflect method name change.
10940 * statement.cs (Try.Resolve): Warn when try has both general
10941 exception handlers.
10943 * typemanager.cs: runtime_compatibility_attr_type new predefined
10946 2005-10-26 Raja R Harinath <harinath@gmail.com>
10949 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10950 treat it as an empty parameter list.
10952 2005-10-26 Raja R Harinath <rharinath@novell.com>
10955 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
10956 ResolveAsTypeStep silent.
10957 * statement.cs (Block.AddConstant): Mark block as used.
10958 (Block.ResolveMeta): Avoid piling on error messages
10959 if a constant initializer resolution fails.
10961 2005-10-25 Raja R Harinath <rharinath@novell.com>
10963 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10965 (NamespaceEntry.VerifyAllUsing): New.
10966 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
10967 behaviour. Delegates actual resolution of alias to ...
10968 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
10969 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10971 * driver.cs (Driver.MainDriver): Update.
10973 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10974 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10976 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10978 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10979 RootNamespace.DefineNamespacesForAll.
10981 2005-10-24 Raja R Harinath <harinath@gmail.com>
10983 * typemanager.cs (assemblies, external_aliases, modules)
10984 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10985 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10986 overhead. Move resposibility ...
10987 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10988 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10990 2005-10-23 Raja R Harinath <harinath@gmail.com>
10992 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10993 cached_namespaces. Improve usage.
10994 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10995 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10996 Move from GlobalRootNamespace and simplify.
10997 (RootNamespace.Global): Make instance variable.
10998 (RootNamespace.RootNamespace): Add "alias name" parameter.
10999 (GlobalRootNamespace): Simplify drastically.
11000 (Namespace.Lookup): Don't use GetNamespace.
11001 * typemanager.cs (GetRootNamespace): Rename from
11002 ComputeNamespaceForAlias.
11003 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
11005 2005-10-23 Marek Safar <marek.safar@seznam.cz>
11007 * anonymous.cs (AnonymousContainer): Don't crash when container
11010 2005-10-23 Marek Safar <marek.safar@seznam.cz>
11012 * expression.cs (Binary.DoResolve): Warn when comparing same
11015 2005-10-23 Marek Safar <marek.safar@seznam.cz>
11018 * expression.cs (Binary.DoResolve): It looks like there are no
11019 convetsion rules in enum context.
11021 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11023 Add support for extern alias qualifiers.
11024 * typemanager.cs: Move some LookupTypeReflection code
11025 to namespace.cs, to have cleaner code. Added some methods
11026 to help us keep track of the extern aliased references.
11027 * driver.cs: Add suport for extern alias assemblies on command
11028 line and check for their warnings/errors. Also keep track of the
11029 extern aliased assemblies.
11030 * namespace.cs: Move the global functionality of Namespace
11031 to GlobalRootNamespace/RootNamespace. Now the global namespace
11032 is GlobalRootNamespace.Globa. Also the code moved from
11033 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
11034 Finally added LocalAliasEntry (AliasEntry before) and
11035 ExternAliasEntry, to handle alias statements.
11036 * cs-parser.jay: Add support in the grammar for extern alias
11038 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
11039 Update callings to Namespace (now in GlobalRootNamespace).
11041 2005-10-18 Raja R Harinath <rharinath@novell.com>
11044 * class.cs (TypeContainer.DefineType): Move updating of
11045 topological sort earlier in the code.
11046 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
11048 2005-10-18 Marek Safar <marek.safar@seznam.cz>
11051 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
11053 * constant.cs (Constant.TryReduce): Moved from Cast class.
11054 (Reduce): Made little bit more OO and fixed missing conversions.
11056 * ecore.cs (Reduce): Implemented.
11057 (Binary.EnumLiftUp): New method to upgrade values to enum values.
11059 * literal.cs (Reduce): Implemented.
11061 * class.cs: Reverted Miguel's wrong commit.
11063 2005-10-14 Miguel de Icaza <miguel@novell.com>
11065 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
11067 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
11069 * cs-parser.jay, expression.cs : CS0214 was missing error location
11070 for constants. Fixed bug #76404.
11072 2005-10-11 Marek Safar <marek.safar@seznam.cz>
11075 * convert.cs (ExplicitConversionCore): Fixed object->enum
11078 2005-10-10 Raja R Harinath <rharinath@novell.com>
11080 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
11081 InstanceExpression.
11082 (PropertyExpr.EmitCall): Likewise.
11083 * expression.cs (Invocation.EmitArguments): Handle case where
11085 (Invocation.EmitCall): Avoid allocating temporary variable if
11086 there are no arguments.
11088 2005-10-07 Raja R Harinath <rharinath@novell.com>
11091 * convert.cs (ImplicitConversionStandard): Move conversion of
11092 void* to arbitrary pointer types ...
11093 (ExplicitConversionStandard): .. here.
11094 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
11095 error to always print typenames.
11097 2005-10-07 Raja R Harinath <rharinath@novell.com>
11099 * convert.cs (GetConversionOperator): Rename from
11100 GetConversionOperators. Move operator selection code from ...
11101 (UserDefinedConversion): ... here.
11103 2005-10-06 Marek Safar <marek.safar@seznam.cz>
11105 * convert.cs (ExplicitConversionCore): Removed duplicate enum
11108 2005-10-05 Marek Safar <marek.safar@seznam.cz>
11110 * assign.cs (Assign.DoResolve): Error method changed.
11112 * cfold.cs (DoConstantNumericPromotions): Error method changed.
11114 * const.cs (ResolveValue): Reset in_transit immediately.
11116 * constant.cs: Error method changed.
11118 * convert.cs: Removed useless location parameter.
11119 (ExplicitNumericConversion): Don't do double enum check.
11120 (ExplicitConversionCore): Renamed from ExplicitConversion.
11121 (ExplicitUnsafe): Extracted from ExplicitConversion.
11122 (ExplicitConversion): Uses for error reporting.
11124 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
11126 (ResolveBoolean): Uses common error method.
11127 (CastToDecimal): Get rid of ec.
11128 (CastFromDecimal): Optimized.
11129 (ConvCast): Get rid of ec.
11131 * enum.cs (ResolveValue): Reset in_transit immediately.
11132 (Emit): Return after first error.
11134 * expression.cs: Convert changes.
11136 * literal.cs: Error method changed.
11138 * statement.cs: Error method changed.
11140 2005-10-03 Raja R Harinath <rharinath@novell.com>
11142 * support.cs (SeekableStreamReader.Position): Don't error out when
11143 the requested position is just beyond the end of the current
11146 2005-09-28 Raja R Harinath <rharinath@novell.com>
11148 * support.cs (SeekableStreamReader): Simplify drastically. Don't
11149 try to keep in sync with the byte count of the underlying Stream.
11150 However, this limits us to a window size of 2048 characters: i.e.,
11151 the maximum lookahead of our lexer/parser can be 2048 characters.
11153 2005-09-28 Marek Safar <marek.safar@seznam.cz>
11156 * driver.cs: Fix compilation files with full root path.
11158 2005-09-25 Miguel de Icaza <miguel@novell.com>
11160 * report.cs (SymbolRelatedToPreviousError): Format the output so
11161 it does not use an open parenthesis that is never closed.
11163 * driver.cs: Follow coding guidelines
11165 2005-09-27 Marek Safar <marek.safar@seznam.cz>
11168 * const.cs (Const.ResolveValue): Check for assigning non-null
11169 value to reference type.
11171 2005-09-27 Marek Safar <marek.safar@seznam.cz>
11173 * anonymous.cs: Implemented ExprClassName.
11175 * assign.cs (Assign.DoResolve): Don't chrash when type is not
11178 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
11181 * class.cs (StaticClass.DefineContainerMembers): Report protected
11184 * codegen.cs: if(ed) PRODUCTION.
11186 * convert.cs (Error_CannotImplicitConversion): Better error
11189 * cs-parser.jay: More error checks.
11191 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
11193 * driver.cs (CSCParseOption): Enabled wrong option check.
11195 * ecore.cs (Expression.ExprClassName): Turned to property.
11196 (MemberExpr.CheckIntermediateModification): For checking boxed
11197 value types modification.
11199 * statement.cs (Fixed.Resolve): Expression type must be
11200 convertible to fixed type.
11201 (CollectionForeach.GetEnumeratorFilter,TryType):
11202 Small refactoring for easier error checking.
11204 2005-09-26 Marek Safar <marek.safar@seznam.cz>
11206 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
11209 * class.cs (GeneratedBaseInitializer): New class for customization
11210 compiler generated initializers.
11211 (MemberBase.DoDefine): Check Obsolete attribute here.
11212 (FieldMember.DoDefine): Ditto.
11214 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
11217 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
11218 (MemberCore.GetObsoleteAttribute): Removed argument.
11219 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
11220 (MemberCore.CheckObsoleteType): New helper.
11224 * statement.cs: Updates after MemberCore changes.
11226 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
11227 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
11229 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
11230 obsolete attribute for compiler construct.
11231 (As.DoResolve): Cache result.
11233 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
11235 2005-09-26 Raja R Harinath <rharinath@novell.com>
11238 * expression.cs (This.VerifyFixed): In a value type T, the type of
11239 'this' is T&, iow, 'this' is either an out or ref parameter. In a
11240 value type R, 'this' is treated as a value parameter.
11242 2005-09-22 Miguel de Icaza <miguel@novell.com>
11244 * statement.cs (Lock): Use the TemporaryVariable class instead of
11245 manually using local variables as those do not work when variables
11248 * ecore.cs: Moved the TemporaryVariable class from being a nested
11249 class inside Foreach to be a public class that can be employed in
11252 2005-09-19 Marek Safar <marek.safar@seznam.cz>
11254 * cs-parser.jay: interface_accessors replaced by
11255 accessor_declarations.
11257 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
11260 * statement.cs (GotoCase.Resolve): Convert null constant to
11262 (SwitchLabel.ResolveAndReduce): Ditto.
11263 (SwitchLabel.NullStringCase): Custom null stamp.
11264 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
11266 typemanager.cs (CSharpSignature): Don't skip first argument
11269 2005-09-18 Miguel de Icaza <miguel@novell.com>
11271 * driver.cs: Set InEmacs based on the environment variable EMACS.
11273 * location.cs (InEmacs): in this mode, do not report column
11274 location as it confuses Emacs.
11276 2005-09-16 Marek Safar <marek.safar@seznam.cz>
11278 * cfold.cs, constant.cs, convert.cs, ecore.cs,
11279 expression.cs, iterators.cs, literal.cs: Store constants and
11282 * class.cs (MemberBase.ShortName): Pass location.
11284 * cs-parser.jay: Some location fixes.
11286 * ecore.cs (Expression.Location): Made virtual.
11288 2005-09-05 Miguel de Icaza <miguel@novell.com>
11290 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
11291 if the underlying types are the same, otherwise we need to produce
11292 code that will do the proper cast.
11294 This was exposed by Marek's constant rewrite which produced
11295 invalid code for the call site:
11297 enum X : long { a }
11298 void Method (X v) {}
11302 This fixes test-49.cs
11304 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
11306 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
11307 Type/Object should be allowed as well. Fixed bug #75968.
11309 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
11311 * expression.cs : (Binary.DoResolve): when one is enum constant and
11312 another is constant 0, then return enum one *as enum type*.
11315 2005-09-02 Raja R Harinath <rharinath@novell.com>
11317 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
11321 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
11322 flow-branching for LocalVariableReferences in case we were invoked
11323 from a MemberAccess.
11324 * expression.cs (LocalVariableReference.VerifyAssigned): New.
11326 (LocalVariableReference.DoResolveBase): ... this.
11327 (MemberAccess.Resolve): Do the check that was disabled during
11330 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
11333 (PartialContainer.Create): check abstract/sealed/static strictly
11334 but abstract/sealed can exist only at one side. Fixed bug #75883.
11336 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
11339 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
11340 specified, don't default to UnmanagedType.I4.
11342 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
11344 * expression.cs : conditional operator should check possibly
11345 incorrect assign expression. Fixed bug #75946.
11347 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
11349 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
11350 Reverting the change. gmcs is much complex than mcs on this matter.
11352 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
11354 * cs-tokenizer.cs : To read another token ahead of the actual
11355 consumption, use new SavedToken and cache token instead of moving
11356 back the stream with SeekableStreamReader (it seemed problematic).
11358 driver.cs : Thus use StreamReader directly.
11359 * support.cs : Thus removed SeekableStreamReader.
11361 2005-08-30 Raja R Harinath <rharinath@novell.com>
11364 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
11365 (ScopeInfo.EmitScopeType): Use it to construct field names from
11366 names of captured locals.
11369 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
11370 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11371 Pass 'target_type' to BoxedCast. Don't default to 'object'.
11372 (ExplicitConversion): Remove enum cases already handled by
11373 implicit conversion. Move implicit conversion check to the beginning.
11374 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
11375 * expression.cs (ArrayCreation.EmitDynamicInitializers):
11376 Don't treat System.Enum as a struct.
11378 2005-08-30 Jb Evain <jbevain@gmail.com>
11380 * attribute.cs: handles as expression in parameters.
11382 2005-08-30 Raja R Harinath <rharinath@novell.com>
11385 * class.cs (TypeContainer.VerifyClsName): Don't use a
11386 PartialContainer when verifying CLS compliance.
11387 (AbstractPropertyEventMethod): Set Parent here, ...
11388 (PropertyMethod): ... not here.
11390 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
11392 * attribute.cs : escaped attribute name should not be allowed to be
11393 resolved (e.g. @class as classAttribute). Fixed bug #75930.
11395 2005-08-29 Raja R Harinath <rharinath@novell.com>
11398 * convert.cs (ImplicitStandardConversionExists): Allow zero also
11399 when converting a long constant to unsigned long.
11400 * expression.cs (Invocation.OverloadResolve): Add sanity check to
11401 detect where IsApplicable and VerifyArgumentsCompat disagree.
11403 2005-08-29 Raja R Harinath <rharinath@novell.com>
11404 and Carlos Alberto Cortez <carlos@unixmexico.org>
11407 * class.cs (TypeContainer.CanElideInitializer): New helper.
11408 (TypeContainer.EmitFieldInitializers): Use it to determine if we
11409 can safely emitting the initializer of a field.
11411 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11413 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11414 allowed inside a switch (without loop). Fixed bug #75433.
11416 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
11418 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11419 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11421 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11423 * driver.cs : kinda reverting the default encoding changes (not exact
11424 revert since I noticed that "codepage:reset" might not work fine).
11426 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11428 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11429 Location. Now getter and setter store location correctly.
11430 (errors/cs0111-12.cs now reports the expected location.)
11432 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11434 * driver.cs : Use default encoding on the environment.
11435 Removed (now that) extra parameter for SeekableStreamReader.
11436 * support.cs : (SeekableStreamReader) third .ctor() argument for
11437 StreamReader is not required (always true). preamble size could
11438 be acquired in simpler and safe way.
11440 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
11442 * cs-parser.jay: report CS0642 at warning level 3
11443 and report CS0642 for an if else statement also
11444 fixes bug #74745. Patch by John Luke (and a bit
11446 Removed extra CS0642 warning check for "while",
11448 * statement.cs: In Block.Resolve(), CS0642 check
11449 is reimplemented to check a sequence of an empty
11450 statement and a block.
11452 Both fix bug #66777.
11454 2005-08-24 Marek Safar <marek.safar@seznam.cz>
11456 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11457 detection until I fix it.
11459 * cs-tokenizer.cs: Changed error message.
11461 * cs-parser.jay: Fixed 2 error locations.
11463 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11464 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11467 * enum.cs (GetSignatureForError): Fixed.
11469 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11473 * typemanager.cs (RegisterProperty): Removed.
11475 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11477 2005-08-24 Raja R Harinath <rharinath@novell.com>
11480 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11481 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11483 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11485 * expression.cs : tiny fix is required for not warning positive ulong.
11488 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11490 * expression.cs : add CS0652 check for constant and integral
11491 expression. Fixed bug #53974.
11493 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11495 * expression.cs : in DoNumericPromotions(), check if there is implicit
11496 conversion overload for string (to check CS0034). Fixed bug #52492.
11498 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11500 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11502 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11504 * ecore.cs : report location when it is *not* Null.
11506 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
11512 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11513 correctly. Fixed bug #75721.
11515 2005-08-23 Raja R Harinath <rharinath@novell.com>
11517 * support.cs (SeekableStreamReader.Position): Avoid an expensive
11518 loop that performs 'min (pos, char_count)'.
11521 * expression.cs (Unary.ResolveOperator): Don't discard implicit
11522 converted value in Operator.OnesComplement.
11524 2005-08-22 Ben Maurer <bmaurer@ximian.com>
11526 * anonymous.cs: If the anon method is pulled into a helper class,
11527 it needs to be `internal' not `private'. Fixes runtime behavior on
11530 2005-08-20 Martin Baulig <martin@ximian.com>
11532 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11533 scope if we don't already have it.
11535 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11536 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11539 2005-08-17 Marek Safar <marek.safar@seznam.cz>
11542 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11543 is a partial class.
11545 2005-08-16 Marek Safar <marek.safar@seznam.cz>
11547 The big constants rewrite
11548 Fix #75746, #75685 and more
11549 As a side effect saved 1MB for MWF ;-)
11551 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11552 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11553 enum based for corlib compilation.
11555 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11558 * class.cs (FixedField.Define): Use ResolveAsConstant.
11560 * const.cs (IConstant): Interface constants and enums.
11561 (Const.ResolveValue): New method for constant resolvning.
11562 (ExternalConstant): Constants from imported assemblies.
11564 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11565 conversion; like enums.
11566 (Constant.ToType): Converts this constant to different type.
11567 (Constant.Increment): Adds 1.
11569 * convert.cs (ImplicitConversionRequired): Simplified.
11571 * cs-parser.jay: Create EnumMember directly.
11573 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11575 * doc.cs (GenerateEnumDocComment): Removed.
11577 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11578 (ConvertIntLiteral): Removed.
11579 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11581 * enum.cs (EnumMember): Implement IConstant.
11582 (Enum.IsValidEnumConstant): Removed.
11583 (Enum.GetNextDefaultValue): Removed.
11584 (Enum.FindMembers): Updated.
11585 (Enum.GenerateDocComment): Iterate enum members.
11587 * expression.cs (Cast.TryReduce): Handle enums correctly.
11588 (New.Constantify): Made public.
11589 (MemberAccess.DoResolve): Removed contant specific if(s).
11591 * literal.cs (NullLiteral): Implement new abstract methods.
11593 * statement.cs (GotoCase.Resolve): Use new constant methods.
11594 (SwitchLabel.ResolveAndReduce): Use new constant methods.
11596 * typemanager.cs (LookupEnum): Removed.
11597 (IsEnumType): Fixed to work with corlib.
11598 (RegisterConstant): Removed.
11599 (LookupConstant): Removed.
11600 (GetConstant): Changed to work with IConstant.
11602 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
11604 * location.cs : Fixed overflown (>255) column number.
11606 2005-08-03 Raja R Harinath <rharinath@novell.com>
11608 First cut of the qualified-alias-member feature.
11609 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11611 * cs-parser.jay (DOUBLE_COLON): New token.
11612 (namespace_or_type_name): Add rule for recognizing
11613 qualified-alias-members.
11614 (primary_expression): Likewise.
11615 (element_access): Allow QualifiedAliasMember as a possible
11616 type-bearing expression.
11617 (local_variable_type, local_variable_pointer_type): Likewise.
11618 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
11619 aliases in the current and enclosing namespace declarations.
11620 (NamespaceEntry.UsingAlias): Add CS0440 warning.
11621 * decl.cs (MemberName.is_double_colon): New.
11622 (MemberName.MemberName): Add new constructor for alias-member.
11623 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11624 * expression.cs (QualifiedAliasMember): New expression type.
11626 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11628 * location.cs : it borked when no argument was specified.
11630 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11632 * location.cs : tiny ToString() format fix.
11634 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11636 * statement.cs : oops, it was missing.
11638 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
11640 A set of fixes for precise line/column location.
11643 "token" field now holds a file/line "delta", a line number offset
11644 from the segment, and a column number. See also:
11645 http://lists.ximian.com/pipermail/mono-devel-list/2004-
11646 December/009508.html
11647 Removed static IsNull. Use instance IsNull property instead.
11648 * cs-tokenizer.cs :
11649 For some tokens it stores Location. For Identifier it stores
11650 LocatedToken which is a pair of string name and location.
11651 Column numbers are adjusted only at getChar().
11653 Use Location.ToString() for reporting (it now contains column).
11655 Largely modified to use LocatedToken instead of
11656 string (IDENTIFIER), and to acquire Location from some tokens.
11657 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11658 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11660 Now MemberName holds Location. DeclSpace.ctor() receives Location
11661 as a parameter. Removed extra parameters to all derived classes.
11662 Replaced Location.IsNull() with instance property.
11663 * assign.cs, expression.cs :
11664 Added .ctor() overload that omits Location.
11666 Added "nameEscaped" flag that indicates the identifier was escaped
11667 in the source file. This fixes bug #57047.
11669 2005-08-02 Marek Safar <marek.safar@seznam.cz>
11671 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11672 New method, looking for lo-case imported cls type.
11674 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11677 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11679 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11681 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11682 all_imported_types.
11683 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11685 Optimized to save 3.5 MB for SWF compilation.
11687 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11689 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11690 (PartialContainer.Create): Moved logic AddToContainer.
11691 (PartialContainer.MarkForDuplicationCheck): Shares name.
11693 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11696 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11698 (Namespace.GetSignatureForError): New method.
11700 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11701 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11703 2005-08-01 Raja R Harinath <rharinath@novell.com>
11706 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11707 member lookup rather than qualifier_type, since qualifier_type can
11710 2005-08-01 Marek Safar <marek.safar@seznam.cz>
11712 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11715 2005-07-31 Miguel de Icaza <miguel@novell.com>
11717 * statement.cs: Copy the local exception into the exception
11718 captured local. Fixes 75674
11720 2005-07-31 Raja R Harinath <harinath@gmail.com>
11723 * expression.cs (Invocation.OverloadResolve): Don't report error
11724 CS1501 if error CS1502 has been reported.
11725 (New.DoResolve): Delegate CS1501 reporting to
11726 Invocation.OverloadResolve.
11729 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11730 invariant-meaning-in-block property in an enclosing block if
11733 2005-07-29 Marek Safar <marek.safar@seznam.cz>
11735 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11736 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11737 (Switch.CheckSwitch): Just save 50kb for SWF.
11739 2005-07-27 Martin Baulig <martin@ximian.com>
11741 * anonymous.cs (CaptureContext.AddField): Added
11742 `AnonymousContainer am' argument; compute its toplevel scope if
11743 it's not already computed. Fixes #75649.
11745 2005-07-26 Raja R Harinath <rharinath@novell.com>
11748 * class.cs (Constructor.Emit): Reset block to null if the block
11751 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11753 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11755 2005-07-25 Marek Safar <marek.safar@seznam.cz>
11757 * class.cs (MethodData.Define): Check whether accessor implementing
11758 interface is public.
11760 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11762 2005-07-22 Marek Safar <marek.safar@seznam.cz>
11765 * namespace.cs (LookupType): Moved same type check to...
11767 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11768 with the same name.
11770 2005-07-21 Raja R Harinath <rharinath@novell.com>
11772 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11773 already found a typebuilder.
11774 * class.cs (MethodCore.IsDuplicateImplementation): Compare
11775 MemberNames, not strings.
11777 * const.cs (Error_ExpressionMustBeConst):
11778 Rename from Error_EpressionMustBeConst.
11779 * const.cs, class.cs, statement.cd: Update.
11781 2005-07-21 Marek Safar <marek.safar@seznam.cz>
11785 * const.cs (Const.LookupConstantValue): Report missing contant expression
11787 (Error_EpressionMustBeConstant): Only one error method.
11789 * class.cs, statement.c: Updated.
11791 2005-07-20 Raja R Harinath <rharinath@novell.com>
11793 * statement.cs (Block.Flags): Add back HasVarargs.
11794 (Block.flags): Make protected.
11795 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11797 * typemanager.cs (types, typecontainers, user_types): Remove.
11798 (UserTypes, TypeContainers): Likewise.
11799 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11800 (CleanUp, Reset): Update.
11801 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
11802 (GetNestedType): Use Type.GetNestedType.
11803 (CoreLookupType): Take two arguments, the namespace and the
11804 basename of the type. Update to use the Namespace.Lookup
11806 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11807 (RealMemberLookup): Use IsNestedChildOf instead of playing with
11808 string concatenation and substring matches.
11809 * class.cs, enum.cs, delegate.cs: Update to changes.
11811 2005-07-20 Marek Safar <marek.safar@seznam.cz>
11813 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11814 Expression and made virtual.
11816 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11817 (ImplicitStandardConversionExists): Fixed `byte' typo ?
11819 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11821 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11824 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11827 2005-07-18 Marek Safar <marek.safar@seznam.cz>
11830 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11831 AssemblyCultureAttribute is not used on executable.
11834 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11836 2005-07-16 Raja R Harinath <rharinath@novell.com>
11839 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11840 New. Reports CS0252/CS0253.
11841 Mostly taken from preliminary patch by Duncak Mak.
11842 (Binary.DoResolveOperator): Store results of operator lookup.
11843 Use them to detect if we need to warn about unintended reference
11846 2005-07-15 Raja R Harinath <rharinath@novell.com>
11849 * namespace.cs (Namespace.Lookup): Add back location parameter.
11850 (Namespace.LookupType): Add CS0436 report. Add location parameter.
11851 * delegate.cs, ecore.cs, expression.cs: Update to changes.
11853 * codegen.cs (EmitContext.DeclSpace): Make readonly.
11854 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11855 (Namespace.LookupType): ... this.
11856 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11858 * typemanager.cs (LookupTypeReflection): Remove buggy code that
11859 purported to handle pointers.
11860 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11863 2005-07-15 Marek Safar <marek.safar@seznam.cz>
11865 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11868 2005-07-15 Raja R Harinath <rharinath@novell.com>
11870 * namespace.cs (Namespace.Lookup): Drop location parameter.
11871 (NamespaceEntry.LookupAlias): Remove. Merge into ...
11872 (NamespaceEntry.Lookup): ... this.
11873 (NamespaceEntry.Error_AmbiguousTypeReference):
11874 Move here from DeclSpace.
11875 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11877 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11878 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11879 Move to NamespaceEntry.
11880 * delegate.cs, expression.cs: Update to changes.
11882 2005-07-14 Marek Safar <marek.safar@seznam.cz>
11884 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11885 CheckAttributeType and refactored.
11886 (Attribute.ResolvePossibleAttributeType): Changed to reuse
11887 ResolveAsTypeTerminal error handling.
11888 (ResolveAsTypeTerminal): Introduced because of global attributes extra
11890 (GetSignatureForError): Print errors in same way.
11893 * codegen.cs: Reflect attribute GetSignatureForError change.
11896 * expression.cs: Add silent parameter to ResolveAsTypeStep.
11898 * namespace.cs (UsingEntry): Refactored to make fields private.
11901 statement.cs: Error_UnexpectedKind has extra parameter.
11903 2005-07-14 Raja R Harinath <rharinath@novell.com>
11905 * ecore.cs (IAlias): Remove.
11906 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
11907 that implement the interface.
11908 * namespace.cs (Namespace): Likewise.
11909 (Namespace.declspaces): Renamed from 'defined_names'.
11910 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
11911 DeclSpace instead of an IAlias.
11912 * tree.cs (Tree.AddDecl): Update.
11914 2005-07-12 Raja R Harinath <rharinath@novell.com>
11916 * statement.cs (Block.Flags); Remove HasVarargs.
11917 (Block.HasVarargs): Move to ToplevelBlock.
11918 (Block.ThisVariable, Block.AddThisVariable): Likewise.
11919 (Block.Variables): Make protected. Initialize variable hashtable
11921 (Block.AddVariable): Update.
11922 (Block.Resolve): Update to changes.
11923 (ToplevelBlock.HasVarargs): New boolean.
11924 (ToplevelBlock.ThisVariable): Move here from Block.
11925 (ToplevelBlock.AddThisVariable): Likewise.
11926 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
11927 * expression.cs (This.ResolveBase): Update to changes.
11928 (ArglistAccess.DoResolve): Likewise.
11930 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11933 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11935 * class.cs (TypeContainer.VerifyMembers): Distinguish between
11936 not used and not used & assigned.
11937 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11939 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11942 * expression.cs (Is.DoResolve): null is never provided type.
11944 2005-07-08 Marek Safar <marek.safar@seznam.cz>
11947 * cs-parser.jay: Less strict event error rule to catch more errors.
11949 2005-07-08 Martin Baulig <martin@ximian.com>
11951 Fix test-iter-10.cs - distinguish whether we `yield' in a property
11952 gettter (allowed) or setter (not allowed).
11954 * class.cs (Accessor): Implement IIteratorContainer.
11955 (Accessor.Yields): New public field.
11956 (PropertyBase.PropertyMethod.Define): Handle iterators on a
11957 per-accessor basis.
11960 (get_accessor_declaration, set_accessor_declaration): Set the
11961 `yields' flag on the accessor, not the property.
11962 (property_declaration): Do the iterators check on a per-accessor
11963 basis and not for the whole property.
11965 2005-07-08 Martin Baulig <martin@ximian.com>
11967 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11968 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11970 2005-07-07 Marek Safar <marek.safar@seznam.cz>
11973 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11974 (ExtractSecurityPermissionSet): Cope with self referencing security
11975 attributes properly.
11977 * driver.cs (SetOutputFile): Made public property OutputFile.
11979 2005-07-07 Raja R Harinath <rharinath@novell.com>
11982 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11983 has_nonstatic_fields. Make into a FieldBase pointer.
11984 (TypeContainer.AddField): Add CS0282 check.
11985 (TypeContainer.EmitType): Update.
11987 2005-07-06 Miguel de Icaza <miguel@novell.com>
11989 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11990 compare if they start with __.
11992 2005-07-06 Raja R Harinath <rharinath@novell.com>
11994 * statement.cs (Switch.SwitchGoverningType): Only look at
11995 UserCasts that don't need implicit standard conversions to one of
11996 the allowed switch types (Fixes test-322.cs).
11997 (LocalInfo.Resolve): Re-enable sanity-test.
11999 2005-07-06 Marek Safar <marek.safar@seznam.cz>
12001 * cs-tokenizer.cs (consume_identifier): Detect double undescores
12003 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
12005 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
12007 2005-07-06 Raja R Harinath <rharinath@novell.com>
12010 * ecore.cs (SimpleName.GetSignatureForError): Add.
12011 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
12012 (MemberAccess.GetSignatureForError): Add.
12014 2005-07-05 Marek Safar <marek.safar@seznam.cz>
12016 The big error and warning messages review.
12046 * typemanager.cs: Updated.
12048 * class.cs: (MethodCore.SetYields): Moved here to share.
12049 (PropertyMethod.Define): Moved iterator setup here.
12051 * iterators.cs: Add orig_method to have full access to parent
12054 2005-07-05 Raja R Harinath <rharinath@novell.com>
12056 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
12057 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
12058 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
12059 variable of struct type.
12060 * expression.cs (Unary.ResolveOperator): Update to change.
12061 (Indirection.VerifyFixed): Likewise.
12062 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
12063 (ParameterReference.VerifyFixed): Value parameters are fixed.
12064 (This.VerifyFixed): Treat 'this' as a value parameter.
12065 * statement.cs (LocalInfo.IsFixed): Remove.
12067 2005-07-01 Martin Baulig <martin@ximian.com>
12069 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
12070 `ec.EmitThis ()' to get the correct scope.
12072 2005-07-01 Martin Baulig <martin@ximian.com>
12074 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
12075 instance is a ParameterReference; fixes #75299.
12077 2005-07-01 Martin Baulig <martin@ximian.com>
12079 Reverted Marek's latest patch (r46725):
12080 - it contains structural changes which are neither mentioned in
12081 the ChangeLog nor explained anywhere; for example the additional
12082 argument of EmitContext's and Iterator's .ctor's and the
12083 TypeContainer.DefineMembers() change.
12084 - structural changes like this should go in in seperate patches
12085 and not be hidden in a huge patch which just seems to affect
12086 warnings and errors.
12087 a big and hard to understand patch.
12088 - it breaks iterators and causes regressions, for instance in
12091 2005-06-30 Raja R Harinath <rharinath@novell.com>
12094 * expression.cs (Indexers.map): Remove.
12095 (Indexers.Append): Filter out inaccessible setters and getters.
12096 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
12099 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
12100 Refactored from ...
12101 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
12102 (FieldExpr.Emit, PropertyExpr.Emit): Update.
12103 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
12104 * expression.cs (Invocation.EmitCall): Add CS0120 check.
12106 2005-06-30 Marek Safar <marek.safar@seznam.cz>
12109 * class.cs (FieldBase.GetInitializerExpression): One more field
12112 2005-06-28 Miguel de Icaza <miguel@novell.com>
12114 * pending.cs: Do not define a proxy if the base method is virtual,
12115 it will be picked up by the runtime (bug 75270).
12117 2005-06-08 Martin Baulig <martin@ximian.com>
12119 The big Iterators rewrite :-)
12121 * iterators.cs: Rewrite this to use the anonymous methods framework.
12123 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
12124 before the TypeContainers; see 2test-21.cs.
12127 (TypeContainer.DefineType): Don't create a new EmitContext if we
12128 already have one (this only happens if we're an Iterator).
12129 (TypeContainer.Define): Also call Define() on all our iterators.
12130 (Method.CreateEmitContext): Added support for iterators.
12133 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
12134 (AnonymousContainer.CreateMethodHost): Moved here from
12135 AnonymousMethod and made abstract.
12136 (AnonymousContainer.CreateScopeType): New abstract method.
12137 (AnonymousContainer.IsIterator): New public property.
12138 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
12139 get the ScopeTypeBuilder rather than manually defining it here.
12140 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
12143 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
12144 before RootContext.DefineTypes().
12146 * codegen.cs (EmitContext.RemapToProxy): Removed.
12147 (EmitContext.CurrentAnonymousMethod): Changed type from
12148 AnonymousMethod -> AnonymousContainer.
12149 (EmitContext.ResolveTopBlock): Protect from being called twice.
12150 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
12151 (EmitContext.EmitThis): Removed the iterators hacks; use the
12152 anonymous methods framework for that.
12155 (ToplevelBlock.Container): Make this a property, not a field.
12156 (ToplevelBlock.ReParent): New public method; move the
12157 ToplevelBlock into a new container.
12158 (Foreach.TemporaryVariable): Simplify.
12160 2005-06-05 Martin Baulig <martin@ximian.com>
12162 * statement.cs (LocalInfo.CompilerGenerated): New flag.
12163 (Block.AddTemporaryVariable): New public method; creates a new
12164 `LocalInfo' for a temporary variable.
12165 (Block.EmitMeta): Create the LocalBuilders for all the temporary
12167 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
12168 non-iterator variables.
12170 2005-06-05 Martin Baulig <martin@ximian.com>
12172 * statement.cs (Foreach.TemporaryVariable): Create the
12173 LocalBuilder in the Emit phase and not in Resolve since in some
12174 situations, we don't have an ILGenerator during Resolve; see
12175 2test-19.cs for an example.
12177 2005-06-04 Martin Baulig <martin@ximian.com>
12179 **** Merged r45395 from GCS ****
12181 The big Foreach rewrite - Part II.
12183 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
12184 with `PropertyInfo ienumerator_getcurrent'.
12186 * codegen.cs (VariableStorage): Removed.
12189 (Foreach): Derive from Statement, not ExceptionStatement.
12190 (Foreach.CollectionForeach): New nested class. Moved all the code
12191 dealing with collection foreach here.
12192 (Foreach.ForeachHelperMethods): Removed.
12193 (Foreach.TemporaryVariable): Implement IMemoryLocation.
12195 2005-05-23 Martin Baulig <martin@ximian.com>
12197 * statement.cs (Try.DoResolve): Don't create a `finally' if we
12198 don't need to. Fix #75014.
12200 2005-05-20 Martin Baulig <martin@ximian.com>
12202 Merged r44808 from GMCS.
12204 * class.cs (TypeContainer.CircularDepException): Removed.
12205 (TypeContainer.DefineType): Removed the `InTransit' stuff.
12206 (TypeContainer.CheckRecursiveDefinition): Check for circular class
12207 (CS0146) and interface (CS0529) dependencies here.
12209 2005-06-21 Raja R Harinath <rharinath@novell.com>
12211 * expression.cs (Invocation.EmitCall): Fix initialization
12212 'this_call' to reflect current behaviour. Fix indentation.
12214 * convert.cs (FindMostEncompassedType): Add two trivial special
12215 cases (number_of_types == 0 || number_of_types == 1).
12216 (FindMostEncompasingType): Likewise.
12218 2005-06-17 Raja R Harinath <rharinath@novell.com>
12220 Some cleanups preparing for the fix of #75283.
12221 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
12223 (EventExpr.InstanceResolve): Likewise.
12224 (EventExpr.DoResolve): Remove redundant checks.
12226 2005-06-10 Duncan Mak <duncan@novell.com>
12228 * cs-tokenizer.cs (process_directives): New flag for controlling
12229 the processing of preprocessor directives.
12230 (x_token): After seeing a '#', return Token.NONE instead of going
12231 to handle_preprocessing_directive() when not processing
12232 directives. This avoids unnecessary processing during the token peek in
12237 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
12238 the existing error reporting methods instead of Report.Error.
12240 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
12241 after Raja's rewrite.
12243 2005-06-08 Miguel de Icaza <miguel@novell.com>
12245 * class.cs: Small fix.
12247 2005-06-08 Raja R Harinath <rharinath@novell.com>
12250 * class.cs (GetPartialBases): Fix return value check of
12251 part.GetClassBases.
12253 2005-06-07 Raja R Harinath <rharinath@novell.com>
12255 Ensure that partial classes are registered in their enclosing
12256 namespace. Initial part of fix of #75160.
12257 * tree.cs (Tree.RecordDecl): Add new namespace argument.
12258 Register declspace with namespace here, not in
12259 DeclSpace.RecordDecl.
12260 * cs-parser.jay: Pass namespace to RecordDecl.
12261 * class.cs (PartialContainer.Create): Likewise.
12262 (ClassPart.DefineType): New sanity-check. Throws an exception if
12264 * decl.cs (Declspace.RecordDecl): Remove.
12265 * namespace.cs (NamespaceEntry.DefineName): Remove.
12267 2005-06-06 Marek Safar <marek.safar@seznam.cz>
12269 * rootcontext.cs: Reset TargetExt as well.
12271 2005-06-03 Raja R Harinath <rharinath@novell.com>
12273 * ecore.cs (Expression.Resolve): Emit CS0654 error when
12274 -langversion:ISO-1.
12276 2005-06-02 Raja R Harinath <rharinath@novell.com>
12278 Fix #75080, cs0119.cs.
12279 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
12281 (Expression.Resolve): ... this. Use it. Remove bogus code
12282 allowing ExprClass.Type and ExprClass.Namespace for
12283 ResolveFlags.VariableOrValue.
12284 (Expression.Resolve) [1-argument variant]: Change default resolve
12285 flags based on language version.
12286 (Expression.Error_UnexpectedKind): Use a simple string array
12287 rather than an ArrayList.
12288 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
12289 not ExprClass.Type.
12290 (TypeOfVoid.DoResolve): Likewise.
12291 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
12292 flags argument -- it always has the same value.
12294 2005-05-31 Raja R Harinath <rharinath@novell.com>
12297 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
12298 Use it in the error message.
12299 * assign.cs, expression.cs, statement.cs: Update.
12301 2005-05-30 Raja R Harinath <rharinath@novell.com>
12304 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
12305 the "almostMatchedMember" case too.
12306 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
12307 that failed the accessibility checks to 'almost_match'.
12309 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
12311 * attribute.cs: Use internal MethodBuilder methods to set
12312 ExactSpelling and SetLastError on PInvoke methods, instead
12313 of passing them via charset. Fixes #75060.
12315 2005-05-27 Raja R Harinath <rharinath@novell.com>
12317 * parameter.cs (Parameter): Remove TODO comment.
12318 (Parameter.DefineParameter): Remove Location parameter.
12319 (Parameters.LabelParameters): Likewise.
12320 * class.cs (Constructor.Emit): Update to change.
12321 (MethodData.Emit): Likewise.
12322 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
12323 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
12325 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
12328 Removed Parameters.Location and added Parameter.Location instead.
12329 Removed Location parameter from Emit() and GetSignature().
12336 Modified all related calls.
12338 2005-05-26 Raja R Harinath <rharinath@novell.com>
12340 Improve user-defined conversion handling.
12341 * convert.cs (GetConversionOperators): Rewrite. Return only the
12342 applicable operators.
12343 (AddConversionOperators): New. Helper for GetConversionOperators.
12344 (FindMostEncompassedType, FindMostEncompassingType): Verify that
12345 there is only one most encompassed/encompassing type.
12346 (FindMostSpecificSource, FindMostSpecificTarget): Remove
12347 "applicable operator" handling.
12348 (UserConversion): Move cache here from GetConversionOperators.
12349 Directly cache the chosen operator, rather than the whole
12351 (ExplicitNumericConversion): Fix buggy implementation of Decimal
12352 case. Allow conversion of decimal to sbyte and byte too.
12353 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
12354 New static methods. Used to avoid allocating EmptyExpressions in
12357 2005-05-24 Duncan Mak <duncan@novell.com>
12359 * ecore.cs (CastFromDecimal): New class for casting a decimal to
12360 another class, used in Convert.ExplicitNumericConversion.
12361 (CastToDecimal): New class, similar to above, but casts to
12362 System.Decimal, used in Convert.ImplicitNumericConversion and also
12363 in explicit convesion from double/float to decimal.
12365 * convert.cs (ImplicitNumericConversion): Handle implicit
12366 conversions to System.Decimal.
12367 (ExplicitNumericConversion): handle explicit conversions to
12372 2005-05-20 Miguel de Icaza <miguel@novell.com>
12374 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
12375 know the type at this stage, just break through. Fixes #75008
12377 2005-05-19 Martin Baulig <martin@ximian.com>
12380 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
12381 to disable error reporting.
12383 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
12384 here since we don't want to report an error; see the new test-336.cs.
12386 2005-05-19 Raja R Harinath <rharinath@novell.com>
12388 * statement.cs (ToplevelBlock.GetParameterReference)
12389 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
12390 Move here from class Block.
12391 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
12392 * expression.cs (ParameterReference.DoResolveBase): Likewise.
12394 2005-05-18 Martin Baulig <martin@ximian.com>
12399 (FlowBranching.Reachability): Add non-static public And() and Or()
12401 (FlowBranchingSwitch): New class; do the `break_origins' thing
12402 like in FlowBranchingLoop.
12403 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12404 reachability, not just locals and parameters.
12405 (FlowBranching.MergeChild): Remove some of the hacks for loop and
12406 switch; MergeBreakOrigins() now takes care of that.
12408 2005-05-18 Martin Baulig <martin@ximian.com>
12410 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12411 a loop and may leave it, reset the barrier; fixes #74974.
12413 2005-05-17 Marek Safar <marek.safar@seznam.cz>
12415 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12418 * cs-parser.jay: Catch more lexical errors.
12420 * report.cs: Add one more Error method.
12423 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12425 2005-05-17 Martin Baulig <martin@ximian.com>
12427 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12430 2005-05-16 Raja R Harinath <rharinath@novell.com>
12432 Fix test-382.cs. Emit values of decimal constants.
12433 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12435 (TypeContainer.AddField): ... this.
12436 (TypeContainer.EmitFieldInitializers): Allow the list of fields
12437 with initializers to include 'Const's.
12438 (ClassPart.RegisterFieldForInitialization): Forward to
12440 * const.cs (Const.Const): Pass initializer to base class.
12441 (Const.Define): In case of decimal constants, register them for
12442 initialization in a static constructor.
12444 2005-05-14 Martin Baulig <martin@ximian.com>
12446 * statement.cs (Block.Resolve): Correctly handle unreachable code;
12447 do not call ResolveUnreachable() on unreachable statements in
12448 here, see the comment in the source code.
12450 2005-05-13 Raja R Harinath <rharinath@novell.com>
12453 * expression.cs (BinaryResolveOperator): If one of the operands of
12454 an equality comparison is 'null' and the other is a pointer type,
12455 convert the null to a NullPointer.
12456 * convert.cs (ImplicitReferenceConversion): If the expression is a
12457 NullLiteral and the target type is a pointer type, return a
12458 NullPointer instead.
12459 (ImplicitConversionStandard): Likewise.
12461 2005-05-13 Marek Safar <marek.safar@seznam.cz>
12463 * cs-parser.jay: Set readonly context based on special constructs.
12465 * expression.cs (LocalVariableReference.DoResolveBase): Improved
12466 readonly variable error handling.
12468 * rootcontext.cs (EmitCode): Don't verify members when error
12471 * statement.cs (LocalInfo): Add reaodnly context information.
12472 (SetReadOnlyContext, GetReadOnlyContext): New methods.
12474 2005-05-13 Raja R Harinath <rharinath@novell.com>
12476 * statement.cs (Block.Resolve): Revert change below. Modify fix
12477 for #74041 to initialize 'resolved' to false only for explicit
12478 blocks. Fixes #74873.
12480 2005-05-12 Raja R Harinath <harinath@gmail.com>
12483 * typemanager.cs (unmanaged_enclosing_types): New.
12484 (IsUnmanagedType): Avoid infloops by using
12485 'unmanaged_enclosing_types' to talk with recursive invocations.
12487 2005-05-13 Martin Baulig <martin@ximian.com>
12489 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12490 instance variable, not a local. Fix #74873.
12491 (Block.ResolveUnreachable): Set it to true here.
12493 2005-05-11 Duncan Mak <duncan@novell.com>
12495 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12496 continuing to process for 'arg'.
12497 (handle_preprocessing_directive): Check the argument of the #endif
12498 directive and report error CS1025 if there are any trailing
12501 According to the C# spec, having even whitespace after the #endif
12502 directive is illegal; however, because we call arg.TrimEnd ()
12503 beforehand, we have the same behavior as csc, allowing whitespace
12504 after the directive.
12508 2005-05-11 Marek Safar <marek.safar@seznam.cz>
12512 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12513 (Constructor.GetObsoleteAttribute): Implemented correctly.
12515 2005-05-10 Martin Baulig <martin@ximian.com>
12517 * support.cs (ReflectionParameters.ParameterModifier): Use
12518 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12519 and `ParameterAttributes.In'. Fixes #74884.
12521 2005-05-10 Marek Safar <marek.safar@seznam.cz>
12523 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12525 * expression.cs (Argument.GetParameterModifier): Turned to property.
12526 (Invocation.Error_InvalidArguments): Add more descriptive errors.
12528 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12531 2005-05-09 Raja R Harinath <rharinath@novell.com>
12534 * decl.cs (MemberCache.AddMethods): Register override methods,
12535 rather than non-override methods.
12536 * typemanager.cs (RegisterOverride): New.
12537 (IsOverride): Update.
12539 2005-05-09 Marek Safar <marek.safar@seznam.cz>
12543 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12544 recursive declaration.
12546 * statement.cs (Block.ResolveMeta): Report any error in resolving.
12548 2005-05-06 Marek Safar <marek.safar@seznam.cz>
12550 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12552 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12554 2005-05-05 Raja R Harinath <rharinath@novell.com>
12557 * decl.cs (DeclSpace.FamilyAccessible):
12558 Use TypeManager.IsNestedFamilyAccessible.
12560 Fix reopened #64812.
12561 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12564 2005-05-04 Raja R Harinath <rharinath@novell.com>
12565 Abin Thomas <projectmonokochi@rediffmail.com>
12566 Anoob V E <projectmonokochi@rediffmail.com>
12567 Harilal P R <projectmonokochi@rediffmail.com>
12570 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12571 allow access to all static members.
12573 2005-05-04 Martin Baulig <martin@ximian.com>
12575 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12577 2005-05-04 Martin Baulig <martin@ximian.com>
12581 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12582 section at the end; make things work if `default' is not the last
12585 2005-05-04 Martin Baulig <martin@ximian.com>
12589 * statement.cs (Switch): Replaced the `got_default' field with a
12590 `default_section' one.
12591 (Switch.CheckSwitch): Set `default_section' here.
12592 (Switch.Resolve): If we're a constant switch and the constant is
12593 not found, use the default section.
12595 2005-05-03 Martin Baulig <martin@ximian.com>
12597 * expression.cs (ArrayAccess.EmitGetLength): New public method.
12599 * statement.cs (Foreach.ArrayForeach): New nested class.
12600 (Foreach.TemporaryVariable): New nested class.
12601 (Foreach.EmitArrayForeach): Removed; this is now in the new
12602 ArrayForeach class.
12604 2005-05-03 Raja R Harinath <rharinath@novell.com>
12606 * pending.cs (BaseImplements): Move the #74773 fix here. This is
12608 (VerifyPendingMethods): Revert change below.
12610 * typemanager.cs (IsOverride, RegisterNonOverride): New.
12611 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12612 that used to trigger warning -28. Remove warning -28.
12613 * expression.cs (Invocation.OverloadResolve): Use
12614 TypeManager.IsOverride to distinguish override methods.
12617 * pending.cs (VerifyPendingMethods): If a base type implements the
12618 requested interface, don't bother checking individual methods of
12619 the base type. As a side-effect, this prevents the creation of
12620 unnecessary proxies.
12622 2005-05-02 Martin Baulig <martin@ximian.com>
12626 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12627 Also `And' the locals if the old vector is null.
12628 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12629 null; in this case we basically reset all the variables.
12631 2005-05-02 Martin Baulig <martin@ximian.com>
12635 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12636 Added `FlowBranching branching' argument; always `and' the
12637 variables instead of `or'ing them unless we're an infinite loop.
12639 * statement.cs (While.Resolve): Create a new sibling unless we're
12642 2005-05-02 Martin Baulig <martin@ximian.com>
12646 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12647 arguments; use it instead of creating a new TopLevelBlock.
12648 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12649 our ConstructorInitializer.
12652 (TopLevelBlock.TopLevelBranching): New public property.
12653 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12654 and create our `TopLevelBranching'.
12656 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12657 anonymous method host, use `block.TopLevelBranching' rather than
12658 creating a new branching.
12660 2005-04-20 Miguel de Icaza <miguel@novell.com>
12662 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12663 a ScopeInfo, if any of the current children is a child of the new
12664 entry, move those children there.
12666 2005-04-30 Martin Baulig <martin@ximian.com>
12668 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12669 at the beginning of a SwitchSection. Fix #73335.
12671 2005-04-27 Marek Safar <marek.safar@seznam.cz>
12674 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12676 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12677 (FieldExpr.DoResolve): Obsolete members are ignored for field
12680 2005-04-26 Marek Safar <marek.safar@seznam.cz>
12682 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12683 of arrays detection.
12685 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12687 (Field.VerifyClsCompliance): Volatile fields are not compliant.
12689 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12692 2005-04-25 Ben Maurer <bmaurer@ximian.com>
12694 * cs-parser.jay: Use the prefered version of -unsafe in error
12697 2005-04-22 Marek Safar <marek.safar@seznam.cz>
12699 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12702 2005-04-20 John Luke <john.luke@gmail.com>
12704 * driver.cs: fix typo in error message, --outout to --output
12706 2005-04-20 Marek Safar <marek.safar@seznam.cz>
12708 * codegen.cs (InRefOutArgumentResolving): New field.
12710 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12711 fields outside contructor.
12713 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12715 2005-04-19 Miguel de Icaza <miguel@novell.com>
12717 * anonymous.cs (CaptureContext.EmitParameterInstance): The
12718 parameter code was not completed ever, so it was not as up-to-date
12719 as local variables. Must finish it.
12721 The bug fix was to compare the Toplevel of the block, not the
12722 current block. Thanks for Ben for pointing this out.
12724 2005-04-19 Raja R Harinath <rharinath@novell.com>
12726 * decl.cs (AddMethods): Use the declaring type of the problem
12727 method to determine if we want to squash a warning.
12729 2005-04-19 Marek Safar <marek.safar@seznam.cz>
12731 * attribute.cs: Removed debug output.
12733 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12735 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12738 2005-04-18 Raja R Harinath <rharinath@novell.com>
12741 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12742 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12743 all null comparisons against reference types.
12745 2005-04-18 Marek Safar <marek.safar@seznam.cz>
12748 * class.cs (TypeContainer.CircularDepException) New nested
12750 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12751 (TypeContainer.DefineType): Removed error, reset InTransit before
12753 (Class.DefineType): Throw exception when is in Transit.
12754 Catch exception and report error.
12755 (Struct.DefineType): Throw exception when is in Transit.
12756 Catch exception and report error.
12757 (Interface.DefineType): Throw exception when is in Transit.
12758 Catch exception and report error.
12760 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12761 handle nested exception handlers.
12763 * flowanalysis.cs (InTryWithCatch): New method, search for try with
12766 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12767 InFinally and InCatch storage.
12769 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12770 (Catch.Resolve): Set and Restore ec.InCatch.
12771 (Try.Resolve): Set and Restore ec.InFinally.
12772 (Try.HasCatch): True when try has catch.
12774 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
12776 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12777 for the same event member, so exclude such cases from warning 419.
12780 2005-04-16 Miguel de Icaza <miguel@novell.com>
12782 * expression.cs (Binary.ResolveOperator): Apply patch from John
12783 Luke to fix bug 59864: operators &, | and ^ on enumerations
12784 require that the same enum type on both sides.
12786 * driver.cs: Add warnings to old flag usage, this is to assist
12787 people who produce Makefiles and hope that the Makefiles will be
12790 * class.cs (TypeContainer.EmitType): Moved the definition of the
12791 special $PRIVATE$ field from the resolve phase to the Emit phase.
12792 During resolve we do not know if we are a struct with
12793 HasExplicitLayout, we know this only after the attributes for the
12796 Set the FieldOffset to zero on the dummy field that we create for
12797 the class. Fixes 74590.
12799 2005-04-16 Raja R Harinath <rharinath@novell.com>
12802 * ecore.cs (PropertyExpr.resolved): New.
12803 (DoResolve): Use it to handle a case of double resolution here.
12804 Handle a case of identical-name-and-type-name.
12805 * expression.cs (ArrayCreation.CheckIndices): Avoid double
12806 resolution by storing the results of expression resolution back
12807 into the "probes" array.
12809 2005-04-15 Raja R Harinath <rharinath@novell.com>
12811 Fix cs0208-7.cs and cs0208-8.cs.
12812 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12813 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
12814 error reporting to point out the reason a struct is not unmanaged.
12816 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12818 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
12819 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12821 2005-04-13 Raja R Harinath <rharinath@novell.com>
12824 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12825 IdenticalNameAndTypeName here.
12826 (EventExpr.InstanceResolve): Likewise.
12828 2005-04-13 Marek Safar <marek.safar@seznam.cz>
12830 C# 2.0 DefaultCharSetAttribute implementation
12832 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12833 which allows us to set GlobalNamespace for every resolve.
12834 (Attribute.ResolveArguments): Cut from Resolve.
12835 (Attribute.GetCharSetValue): Returns CharSet named argument.
12836 (Attribute.DefinePInvokeMethod): Gets default charset from
12838 (GlobalAttribute.ResolveAsTypeStep): Override.
12839 (GlobalAttribute.ResolveArguments): Override.
12841 * class.cs (TypeAttr): Is protected.
12843 * codegen.cs (ModuleClass.DefaultCharSet): New member.
12844 (ModuleClass.DefaultCharSetType): New memeber.
12845 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12847 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12848 charset from module.
12850 * delegate.cs (TypeAttr): Override.
12851 (Delegate.DefineType): Use this TypeAttr.
12853 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12854 at very early stage (before types are defined) to resolve model
12855 module attributes. It will probably not work with corlib but it
12858 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12859 charset from module.
12861 * typemanager.cs (default_charset_type): New type.
12863 2005-04-13 Raja R Harinath <rharinath@novell.com>
12865 * decl.cs (MemberCache.AddMethods): Don't warn if
12866 System.Object.Finalize has buggy MethodAttributes.
12868 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12871 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12873 * doc.cs : detect ambiguous reference to overloaded members.
12874 Fixed bug #71603. MS 1.1 csc does not detect it.
12876 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12878 * doc.cs : delegates must not be referenced with parameters.
12881 2005-04-12 Miguel de Icaza <miguel@novell.com>
12883 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12885 2005-04-10 Miguel de Icaza <miguel@novell.com>
12887 * driver.cs (MainDriver): Stop processing if the CLS stage found
12890 (CompilerCallableEntryPoint.InvokeCompiler): Always
12891 reset after execution; Take a TextWriter argument for the
12894 * report.cs: Use the error stream instead of hardcoding stderr.
12896 2005-04-09 Miguel de Icaza <miguel@novell.com>
12898 * class.cs: Reduce code paths to test, too small of an
12899 optimization to make it worth the extra testing. Always perform
12902 2005-04-08 Raja R Harinath <rharinath@novell.com>
12905 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12906 operators that had errors reported on them.
12908 2005-04-08 Marek Safar <marek.safar@seznam.cz>
12910 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12912 (Attribute.Resolve): Add named argument type checking.
12914 * class.cs (FixedField.Define): Use IsPrimitiveType
12916 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12918 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12919 unsafe parameter types.
12921 * statement.cs (Using.ResolveExpression): Add better error description.
12923 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12925 2005-04-08 Raja R Harinath <rharinath@novell.com>
12928 * attribute.cs (Attribute.GetAttributeUsage): Resolve
12929 AttributeUsageAttribute in the emitcontext of the attribute class,
12930 not in the emitcontext of the attributable entity it was attached to.
12931 * cs-parser.jay: Use 'current_class', not 'current_container',
12932 when creating a GlobalAttribute.
12934 2005-04-08 Alp Toker <alp@atoker.com>
12936 * pending.cs: The fix to #58413 failed to compile methods implementing
12937 interfaces with/without params modifiers and vice versa, even though
12938 params modifiers aren't part of the signature. Make the modifier check
12939 less strict as in csc.
12941 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
12942 Anoob V E <projectmonokochi@rediffmail.com>
12943 Harilal P R <projectmonokochi@rediffmail.com>
12946 * pending.cs (TypeAndMethods.mods): New. Store the parameter
12947 modifiers of pending methods.
12948 (PendingImplementation.PendingImplementation): Initialize it.
12949 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12950 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12951 with ParameterData. Add check for modifiers.
12952 * class.cs (MethodData.Define): Update to changes.
12954 2005-04-07 Raja R Harinath <rharinath@novell.com>
12956 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12958 2005-04-07 Marek Safar <marek.safar@seznam.cz>
12960 * class.cs (PropertyMethod.Define): Check private accessor in abstract
12963 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12966 * typemanager.cs: Registered RequiredAttributeAttribute.
12968 2005-04-06 Marek Safar <marek.safar@seznam.cz>
12970 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12971 Warning CS0169 is back at level 3.
12972 (IMethodData.SetMemberIsUsed): New method.
12974 * decl.cs (IsUsed): New value; moved from FieldBase.Status
12975 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12977 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12979 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12981 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12984 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12987 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12988 to avoid the problems with nested types.
12990 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12991 Anoob V.E <projectmonokochi@rediffmail.com>
12992 Harilal P.R <projectmonokochi@rediffmail.com>
12993 Raja R Harinath <rharinath@novell.com>
12996 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12998 * typemanager (GetConstructor): Make public.
13000 2005-04-05 John Luke <john.luke@gmail.com>
13001 Raja R Harinath <rharinath@novell.com>
13004 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
13005 struct too. Return false quicker in a few cases.
13006 (VerifyUnManaged): Use it.
13008 2005-04-05 Raja R Harinath <rharinath@novell.com>
13011 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
13012 not 'unreachable_seen'.
13014 2005-04-04 Marek Safar <marek.safar@seznam.cz>
13016 * attribute.cs (Attribute.GetValue): Removed unused.
13018 * codegen.cs (CodeGen.TrimExt): Removed unused.
13020 * cs-parser.jay (output): Removed unused.
13022 * cs-tokenizer.cs (hex_digits): Removed unused.
13024 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
13026 * expression.cs (Indirection.LoadExprValue): Removed unused.
13027 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
13029 * iterators.cs (Iterator.param_types): Removed unused.
13031 * statement.cs (Goto.block): Removed unused.
13032 (ToplevelBlock.did): Removed unused.
13033 (Switch.ResolveConstantSwitch): Removed unused.
13035 2005-04-01 Ben Maurer <bmaurer@ximian.com>
13037 * rootcontext.cs: Allow mcs to bootstrap with the compilation
13040 2005-04-01 Raja R Harinath <rharinath@novell.com>
13042 Fix #74232 and cs0208-3.cs.
13043 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
13044 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
13045 unmanaged type. Don't use FieldBuilders when 't' is a
13046 TypeBuilder. Use ModFlags and MemberType fields.
13047 * class.cs (MemberBase.member_type): Rename from MemberType.
13048 (MemberBase.MemberType): New property. Determines member_type on
13050 (MemberBase.DoDefine): Don't initialize MemberType here.
13051 (FieldMember.Define): Likewise.
13053 2005-04-01 Marek Safar <marek.safar@seznam.cz>
13056 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
13057 Attributes are emitted there.
13059 2005-04-01 Raja R Harinath <rharinath@novell.com>
13061 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
13062 keyword in 'partial enum' too.
13063 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
13065 Report from Kamil Skalski <nazgul@omega.pl>.
13068 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
13069 have partial containers too.
13071 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
13072 in block' checks to Block.CheckInvariantMeaningInBlock.
13073 * statement.cs (Block.GetKnownVariableInfo): Make private.
13074 (Block.IsVariableUsedInChildBlock): Remove.
13075 (Block.IsVariableUsedInBlock): Likewise.
13076 (Block.CheckInvariantMeaningInBlock): New. Show location of
13077 conflicting declaration.
13078 (Block.AddVariable): Make error messages less long-winded and more
13079 specific. Show location of conflicting declaration.
13080 * parameter.cs (Parameters.Location): New readonly property.
13082 2005-03-31 Raja R Harinath <rharinath@novell.com>
13084 Clean up semantics of invoking ResolveMemberAccess.
13085 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
13086 can have an instance, ensure that we pass in a non-TypeExpression
13087 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
13088 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
13089 argument. Update to changes and simplify.
13090 (FieldExpr.Emitinstance): Remove CS0120 check.
13091 (PropertyExpr.EmitInstance): Likewise.
13092 * expression.cs (Argument.Resolve): Likewise.
13093 (Invocation.DoResolve): Update to changes in semantics of
13094 InstanceExpression.
13096 2005-03-31 Marek Safar <marek.safar@seznam.cz>
13099 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
13102 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
13104 2005-03-31 Raja R Harinath <rharinath@novell.com>
13106 Fix difference in behaviour with commandline invocation.
13107 * driver.cs (Driver.Reset): New.
13108 (CompilerCallableEntryPoint): Call it.
13110 * statement.cs (If.Resolve): Avoid spurious "uninitialized
13111 variable" warnings if the boolean expression failed to resolve.
13113 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
13115 * attribute.cs: Fix the union of several permissions when some of them
13116 are unrestricted (so the result isn't an unrestricted permission set).
13119 2005-03-30 Raja R Harinath <rharinath@novell.com>
13121 * ecore.cs (MemberExpr): New class. Convert from interface
13123 (MemberExpr.ResolveMemberAccess): Refactor and move here from
13124 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
13126 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
13127 (MethodGroupExpr.IsExplicitImpl): Remove.
13128 (Expression.GetFieldFromEvent): Remove.
13129 (SimpleName.MemberStaticCheck): Remove.
13130 (SimpleName.DoSimpleNameResolve): Update to changes.
13131 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
13132 (MemberAccess.IdenticalNameAndTypeName): Remove.
13133 (MemberAccess.error176): Move to MemberExpr.
13134 (MemberAccess.DoResolve): Update to changes.
13135 (BaseAccess.DoResolve): Likewise.
13137 2005-03-30 Marek Safar <marek.safar@seznam.cz>
13139 C# 2.0 Conditional attribute class implementation
13141 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
13142 Analyzes class whether it has attribute which has ConditionalAttribute
13143 and its condition is not defined.
13145 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
13146 (Class.IsExcluded): New method. Search for at least one defined
13147 condition in ConditionalAttribute of attribute class.
13149 2005-03-30 Raja R Harinath <rharinath@novell.com>
13151 * ecore.cs (PropertyExpr): Derive from Expression, not
13152 ExpressionStatement.
13153 (PropertyExpr.EmitStatement): Remove.
13155 2005-03-29 Raja R Harinath <rharinath@novell.com>
13158 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
13159 internal field "value__" of an enum be private. The examples for
13160 "value__" that I found on MSDN all used FieldAttributes.Private.
13162 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
13163 Don't mention IL method attribute names.
13165 Fix #47991. Remove a TODO.
13166 * statement.cs (Block.Toplevel): Make into a field.
13167 (Block.Parameters): Move into ToplevelBlock.
13168 (Block.known_variables): Rename from child_variable_names.
13169 (Block.Block): Remove variants that take Parameters. Initialize
13170 'Toplevel' with the immediately surrounding toplevel block.
13171 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
13172 LocalInfo parameter.
13173 (Block.GetKnownVariableInfo): New.
13174 (Block.IsVariableNameUsedInChildBlock): Update.
13175 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
13176 the block, even though it may not be in scope.
13177 (Block.AddVariable): Remove Parameters parameter. Use
13178 Toplevel.Parameters instead.
13179 (Block.AddConstant): Remove Parameters parameter.
13180 (Block.GetParameterReference): Update to use Toplevel.Parameters.
13181 (Block.IsParamaterReference): Likewise.
13182 (Block.IsLocalParameter): Likewise. Simplify a lot.
13183 (ToplevelBlock.Parameters): New. Moved from Block.
13184 (ToplevelBlock.ToplevelBlock): Update to changes. Always
13185 initialize Parameters to a non-null value.
13186 * cs-parser.jay: Update to changes.
13187 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
13188 simple names that mean different things in the same block. Use
13189 Block.IsVariableNameUsedInBlock.
13191 2005-03-28 Raja R Harinath <rharinath@novell.com>
13193 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
13194 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
13195 GetTypeHandle. It is possible for a reflected type to derive from
13196 a TypeBuilder (e.g., int[] derives from the TypeBuilder
13197 System.Array during mscorlib compilation).
13198 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
13199 contain a method_hash, don't create one either. Don't create a
13200 deep copy of the base cache's method_hash.
13201 (MemberCache.SetupCache): Rename back from DeepCopy.
13202 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
13203 already initialized. If we see an override function, add its
13204 underlying base virtual function to the member_hash too.
13206 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
13208 2005-03-26 Raja R Harinath <harinath@acm.org>
13211 * assign.cs (Assign.DoResolve): When the RHS of an assignment
13212 fails to resolve, ensure that the LHS is still resolved as an
13215 2005-03-25 Raja R Harinath <harinath@acm.org>
13217 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
13219 (Enum.current_ec): Remove.
13220 (Enum.LookupEnumValue): Remove EmitContext argument.
13221 Just uses the one created during DefineType.
13222 (Enum.FindMembers): Update.
13223 * expression.cs (MemberAccess.DoResolve): Update.
13225 2005-03-22 Marek Safar <marek.safar@seznam.cz>
13227 * assign.cs (Assign.DoResolve): Check for CS1717 when
13228 source and target are same (uses Equals).
13230 * expression.cs (LocalVariableReference, ParameterReference,
13231 This): Implemented Equals, GetHashCode.
13233 * statement.cs (Block.GetParameterReference): Removed useless
13236 2005-03-22 Raja R Harinath <rharinath@novell.com>
13239 * statement.cs (Block.AddVariable): Ensure that we skip implicit
13240 blocks before deciding whether the error is cs0136 or cs0128.
13242 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
13243 (using_alias_directive, using_namespace_directive): Pass
13244 MemberName, not an expression to Namespace.UsingAlias and
13246 (MakeName): Use the MemberName of the namespace.
13247 * namespace.cs (Namespace.MemberName): New.
13248 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
13249 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
13251 * decl.cs (MemberName.Name): Make readonly.
13252 (MemberName.FromDotted): New "constructor".
13253 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
13254 (MemberCore.Name): Compute from MemberName on demand.
13255 (MemberCore.SetMemberName): Provide a way to change the
13257 (MemberCore.AddToContainer): Don't take a fullname parameter.
13258 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
13259 fully qualified name of the container to the member name.
13260 (TypeContainer.AddToTypeContainer): Use a fully qualified name
13261 only if the type is a member of the root container.
13262 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
13263 MemberName.Left rather than searching for an embedded ".".
13264 (PartialContainer.CreatePart): Update to changes in RootContext.
13265 (MemberBase.ShortName): Turn into a property. Use
13266 MemberCore.SetMemberName.
13267 (MemberBase.ExplicitInterfaceName): Remove.
13268 (MemberBase.UpdateMemberName): Remove.
13269 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
13270 (PropertyBase.SetMemberName): New override.
13271 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
13272 (Tree.GetDecl): New.
13273 (Tree.AllDecls): Rename from Decls.
13274 * attribute.cs, enum.cs, report.cs: Update to changes.
13275 * driver.cs (MainDriver): Use MemberName.FromDotted on
13276 RootContext.MainClass.
13278 2005-03-21 Marek Safar <marek.safar@seznam.cz>
13280 * class.cs (FixedField.Define): Check for CS1664 and more sanity
13283 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
13285 2005-03-18 Marek Safar <marek.safar@seznam.cz>
13287 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
13288 property accessor modifiers.
13290 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
13291 fixed buffer attribute (CS1716).
13292 (PropertyMethod.HasCustomAccessModifier): When property accessor
13293 has custom modifier.
13295 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
13297 (PropertyExpr.DoResolveLValue): Add CS0272.
13299 2005-03-17 Miguel de Icaza <miguel@novell.com>
13301 * convert.cs: When converting to a pointer, use the proper Conv.U
13302 or Conv.I depending on the source data type.
13304 * cs-tokenizer.cs: Make the size for large decimal constants,
13307 2005-03-17 Martin Baulig <martin@ximian.com>
13309 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
13310 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
13312 2005-03-17 Martin Baulig <martin@ximian.com>
13314 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
13315 to bool so we can return an error condition.
13316 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
13319 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
13321 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
13324 2005-03-16 Raja R Harinath <rharinath@novell.com>
13326 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
13327 Refactor to avoid traversing the list of assemblies, and to avoid
13328 string concatenation.
13329 * typemanager.cs (guid_attr_type): Remove.
13330 (negative_hits, pointers, references): Remove hashes.
13332 (GetConstructedType): New. Uses type_hash to handle constructed
13333 types (arrays, references, pointers).
13334 (GetReferenceType, GetPointerType): Use it.
13335 (GetNestedType): New. Uses type_hash to handle nested types of
13337 (LookupType, LookupTypeDirect): Remove.
13338 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
13339 'types' hash and LookupTypeReflection directly.
13340 (params_string, params_object): Use GetConstructedType.
13341 * namespace.cs (Namespace.cached_types): New. Cache of reflected
13343 (Namespace.Lookup): Use cached_types.
13344 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
13345 provided by old TypeManager.LookupType.
13346 * rootcontext.cs (MakeFQN): Remove.
13347 * decl.cs (DeclSpace.MakeFQN): Likewise.
13348 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
13349 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13350 TypeManager.GetConstructedType.
13351 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
13353 2005-03-15 Marek Safar <marek.safar@seznam.cz>
13355 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
13358 * cs-parser.jay: Reports CS1527 for any namespace element.
13360 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
13363 * expression.cs (ParameterReference.IsAssigned): Changed error to
13365 (Error_WrongNumArguments): Moved CS0245 detection here.
13367 * statement.cs (Return.Resolve): Add CS1622 report.
13369 2005-03-11 Marek Safar <marek.safar@seznam.cz>
13371 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
13373 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
13375 * attribute.cs expression.cs: Get rid of some allocations.
13377 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
13379 * doc.cs : just eliminate the latest change.
13381 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13383 * doc.cs : commented out the latest change. It breaks xml-030.cs
13385 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13387 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
13388 fail. So invoke CreateType() in FindDocumentedType().
13390 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13392 * cs-tokenizer.cs : added IsKeyword().
13393 * doc.cs : Detect keyword incorrectly used as identifier.
13394 Allow identifiers prefixed by @.
13396 2005-03-10 Marek Safar <marek.safar@seznam.cz>
13398 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13399 It caused exception in namespace resolving (again!).
13401 * class.cs (Class.ctor): Removed exit.
13402 (PropertyMethod.ctor): ditto.
13404 * codegen.cs (Codegen.Reset): Reset static data.
13405 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13407 * cs-tokenizer.cs (Cleanup): Removed.
13409 * driver.cs (GetSystemDir): Rewrote to one line command.
13410 It caused problem with unloaded dynamic modules.
13411 (UnixParseOption): Removed Exit.
13412 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13413 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13414 Now can be mcs used as library.
13416 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13419 * location.cs (Reset): Reset static data.
13421 * namespace.cs (Reset): Reset static data.
13423 * report.cs (Report.Reset): Reset static data.
13425 * rootcontext.cs (RootContext.Reset): Reset static data.
13427 * tree.cs (RootTypes.ctor): Use Location.Null
13429 * typemanager.cs (TypeManager.Reset): Reset static data.
13430 (CoreLookupType): Removed Exit.
13431 (TypeHandle.Reset): Reset static data.
13433 2005-03-10 Raja R Harinath <rharinath@novell.com>
13436 * typemanager.cs (ComputeNamespaces): Import namespaces from
13437 referenced modules too.
13439 2005-03-09 Raja R Harinath <rharinath@novell.com>
13441 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13444 2005-03-09 Raja R Harinath <rharinath@novell.com>
13446 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13447 enclosing DeclSpace. This ensures that a name-lookup populates
13448 more caches and there are fewer 'TypeExpression's. Carve out
13449 nested type lookup into ...
13450 (LookupNestedTypeInHierarchy): ... this.
13452 2005-03-09 Raja R Harinath <rharinath@novell.com>
13454 Clean up a few partial-class semantics.
13455 Fixes test-357.cs and cs1618-2.cs.
13456 * cs-parser.jay (struct_declaration): Use 'current_class' as
13457 parent of newly-created struct. Remove call to Register ().
13458 Use 'pop_current_class' to complete handing the current struct.
13459 (interface_declaration): Likewise.
13460 (class_declaration): Likewise.
13461 (enum_declaration): Use 'current_class' as parent of newly created
13463 (delegate_declaration): Likewise.
13464 (pop_current_class): New function. This is used to handle closing
13465 up the 'current_class' and 'current_container', and pointing them
13466 to the enclosing class/container.
13467 (CSharpParser): Initialize 'current_class' too.
13468 * decl.cs (MemberCore): Add check for invariant: a partial
13469 container is not a parsed entity, and thus does not enclose any
13471 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13472 (DeclSpace.BaseTypeExpr): Use it.
13473 (DeclSpace.LookupType): Add check for invariant.
13474 * class.cs (TypeContainer): Add check for invariant: a nested
13475 class should have the same NamespaceEntry as its enclosing class.
13476 (TypeContainer.EmitFieldInitializers): Make virtual.
13477 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13479 (TypeContainer.Register): Remove.
13480 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13481 null. Use TypeResolveEmitContext for resolving base types and
13482 interfaces. Move initialization of Parts.TypeBuilder here from
13484 (TypeContainer.DefineNestedTypes): ... here.
13485 (PartialContainer): Take a Namespace not a NamespaceEntry.
13486 (PartialContainer.Create): Don't use Register. Call the
13487 appropriate Add... function directly.
13488 (ClassPart): Take both the PartialContainer and the enclosing
13489 class as constructor arguments.
13490 (ClassPart.EmitFieldInitializers): Override.
13491 (ClassPart.PartFindNestedTypes): Remove.
13492 (FieldBase.GetInitializerExpression): Resolve the initializer
13493 expression in the emit context of the enclosing class.
13494 * tree.cs (RootTypes): Remove Register ().
13496 2005-03-08 Marek Safar <marek.safar@seznam.cz>
13498 * cs-parser.jay: Removed CS0134.
13500 * driver.cs: Removed CS1901.
13502 * expression.cs (SizeOf.DoResolve): Don't report CS0233
13503 for predefined types.
13505 2005-03-07 Duncan Mak <duncan@novell.com>
13507 * codegen.cs (Save): Catch UnauthorizedAccessException as
13508 well. Fixes bug #73454.
13510 2005-03-07 Marek Safar <marek.safar@seznam.cz>
13512 * cs-tokenizer.cs (xtoken): Add CS1035.
13514 * class.cs (MethodData.Define): Add CS0683.
13515 (FieldMember.ctor): Add CS0681.
13517 2005-03-07 Raja R Harinath <rharinath@novell.com>
13519 * ecore.cs (SimpleName.DoResolve): Rename from
13520 SimpleName.DoResolveAllowStatic.
13521 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13522 Pass 'intermediate' flag to MemberStaticCheck.
13523 (SimpleName.MemberStaticCheck): Skip "static check" only in case
13524 of "intermediate" lookups via MemberAccess.
13525 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
13526 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13528 2005-03-07 Raja R Harinath <rharinath@novell.com>
13531 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13532 slipped in because of variable names that are identical to a
13533 builtin type's BCL equivalent ('string String;', 'int Int32;').
13534 (PropertyExpr.EmitInstance): Likewise.
13536 2005-03-04 Marek Safar <marek.safar@seznam.cz>
13538 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13540 * report.cs (warning_ignore_table): Made public.
13542 2005-03-04 Raja R Harinath <rharinath@novell.com>
13545 * class.cs (MethodData.Emit): Pass 'container' to
13546 container.GetObsoleteAttribute instead of 'container.Parent'.
13548 2005-03-03 Marek Safar <marek.safar@seznam.cz>
13550 * cs-parser.jay: Add 1534 error test.
13552 * iterators.cs (Yield.CheckContext): Add error 1629.
13553 (Iterator.ctor): Save unsafe modifier.
13554 (MoveNextMethod.DoEmit): Restore unsafe context.
13556 * namespace.cs (UsingAlias): Better error message.
13558 2005-03-03 Dan Winship <danw@novell.com>
13560 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13561 the warning message [#73219]
13563 2005-03-03 Raja R Harinath <rharinath@novell.com>
13565 Fix compile with MCS 1.0.0.0.
13566 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13567 w_restore to not depend on string constant folding.
13569 2005-03-03 Raja R Harinath <rharinath@novell.com>
13571 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
13572 CS0246 check to users who passed 'silent = false'.
13573 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13575 (SimpleName.SimpleNameResolve): Update.
13576 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13577 (MemberAccess.IdenticalNameAndTypeName): Update.
13578 * doc.cs (FindDocumentedTypeNonArray): Update.
13580 2005-03-03 Raja R Harinath <rharinath@novell.com>
13582 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13583 * parameters.cs (ComputeAndDefineParameters): Remove.
13584 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13585 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13586 Use GetParameterInfo.
13588 2005-03-02 Marek Safar <marek.safar@seznam.cz>
13590 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13592 2005-03-02 Raja R Harinath <rharinath@novell.com>
13594 Unify DeclSpace.LookupType and DeclSpace.FindType.
13595 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
13596 is in charge of defining nested types on demand.
13597 (DeclSpace.LookupType): Use it when the current_type is a
13598 TypeBuilder. Use LookupTypeDirect for reflected types.
13599 (DeclSpace.FindType): Remove.
13600 (DeclSpace.LookupInterfaceOrClass): Likewise.
13601 (DeclSpace.DefineTypeAndParents): Likewise.
13602 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13603 DeclSpace.LookupType.
13604 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13605 * typemanager.cs (LookupType): Simplify.
13606 (AddUserType): Remove type from negative_hits.
13607 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13608 * class.cs (TypeContainer.FindMembers): Move handling of nested
13610 (TypeContainer.FindMembers_NestedTypes): ... here.
13611 (TypeContainer.FindNestedType): Implement override.
13612 (ClassPart.FindNestedType): Delegate to PartialContainer.
13613 (ClassPart.PartFindNestedType): Looks up the nested types of the
13616 2005-03-02 Martin Baulig <martin@ximian.com>
13618 * class.cs (TypeContainer.DoDefineMembers): We also need a default
13619 static constructor in static classes.
13621 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
13623 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13624 sizeParamIndex is not specified.
13626 2005-03-01 Marek Safar <marek.safar@seznam.cz>
13629 * report.cs (WarningMessage.IsEnabled): Missing null check.
13631 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13633 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13634 in the fields and not in the properties.
13636 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
13638 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
13641 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13643 * attribute.cs: Small refactoring (improved robustness).
13644 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13645 (ValidateGuid): Removed.
13646 (Resolve): Removed referenced to above mentioned.
13647 (GetAttributeUsage): Made private and changed to work without
13649 (GetIndexerAttributeValue): Don't crash.
13650 (GetConditionalAttributeValue): Ditto.
13651 (GetClsCompliantAttributeValue): Ditto.
13652 (ExtractSecurityPermissionSet): All attributes exceptions are
13654 (GetPropertyValue): New helper.
13655 (GetMethodImplOptions): New method.
13656 (DefinePInvokeMethod): Reuse common code. Implemented handling of
13657 some missing properties.
13659 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13660 (Method.ApplyAttributeBuilder): Updated.
13662 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13665 2005-02-28 Raja R Harinath <rharinath@novell.com>
13668 * report.cs (Report.SymbolRelatedToPreviousError): Handle
13669 non-simple types (array, pointer, reference).
13671 2005-02-28 Marek Safar <marek.safar@seznam.cz>
13673 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13675 * class.cs (MethodCore.IsDuplicateImplementation): Special error
13677 (Method.CheckBase): Catch wrong destructor here.
13678 (MethodData.Define): Add errors 550, 668.
13680 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13682 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13684 * pending.cs (VerifyPendingMethods): Add error 551.
13686 * typemanager.cs (CSharpName): Next error report helper.
13688 2005-02-25 Marek Safar <marek.safar@seznam.cz>
13690 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13691 attributes. Removed useless attribute double check.
13692 It saves almost 2MBs for corlib.
13694 2005-02-25 Raja R Harinath <rharinath@novell.com>
13697 * statement.cs (ExpressionStatement.Resolve): Make robust to being
13698 called twice in case of error.
13700 2005-02-23 Chris Toshok <toshok@ximian.com>
13702 Fix compiler portions of #72827.
13703 * statement.cs (Block.Emit): call Begin/EndScope on the
13704 EmitContext instead of the ILGenerator.
13706 * codegen.cs (EmitContext.BeginScope): new method, call
13707 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13709 (EmitContext.BeginScope): same, but EndScope and CloseScope
13711 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13712 offset and call the superclass's OpenScope(int) with it.
13713 (SymbolWriter.CloseScope): get the current il
13714 offset and call superclass's CloseScope(int) with it.
13716 2005-02-23 Marek Safar <marek.safar@seznam.cz>
13718 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13719 CS1677 for out and ref as well.
13721 * class.cs (Method.Define): Add error CS1599 detection.
13723 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13725 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13727 * delegate.cs (Delegate.Define): Add error CS1599 detection.
13729 * support.cs.cs (ModifierDesc): New helper method.
13731 2005-02-23 Raja R Harinath <rharinath@novell.com>
13732 Abin Thomas <projectmonokochi@rediffmail.com>
13733 Anoob V E <projectmonokochi@rediffmail.com>
13734 Harilal P R <projectmonokochi@rediffmail.com>
13736 Fix #57851, #72718.
13737 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13738 MemberLookup (used for error reporting) actually returns a result.
13739 Fix error report number (122, not 112).
13741 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
13742 Anoob V E <projectmonokochi@rediffmail.com>
13743 Harilal P R <projectmonokochi@rediffmail.com>
13746 * pending.cs (PendingImplementation.GetAbstractMethods):
13747 Find NonPublic members too.
13749 2005-02-22 Marek Safar <marek.safar@seznam.cz>
13751 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13754 * class.cs (MethodCore.CheckMethodAgainstBase):
13755 Add error 239 report.
13757 2005-02-21 Raja R Harinath <rharinath@novell.com>
13760 * expression.cs (Invocation.IsApplicable): Make public.
13761 (Invocation.IsParamsMethodApplicable): Likewise.
13762 * delegate.cs (Delegate.VerifyApplicability): Don't use
13763 Invocation.VerifyArgumentCompat for parameter applicability
13764 testing. Use Invocation.IsApplicable and
13765 Invocation.IsParamsMethodApplicable.
13767 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13769 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13771 * class.cs (Operator.Define): Add error 217 report.
13773 2005-02-21 Raja R Harinath <rharinath@novell.com>
13775 * namespace.cs (UsingEntry.Resolve): Undo change below.
13777 2005-02-21 Raja R Harinath <rharinath@novell.com>
13780 * ecore.cs (Expression.MemberLookupFailed): Add argument to
13781 disable the error message when the extended MemberLookup also
13783 (Expression.MemberLookupFinal): Update.
13784 (SimpleName.DoSimpleNameResolve): Update.
13785 * expression.cs (MemberAccess.ResolveNamespaceOrType):
13786 Don't use MemberLookupFinal.
13787 (New.DoResolve): Update.
13788 (BaseAccess.CommonResolve): Update.
13790 2005-02-21 Raja R Harinath <rharinath@novell.com>
13793 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13794 occured previously, don't resolve again.
13796 2005-02-21 Marek Safar <marek.safar@seznam.cz>
13799 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13800 argument. Call ResolveAttributeUsage for unresolved.
13801 when types doesn't match ctor arguments.
13803 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13804 for nested attribute classes.
13805 (Class.attribute_usage): Removed.
13806 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13807 for attribute class.
13809 * ecore.cs (IsAttribute): Removed.
13811 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13813 * rootcontext.cs (RegisterAttribute): Removed, attributes are
13815 (attribute_types): Removed.
13816 (EmitCode): Global attributes are emited as the latest.
13818 2005-02-18 Marek Safar <marek.safar@seznam.cz>
13820 * class.cs (EmitFieldInitializers): Don't emit field initializer
13821 for default values when optimilization is on.
13823 * constant.cs (Constant.IsDefaultValue): New property.
13825 * driver.cs: Add /optimize handling.
13829 * literal.cs: Implement new IsDefaultValue property.
13831 * rootcontext.cs (Optimize): New field, holds /optimize option.
13833 2005-02-18 Raja R Harinath <rharinath@novell.com>
13835 Fix crasher in re-opened #72347.
13836 * namespace.cs (Namespace.Lookup): Return null if
13837 DeclSpace.DefineType returns null.
13840 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13842 2005-02-18 Raja R Harinath <rharinath@novell.com>
13844 Fix remainder of #63202. Change semantics of DoResolveLValue: it
13845 now returns null if it cannot resolve to an lvalue.
13846 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13847 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13848 returned null. Remove check for SimpleName.
13849 (EventExpr.DoResolveLValue): New.
13850 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13851 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
13853 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
13854 avoid CS0131 error.
13855 (Unary.ResolveOperator): Move CS0211 check ...
13856 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
13858 (Unary.DoResolveLValue): Simplify.
13859 (AddressOf.DoResolveLValue): New.
13860 (ArrayAccess.DoResolveLValue): New.
13862 2005-02-16 Marek Safar <marek.safar@seznam.cz>
13864 * attribute.cs (Attribute.Resolve): Add arguments casting for
13865 when types doesn't match ctor arguments.
13867 2005-02-16 Raja R Harinath <rharinath@novell.com>
13869 Fix parts of #63202.
13870 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13871 lookup of operator in base type. Ensure that all checks happen
13872 when the operator resolves to an "op_..." method.
13874 2005-02-15 Raja R Harinath <rharinath@novell.com>
13877 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13878 'ignore_cs0104' parameter. Pass it to ...
13879 (NamespaceEntry.Lookup): ... this.
13880 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13881 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13882 (TypeLookupExpression.DoResolveAsTypeStep): Update.
13883 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13884 Update. Request that cs0104 errors be ignored.
13885 (ComposedCast.ResolveAsTypeStep): Update.
13887 2005-02-14 Raja R Harinath <rharinath@novell.com>
13890 * expression.cs (Invocation.BetterFunction): Remove support for
13891 comparing virtual functions and their overrides.
13892 (Invocation.IsOverride): New.
13893 (Invocation.OverloadResolve): Don't consider 'override' functions
13894 during candidate selection. Store them in a lookaside list.
13895 If the selected method is a 'virtual' function, use the list to
13896 find any overrides that are closer to the LHS type.
13898 2005-02-14 Marek Safar <marek.safar@seznam.cz>
13900 * expression.cs (New.DoResolve): Add complex core type reduction.
13901 (New.Constantify): Converts complex core type syntax like 'new int ()'
13902 to simple constant.
13904 2005-02-14 Raja R Harinath <rharinath@novell.com>
13906 * decl.cs (EntryType.EntryType): New constructor to create an
13907 updated copy of a cache entry.
13908 (MemberCache.AddMethods): Use it.
13909 (MemberCache.ClearDeclaredOnly): Remove.
13910 (MemberCache.MemberCache): Update.
13912 2005-02-11 Miguel de Icaza <miguel@novell.com>
13914 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13915 variable. This one is represents the actual low-level declaration
13916 of the method, as opposed to the semantic level `IsStatic'.
13918 An anonymous method which is hosted into a static method might be
13919 actually an instance method. IsStatic would reflect the
13920 container, while MethodIsStatic represents the actual code
13923 * expression.cs (ParameterReference): Use the new MethodIsStatic
13924 instead of IsStatic.
13926 * anonymous.cs (AnonymousMethod.Compatible): Pass the
13927 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13928 set on the current EmitContext.
13930 * expression.cs (Cast): Overload DoResolveLValue so we can pass
13931 resolve our casted expression as an LValue. This triggers the
13932 proper LValue processing that is later required by Assign.
13936 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13938 2005-02-11 Marek Safar <marek.safar@seznam.cz>
13940 C# 2.0 Fixed buffer implementation
13942 * anonymous.cs: Update after RegisterHelperClass renaming.
13944 * attribute.cs (AttributeTester.fixed_buffer_cache):
13945 Cache of external fixed buffers.
13946 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13947 implementation if field is fixed buffer else null.
13950 (TypeContainer.AddField): Accept FieldMember instead of Field.
13951 (FieldBase.IsFieldClsCompliant): Extracted code from
13952 VerifyClsCompliance descendant customization.
13953 (FixedField): New class handles fixed buffer fields.
13954 (FixedFieldExternal): Keeps information about imported fixed
13956 (IFixedField): Make access to internal or external fixed buffer
13959 * cs-parser.jay: Add fixed buffer parsing.
13961 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13964 * expression.cs (Indirection): Extended implementation to accept
13965 fixed buffer field.
13966 (PointerArithmetic.Emit): Get element from fixed buffer as well.
13967 (ElementAccess.MakePointerAccess): Get type as parameter.
13968 (DoResolve): Add fixed buffer field expression conversion.
13969 (DoResolveLValue): Ditto.
13970 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13971 (ArrayPtr): Derives from FixedBufferPtr.
13972 (ArrayPtr.Emit): Add extra emit for array elements.
13974 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13976 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13977 for compiler generated types.
13978 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13980 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13981 and consume less memory.
13982 (Fixed.Resolve): Add fixed buffer case.
13984 * typemanager.cs (compiler_generated_attr_ctor,
13985 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13986 (HasElementType): Add our own implementation to work on every
13989 2005-02-11 Miguel de Icaza <miguel@novell.com>
13991 * anonymous.cs (CaptureContext): Track whether `this' has been
13994 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13995 only captured `this' if it was implicitly done (instance
13996 methods/variables were used).
13998 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13999 `this' must be captured.
14001 2005-01-30 Miguel de Icaza <miguel@novell.com>
14003 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
14004 is null it means that there has been no need to capture anything,
14005 so we just create a sibling.
14007 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
14009 Just a partial fix. The other half is fairly elusive.
14011 2005-02-10 Raja R Harinath <rharinath@novell.com>
14013 Fix #52586, cs0121-4.cs.
14014 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
14015 and return a hashtable.
14016 (MemberCache.ClearDeclaredOnly): New.
14017 (MemberCache.MemberCache): Update to change. Make a deep copy of
14018 the method_hash of a base type too.
14019 (MemberCache.AddMethods): Adapt to having a deep copy of the base
14020 type methods. Overwrite entries with the same MethodHandle so
14021 that the ReflectedType is correct. The process leaves in base
14022 virtual functions and their overrides as distinct entries.
14023 (CacheEntry): Now a class instead of a struct. It shouldn't alter
14024 matters since it was boxed in a ArrayList before.
14025 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
14027 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
14028 case of a virtual function and its override (choose the overload
14030 (Invocation.OverloadResolve): Avoid 'override' members during
14031 'applicable_type' calculation.
14033 2005-02-09 Raja R Harinath <rharinath@novell.com>
14035 Combine two near-redundant caches.
14036 * typemanager.cs (method_params): Rename from method_internal_params.
14037 (TypeManager.GetParameterData): New. Replace
14038 Invocation.GetParameterData.
14039 (TypeManager.LookupParametersByBuilder): Remove.
14040 * expression.cs (Invocation.method_parameter_cache): Remove.
14041 (Invocation.GetParameterData): Remove.
14043 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
14046 2005-02-08 Raja R Harinath <rharinath@novell.com>
14049 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
14050 TypeManager.multicast_delegate_type is null, resolve it by looking
14051 up "System.MulticastDelegate".
14052 * rootcontext.cs (RootContext.ResolveCore): Simplify.
14054 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
14055 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
14056 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
14059 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
14060 (LabeledStatement.AddReference): New. Set 'referenced'.
14061 (Goto.Resolve): Use it.
14063 2005-02-05 John Luke <john.luke@gmail.com>
14065 * driver.cs: remove duplicate -doc line in Usage ()
14067 2005-02-04 Raja R Harinath <rharinath@novell.com>
14069 * location.cs (Location.AddFile): Fix CS2002 error report.
14071 2005-02-02 Martin Baulig <martin@ximian.com>
14073 * delegate.cs (Delegate.DefineType): Report an internal error if
14074 TypeManager.multicast_delegate_type is null. See bug #72015 for
14077 2005-02-02 Raja R Harinath <rharinath@novell.com>
14079 Fix a crasher in a variant of #31984.
14080 * const.cs (Constant.CheckBase): New override that defers the
14081 new-or-override check in case the base type hasn't been populated
14083 (Constant.Define): Ensure the new-or-override check is performed.
14085 2005-02-01 Duncan Mak <duncan@ximian.com>
14087 * const.cs (LookupConstantValue): Check that `ce' is not null
14088 before calling GetValue ().
14090 2005-02-01 Raja R Harinath <rharinath@novell.com>
14092 Fix test-334.cs (#69519).
14093 * cs-parser.jay (using_alias_directive): Pass in an expression to
14094 NamespaceEntry.UsingAlias.
14095 (using_namespace_directive): Pass in an expression to
14096 NamespaceEntry.Using.
14097 (namespace_name): Don't flatten to a string.
14098 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
14099 (NamespaceEntry.AliasEntry.Resolve): Lookup using
14101 (NamespaceEntry.UsingEntry): Likewise.
14102 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
14104 (NamespaceEntry.LookupForUsing): Remove.
14105 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
14107 (NamespaceEntry.Lookup): Remove support for dotted names.
14109 2005-02-01 Raja R Harinath <rharinath@novell.com>
14111 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
14113 (NamespaceEntry.ImplicitParent): Compute on demand.
14114 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
14115 parallels the current.
14116 (NamespaceEntry.LookupForUsing): Use it.
14117 (NamespaceEntry.Lookup): If the current namespace-entry is
14118 implicit, don't search aliases and using tables.
14120 2005-02-01 Raja R Harinath <rharinath@novell.com>
14123 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
14125 (TypeContainer.BaseCache): Compute on demand.
14126 (TypeContainer.FindMembers): Define constants and types if they're
14127 not already created.
14128 (FieldMember.Define): Move resetting of ec.InUnsafe before error
14130 * const.cs (Constant.Define): Make idempotent.
14132 2005-01-29 Miguel de Icaza <miguel@novell.com>
14134 * pending.cs: Produce better code (no nops produced by using Ldarg
14137 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
14138 i - 1' it should be arg + 1.
14142 2005-01-28 Raja R Harinath <rharinath@novell.com>
14144 * attribute.cs (Attribute.CheckAttributeType): Make private
14146 (Attribute.ResolveType): Make virtual.
14147 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
14148 handling of RootContext.Tree.Types.
14150 2005-01-27 Raja R Harinath <rharinath@novell.com>
14152 Update attribute-handling to use the SimpleName/MemberAccess
14154 * cs-parser.jay (attribute): Pass in an expression to the
14155 constructors of Attribute and GlobalAttribute.
14156 * attribute.cs (Attribute): Take an expression for the name.
14157 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
14158 passed in attribute name expression.
14159 (Attribute.CheckAttributeType): Use it.
14160 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
14161 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
14162 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
14163 argument to prevent error messages if the lookup fails.
14165 2005-01-27 Marek Safar <marek.safar@seznam.cz>
14167 * expression.cs (Indirection): Implemented IVariable interface
14168 to support indirection in AddressOf operator.
14169 (PointerArithmetic.Emit): Add optimalization for case where
14170 result can be precomputed.
14172 2005-01-26 Martin Baulig <martin@ximian.com>
14174 * class.cs (TypeContainer.AttributeTargets): Return the correct
14175 AttributeTargets depending on our `Kind' instead of throwing an
14176 exception; fixes #71632.
14178 2005-01-26 Marek Safar <marek.safar@seznam.cz>
14181 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
14184 2005-01-25 Raja R Harinath <rharinath@novell.com>
14187 * expression.cs (MemberAccess.DoResolve): Don't complain with
14188 cs0572 when the LHS of a member access has identical name and type
14191 2005-01-25 Marek Safar <marek.safar@seznam.cz>
14194 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
14196 Create custom PermissionSet only for PermissionSetAttribute.
14198 2005-01-24 Marek Safar <marek.safar@seznam.cz>
14201 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
14202 delegates in static class.
14204 2005-01-24 Martin Baulig <martin@ximian.com>
14206 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14207 merging an implicit block, just use its reachability.
14209 * statement.cs (Block.Resolve): Make the unreachable code check
14210 work wrt. implicit blocks; see test-337 from #63842.
14212 2005-01-21 Alp Toker <alp@atoker.com>
14214 * cs-parser.jay: destructor_declaration's container is PartialContainer
14215 not Class when partial types are used, so use Kind prop instead of
14218 2005-01-22 Miguel de Icaza <miguel@ximian.com>
14220 * cs-parser.jay: Improve error reporting when an interface
14221 declares new types.
14223 2005-01-20 Dick Porter <dick@ximian.com>
14225 * support.cs: SeekableStreamReader fix from Sandor Dobos
14226 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
14227 chars are read. Fixes bug 70369.
14229 2005-01-20 Raja R Harinath <rharinath@novell.com>
14231 * cs-parser.jay (catch_clause): Simplify current_block handling
14234 2005-01-17 Miguel de Icaza <miguel@ximian.com>
14236 * convert.cs (ImplicitStandardConversionExists): Synchronize the
14237 code with ImplicitStandardConversion to handle the implicit
14238 conversion of method groups into valid delegate invocations.
14240 The problem is that in parameter handling we were using this code
14241 path. Fixes bug #64698
14243 2005-01-19 Raja R Harinath <rharinath@novell.com>
14245 * cs-parser.jay: Fix several infelicities.
14246 - Avoid assigning to the parser value stack. Code like
14247 '$3 = null' is unclean. Synthesize a value for the code block
14249 - Avoid using oob_stack for storing location information. Use ...
14250 (_mark_): ... this. New (empty) rule. Saves the current location
14252 (foreach_statement): Avoid using oob_stack for current_block
14253 handling. Use technique used in for_statement and
14254 using_statement. Synthesize a value for the code block to store
14255 additional intermediate information.
14257 2005-01-13 Miguel de Icaza <miguel@ximian.com>
14259 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
14260 of a different type is only allowed to private fields of a
14261 containing type, not on fields of a base class.
14263 See test-174.cs and error cs0122-9.cs
14265 2005-01-13 Raja R Harinath <rharinath@novell.com>
14267 Fix test-335.cs (bug #58126).
14268 * cs-parser.jay (argument): Split out non-expression parts of the
14269 rule into 'non_simple_argument'.
14270 (invocation_expression): Support parenthesized invocations with
14271 multiple arguments, and with single non-simple arguments.
14273 2005-01-13 Raja R Harinath <rharinath@novell.com>
14275 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
14278 2005-01-12 Raja R Harinath <rharinath@novell.com>
14280 Fix cs0038-1.cs, cs1640-6.cs.
14281 * ecore.cs (Expression.Resolve): Remove special-case for
14282 SimpleName in error-handling.
14283 (Expression.almostMatchedMembers): Relax access permission to
14285 (Expression.MemberLookupFailed): Handle duplicates in
14286 almostMatchedMembers list.
14287 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
14288 * expression.cs (New.DoResolve): Report CS1540 for more cases.
14289 * typemanager.cs (GetFullNameSignature): Use the MethodBase
14290 overload if the passed in MemberInfo is a MethodBase.
14292 2005-01-12 Marek Safar <marek.safar@seznam.cz>
14295 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
14296 for non-CAS & merge permission sets properly.
14298 2005-01-11 Raja R Harinath <rharinath@novell.com>
14300 Improve standard-compliance of simple name and member access
14301 resolution. Fixes bugs #52697, #57200, #67520, #69519.
14302 * ecore.cs (FullNamedExpression): New abstract base class
14303 for Namespaces and TypeExpressions.
14304 (ResolveFlags.SimpleName): Remove.
14305 (SimpleName): Remove support for dotted names.
14306 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
14307 DeclSpace.FindType and DeclSpace.LookupType.
14308 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
14309 (Expression.ExprClassName): Make member function.
14310 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
14311 a namespace. Remove creation of dotted "SimpleName"s.
14312 (MemberAccess.DoResolve): Likewise.
14313 * decl.cs (DeclSpace.Cache): Make private.
14314 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
14315 (DeclSpace.FindType): Update.
14316 (DeclSpace.LookupType): Move here from RootContext. Return a
14317 FullNamedExpression.
14318 * namespace.cs (Namespace): Derive from FullNamedExpression
14319 so that it can be part of expression resolution.
14320 (Namespace.Lookup): Return an FullNamedExpression.
14321 (NamespaceEntry.LookupAlias): Lookup aliases only in current
14323 * rootcontext.cs (NamespaceLookup): Remove.
14324 (LookupType): Move to DeclSpace.
14325 * attribute.cs (CheckAttributeType): Update.
14326 * doc.cs (FindDocumentedType): Remove allowAlias argument.
14327 (FindDocumentedTypeNonArray): Likewise.
14329 2005-01-11 Raja R Harinath <rharinath@novell.com>
14331 Fix cs0509.cs, cs1632.cs.
14332 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
14333 is the same as IsInterface.
14334 (TypeContainer.GetClassBases): Likewise.
14335 * statement.cs (LabeledStatement.ig): New field.
14336 (LabeledStatement.LabelTarget): Save ILGenerator which created the
14338 (LabeledStatement.DoEmit): Check that the label was created with
14339 the same ILGenerator.
14341 2005-01-10 Marek Safar <marek.safar@seznam.cz>
14344 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
14345 accessors to its properties.
14347 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
14348 from accessors to property.
14350 2005-01-10 Marek Safar <marek.safar@seznam.cz>
14353 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
14354 only for overrides.
14356 2005-01-08 Miguel de Icaza <miguel@ximian.com>
14358 * attribute.cs: Check for null and empty strings.
14360 I have lost another battle to Paolo.
14362 2005-01-07 Marek Safar <marek.safar@seznam.cz>
14365 * class.cs (PropertyMethod): Set Parent field in ctors.
14366 (SetMethod.InternalParameters): Add unsafe switch hack.
14367 Override MarkForDuplicationCheck where it is appropriate.
14369 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
14370 It says whether container allows members with the same name.
14371 Base default is no.
14372 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
14373 Removed is_method parameter.
14375 2005-01-06 Duncan Mak <duncan@ximian.com>
14377 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
14378 because the previous change led to incorrect reporting of CS1032
14379 ("Cannot define/undefine preprocessor symbols after first token in
14380 file"). Instead of using `tokens_seen' as the only flag that
14381 triggers CS1040, introduce `comments_seen'. This new flag is used
14382 to signify having seen comments on the current line, so it is
14383 unset after a newline.
14385 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
14387 * doc.cs : When searching for a type, find nested type too.
14388 This fixes bug #71040.
14390 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
14393 - Warn missing member comment on those classes which also does not
14394 have doc comments. Fixed bug #71041.
14395 - Don't warn missing doc comment on default constructor.
14398 2005-01-06 Duncan Mak <duncan@ximian.com>
14400 * cs-tokenizer.cs (xtoken): After handling traditional C-style
14401 comments, set `tokens_seen' to true. This allows us to detect
14402 misplaced preprocessor directives (i.e. not at the beginning of
14403 the a line, nor after whitespaces). In that case, report error
14404 CS1040. This fixes bug #56460.
14406 * cs-parser.jay (interface_member_declaration): Add checks for
14407 IsExplicitImpl, and report CS0541 error if an interface member is
14408 defined as an explicit interface declaration.
14410 2005-01-06 Marek Safar <marek.safar@seznam.cz>
14413 * class.cs (PropertyMethod): Set Parent field in ctors.
14414 (SetMethod.InternalParameters): Add unsafe switch hack.
14416 * decl.cs (MemberCore.Parent): Cannot be readonly.
14418 2005-01-06 Raja R Harinath <rharinath@novell.com>
14420 * decl.cs (DeclSpace.ResolveType): Remove.
14421 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14422 Merge in code from ...
14423 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
14424 * class.cs, enum.cs: Update to changes.
14426 2005-01-06 Miguel de Icaza <miguel@ximian.com>
14428 * anonymous.cs: Ensure that we init the scope of our parent if it
14429 has not been initialized yet.
14431 2004-12-30 Duncan Mak <duncan@ximian.com>
14433 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14434 if field.FieldBuilder is null. Fixes #70758.
14436 * convert.cs: Fixed some typos and updated some of the comments.
14437 (ImplicitStandardConversionExists):
14438 (TryImplicitIntConversion): If `target_type' is an interface and
14439 the type of `ic' implements this interface, return true or a new
14440 BoxedCast instead of null. This fixes #70468.
14442 2004-12-29 Duncan Mak <duncan@ximian.com>
14444 * expression.cs (Argument.Emit): Check that Expr is
14445 IMemoryLocation before casting to it, and report CS1510 otherwise.
14449 2004-12-21 Ben Maurer <bmaurer@ximian.com>
14451 * statement.cs (Block.ThisVariable): remove the recursion here, to
14452 make the --profile more sane.
14454 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
14456 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14457 assembly, by JB Evain.
14459 2004-12-17 Raja R Harinath <rharinath@novell.com>
14461 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
14462 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14463 "parent" refers to enclosing type/class. "base" refers to superclass.
14465 2004-12-17 Raja R Harinath <rharinath@novell.com>
14467 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14468 Ensure that we only have GlobalAttributes.
14469 * attribute.cs (Attribute.Emit): Make non-virtual.
14470 (GlobalAttribute.Emit): Remove.
14471 (Attribute.Resolve): Make virtual.
14472 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
14473 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14474 the argument. Don't create one.
14475 (Attribute.GetObsoleteAttribute): Likewise.
14476 (Attribute.GetClsCompliantAttributeValue): Likewise.
14477 * class.cs, decl.cs: Update to changes.
14479 2004-12-17 Marek Safar <marek.safar@seznam.cz>
14481 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14483 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14485 * statement.cs (Foreach.Resolve): Add error 186 report.
14487 2004-12-16 Marek Safar <marek.safar@seznam.cz>
14489 * expression.cs (Conditional.DoResolve): Add warning 429.
14491 * statement.cs (If.Resolve): Add warning 665.
14493 2004-12-16 Raja R Harinath <rharinath@novell.com>
14495 New invariant: RootContext.Tree.Types.NamespaceEntry == null
14496 except when in the parser, and in GlobalAttribute.
14497 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14498 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14499 RootContext.Tree.Types.NamespaceEntry once work is done.
14500 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
14501 and resets RootContext.Tree.Types.NamespaceEntry.
14503 2004-12-15 Marek Safar <marek.safar@seznam.cz>
14505 * cs-parser.jay: Don't create a block for every variable.
14507 2004-12-14 Miguel de Icaza <miguel@ximian.com>
14509 * location.cs: Provide extra information.
14511 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14512 variables from the captured environment, it is the ldarg_0.
14514 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14516 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14519 * class.cs: Changed warning level for 169 to avoid developer
14520 displeasure from warning flooding. It will be changed back when they
14521 fix most of current BCL warnings.
14523 * RootContext.cs: Pushed default WarningLevel to 3.
14525 * statement.cs: Removed unused variable.
14527 2004-12-14 Marek Safar <marek.safar@seznam.cz>
14529 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14530 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14531 Add error 502 report.
14532 (StaticClass.DefineType): Add error 441 report.
14533 (Class.AllowedModifiersProp): New virtual property as temporary
14534 extension to AllowedModifiers.
14535 (Class.DefineType): Add error 418 report. Moved ModFlags check here
14536 to share implementation with StaticClass and don't call virtual
14539 * driver.cs (MainDriver): Add error 1558 test.
14541 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14542 report. Moved error 36 test here.
14544 * statement.cs (Throw.Resolve): Add error 724 report.
14546 * typemanager.cs: Add out_attribute_type core type.
14548 2004-12-13 Marek Safar <marek.safar@seznam.cz>
14550 * class.cs (TypeContainer.VerifyClsCompliance): Add error
14552 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14554 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14557 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14559 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
14560 Add error 3023 report.
14561 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14563 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14566 2004-12-12 John Luke <john.luke@gmail.com>
14568 * driver.cs (AddArgs): take -- into account when
14569 adding arguments, fixes bug 65710
14571 2004-12-12 Martin Baulig <martin@ximian.com>
14573 * expression.cs (Unary.TryReduceNegative): Added support for
14574 SByteConstant and ByteConstant.
14575 (Unary.Reduce): Check error values from TryReduceNegative().
14577 2004-12-10 Marek Safar <marek.safar@seznam.cz>
14579 * attributes.cs (Attribute.Resolve): Avoid multiple error report
14580 and report exception as error 182.
14582 2004-12-10 Raja R Harinath <rharinath@novell.com>
14584 * driver.cs (Main): Fix message when there are warnings.
14586 2004-12-09 Miguel de Icaza <miguel@ximian.com>
14588 * delegate.cs: Fixed my fix from yesterday, sorry about that.
14590 2004-12-09 Marek Safar <marek.safar@seznam.cz>
14592 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
14593 Reduced number of warnings.
14595 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14597 2004-12-08 Miguel de Icaza <miguel@ximian.com>
14599 * driver.cs: Removed message.
14601 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14603 2004-12-08 <vargaz@freemail.hu>
14605 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14607 2004-12-08 Martin Baulig <martin@ximian.com>
14609 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14610 instead of a CS3002 for properties and indexer.
14612 2004-12-08 Martin Baulig <martin@ximian.com>
14614 * decl.cs (MemberName.ToString): Make this work again.
14616 2004-12-08 Marek Safar <marek.safar@seznam.cz>
14618 * attribute.cs (Resolve): Add error 591 detection.
14620 * class.cs (FieldMember.Define): Add error 1547 detection.
14621 (Indexer.Define): Add error 620 detection.
14622 (Operator.Define): Add error 590 detection.
14624 * ecore.cs: Missing argument for error 79.
14626 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14629 2004-12-07 Marek Safar <marek.safar@seznam.cz>
14632 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14635 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
14637 * cs-parser.jay : handle doc comments on implicit/explicit operators.
14638 Some operator comments were suppressed.
14639 * doc.cs : Implicit/explicit operator name in doc comments are like
14640 "op_Explicit(type)~returnType", so added suffix handling.
14642 2004-12-07 Martin Baulig <martin@ximian.com>
14645 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14646 (MemberCore.GetClsCompliantAttributeValue): Likewise.
14647 (DeclSpace.ec): New protected field; store the EmitContext here.
14648 (DeclSpace.EmitContext): New public property; moved here from
14650 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14653 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14654 (Enum.Emit): Don't create a new EmitContext.
14656 * delegate.cs (Delegate.DefineType): Always create the
14659 * iterators.cs (Iterators.DefineIterator): Create a new
14660 EmitContext and store it in `ec'.
14662 2004-08-24 Martin Baulig <martin@ximian.com>
14665 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14666 this for accessibility checks.
14667 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14668 IsNestedFamilyAccessible.
14669 (TypeManager.IsSubclassOf): New method, do what the name actually
14672 2004-12-06 Raja R Harinath <rharinath@novell.com>
14674 Fix crash on cs0657-17.cs.
14675 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14676 Use RootContext.Tree.Types, not 'new RootTypes ()'.
14677 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14678 the case where the NamespaceEntry gets overwritten.
14680 2004-12-06 Marek Safar <marek.safar@seznam.cz>
14682 Fixed #69195, #56821
14683 * ecore.cs (ResolveBoolean): Tiny refactoring.
14685 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14686 of right expression resolving when left is false constant and
14687 operator is LogicalAnd OR true constant and operator is LogicalOr.
14689 * statement.cs (ResolveUnreachable): Always reports warning.
14691 2004-12-05 Miguel de Icaza <miguel@ximian.com>
14693 * class.cs: Distinguish between 1721 and 1722 (just a little help
14694 for the programmer).
14696 2004-12-03 Miguel de Icaza <miguel@ximian.com>
14698 * delegate.cs: Only allow this on new versions of the language.
14700 2004-12-02 Duncan Mak <duncan@ximian.com>
14702 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14704 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14705 here as a static method. Take an additional bool out parameter
14706 `must_do_cs1540_check' for signaling to InstanceResolve.
14707 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14708 member field from PropertyExpr class and made it an argument of
14709 the method instead.
14710 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14711 check for MarshalByRefObject, and report CS0122 instead of CS1540.
14712 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14713 and `remove_accessor' as well as InstanceResolve: report CS0122
14718 2004-12-03 Raja R Harinath <rharinath@novell.com>
14720 Fix test-327.cs, test-328.cs, and put in early infrastructure
14721 for eventually fixing #52697.
14722 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14723 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14724 from other methods.
14725 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14726 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14727 (VerifyUsing, error246): Update.
14728 * rootcontext.cs (RootContext.NamespaceLookup): Just use
14729 'NamespaceEntry.LookupNamespaceOrType'.
14731 2004-12-03 Martin Baulig <martin@ximian.com>
14733 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14734 method as our child, call AnonymousMethod.Compatible() on it.
14736 2004-12-03 Raja R Harinath <rharinath@novell.com>
14738 Disable XML documentation support in 'basic' profile.
14739 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14740 Redirect XmlElement to System.Object.
14741 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14742 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14743 * mcs.exe.sources: Add doc-bootstrap.cs.
14744 * doc-bootstrap.cs: New file. Contains empty stub implementation
14747 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
14749 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14750 comments are allowed.
14752 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14754 * delegate.cs: Add checks for subtypes in paramaters and return values
14755 in VerifyMethod () to add support for Covariance/Contravariance
14758 2004-12-02 Miguel de Icaza <miguel@ximian.com>
14760 * report.cs: Remove extra closing parenthesis.
14762 * convert.cs (Error_CannotImplicitConversion): If the name of the
14763 types are the same, provide some extra information.
14765 * class.cs (FieldBase): Use an unused bit field from the field to
14766 encode the `has_offset' property from the FieldMember. This saves
14767 a couple of Ks on bootstrap compilation.
14769 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14770 method as our child, return the AnonymousMethod resolved
14773 * expression.cs (New.DoResolve): Allow return values from
14774 NewDelegate to also include AnonymousMethods.
14778 2004-12-02 Marek Safar <marek.safar@seznam.cz>
14781 * attribute.cs (Resolve): Improved implementation of params
14782 attribute arguments.
14784 * support.cs (ParameterData): Add HasParams to be faster.
14786 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
14788 all things are for /doc support:
14790 * doc.cs: new file that supports XML documentation generation.
14791 * mcs.exe.sources: added doc.cs.
14793 Handle /doc command line option.
14794 Report error 2006 instead of 5 for missing file name for /doc.
14795 Generate XML documentation when required, after type resolution.
14797 Added support for picking up documentation (/// and /** ... */),
14798 including a new XmlCommentState enumeration.
14800 Added lines to fill Documentation element for field, constant,
14801 property, indexer, method, constructor, destructor, operator, event
14802 and class, struct, interface, delegate, enum.
14803 Added lines to warn incorrect comment.
14805 Added Documentation field (passed only when /doc was specified).
14807 Added DocComment, DocCommentHeader, GenerateDocComment() and
14808 OnGenerateDocComment() and some supporting private members for
14809 /doc feature to MemberCore.
14811 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14813 Added overriden DocCommentHeader.
14815 Added overriden DocCommentHeader and GenerateDocComment().
14817 2004-12-01 Miguel de Icaza <miguel@ximian.com>
14819 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14820 unwrapping the enumeration values, chain to
14821 DoConstantNumericPromotions again, so we can promote things to the
14822 fundamental types (takes care of enums that are bytes, sbytes).
14826 2004-12-01 Raja R Harinath <rharinath@novell.com>
14828 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14829 Fix long-standing bug in type-lookup. Use FindType instead of
14830 LookupType when ec.ResolvingTypeTree.
14831 (Attribute.ResolveType, Attribute.Resolve)
14832 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14834 (Attributes.Search): Remove internal version. Update.
14835 (Attributes.SearchMulti): Update.
14836 (Attributes.GetClsCompliantAttribute): Remove.
14837 (Attributes.GetIndexerNameAttribute): Remove.
14838 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14839 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14840 * class.cs (Indexer.Define): Likewise.
14842 2004-12-01 Marek Safar <marek.safar@seznam.cz>
14845 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14846 MarshallByReference members access.
14848 * expression.cs: Use CheckMarshallByRefAccess;
14849 Better error CS0197 message.
14851 * report.cs: Print whole related error message.
14853 2004-11-30 Raja R Harinath <rharinath@novell.com>
14855 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14856 the current directory to help debugging.
14858 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14860 * class (GetClassBases): Better error 60 report.
14861 (EventProperty): Disabled warning 67 detection.
14863 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14866 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14868 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14871 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14874 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14876 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14878 2004-11-26 Miguel de Icaza <miguel@ximian.com>
14880 * attribute.cs (Attribute.Resolve): Refine error reporting and
14881 report a cs0117 if the identifier does not exist, to distinguish
14882 from 0617 which is a miss-use of the actual identifier.
14884 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14885 between cs0070 and cs0079.
14887 * class.cs (MemberBase.DoDefine): When reporting a wrong
14888 accessibility level, we use MethodCore to compare instead of
14889 Method (this was a regression in some refactoring effort).
14891 So now we correctly report cs0056 again.
14893 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14894 testing the target_type (which was known to be object_type) and
14895 not the source type (which is anonymous_method).
14897 Fixed reporting of error cs1660.
14899 * expression.cs (UserCast.Source): Expose the underlying cast.
14901 * statement.cs (Switch.SwitchGoverningType): Sort the list of
14902 allowed types to find a match to int32 first (most common).
14904 In addition, it ignores any ImplicitUserConversions that did an
14905 internal implicit conversion (as the switch statement allows only
14906 one integral conversion to exist).
14908 * class.cs (PartialContainer.Create): rename `name' to
14909 `member_name' for clarity. Then replace the string calls with a
14910 call to MemberName.GetPartialName, as now using
14911 MemberName.ToString is an error (this is due to the side effects
14912 it had, that were fixed in the past).
14914 This will restore the error reporting on a number of partial class
14915 errors that were missusing this (and getting an exception as a
14916 results, which is now just a plain textual warning, because
14917 yyparse debug output would crash otherwise).
14919 2004-11-26 Raja R Harinath <rharinath@novell.com>
14921 * Makefile (PROGRAM_INSTALL_DIR): Remove.
14923 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14925 * rootcontext.cs (LookupType): Make sure to cache lookups that
14926 don't give us a negative result. This saves about 5% of corlib
14929 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14931 * report.cs (AbstractMessage.Print): messages are sent to stderr
14933 * class.cs (TypeContainer.GetClassBases): It is an error to have a
14934 non-interface in the list of interfaces (at this point, either
14935 parent was properly set, or a base class is being listed in the
14936 interfaces section).
14938 This flags error 1722, and resolves the crash from bug 69259.
14940 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14942 * statement.cs (Using.EmitExpressionFinally): make this work right
14943 for valuetypes. Fixes 69926.
14945 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14947 * const.cs (Const.ChangeType): Cope with the "0 literal can be
14948 converted to an enum" here, before we try to change the underlying
14949 type. This code exists, but it is a different code path than the
14950 one used while encoding constants.
14952 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14953 old bug: when converting from the null literal to a pointer,
14954 return an EmptyCast, not the NullLiteral.
14956 This fixes #69921, the recent null_type changes probably made this
14957 bug more prominent.
14959 (ImplicitReferenceConversionExists): In addition, resynchronized
14960 the code here, so it matches the same code in
14961 ImplicitReferenceConversionExists for the `from any class-type S
14962 to any interface-type T'.
14965 2004-11-25 Marek Safar <marek.safar@seznam.cz>
14967 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14969 2004-11-24 Miguel de Icaza <miguel@ximian.com>
14971 * cs-parser.jay: Use verbosity accordingly.
14973 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14975 * expression.cs (Unary.ResolveOperator): Do not report warning;
14976 AddressOf reads from variable.
14978 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14980 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14984 * attribute.cs (Attributable): Removed CheckTargets.
14985 (Attributes.Emit): Explicit attribute targets are tested here.
14987 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14988 not enabled for interfaces.
14990 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14991 (GetAssemblyName): Ouch next bug there.
14993 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14995 * expression.cs: Error 275 added.
14997 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14999 Fix bug #69177 (Implemented decimal constant support)
15001 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
15002 (BinaryFold): Add DecimalConstant.
15004 * const.cs (Define): Decimal constant
15006 (ChangeType): Add decimal type handling.
15007 (LookupConstantValue): Don't set value for decimal type but
15008 emit DecimalConstantAttribute. Needed for constant optimization.
15010 * constant.cs (ToDecimal): New method.
15011 (ConvertToDecimal): New method.
15012 (IntConstant): Implemented ConvertToDecimal.
15013 (DecimalConstant.Emit): Emit optimized version for decimals in
15016 * expression.cs (ResolveOperator): Changed order of constant
15017 reduction to work correctly with native types which have
15018 overloaded operators.
15019 (ResolveMemberAccess): Extract constant value from attribute
15022 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
15024 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
15025 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
15026 (ChangeType): Decimal is special.
15027 (TypeToCoreType): Add decimal type.
15029 2004-11-22 Marek Safar <marek.safar@seznam.cz>
15031 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
15034 2004-11-22 Marek Safar <marek.safar@seznam.cz>
15036 * class.cs (EventField.ApplyAttributeBuilder): Fix error
15039 2004-11-19 Marek Safar <marek.safar@seznam.cz>
15041 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
15043 * pending.cs (PendingImplementation): Grab only interfaces.
15045 2004-11-19 Marek Safar <marek.safar@seznam.cz>
15047 * statement.cs (ForeachHelperMethods): Add location member and
15048 error 202 detection.
15050 2004-11-19 Raja R Harinath <rharinath@novell.com>
15052 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
15053 automatically handled by executable.make.
15054 (PROGRAM): Make profile-specific.
15056 2004-11-18 Marek Safar <marek.safar@seznam.cz>
15058 * expression.cs (DoResolveBase): Fixed wrong warning for out
15061 2004-11-18 Martin Baulig <martin@ximian.com>
15063 Merged latest changes into gmcs. Please keep this comment in
15064 here, it makes it easier for me to see what changed in MCS since
15065 the last time I merged.
15067 2004-11-17 Raja R Harinath <rharinath@novell.com>
15069 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
15070 (TypeHandle.GetMemberCache): New.
15071 (TypeHandle.TypeHandle): Update.
15072 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
15073 (TypeManager.LookupParentInterfacesCache):
15074 Rename from LookupInterfaceCache. Optimize slightly.
15075 (TypeManager.MemberLookup_FindMembers): Update.
15076 * decl.cs (MemberCache.MemberCache): Set Container to null in the
15077 multi-type variant.
15078 (AddCacheContents): Rename from AddHashtable.
15079 * class.cs (TypeContainer.parent_container): Remove.
15080 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
15081 (TypeContainer.DoDefineMembers): Don't initialize it.
15082 Update to name changes.
15084 2004-11-17 Miguel de Icaza <miguel@ximian.com>
15086 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
15087 that factors the code to check access modifiers on override.
15089 (PropertyBase): Use the code here.
15091 Patch from Lluis S'anchez, fixes bug #69361.
15093 2004-11-15 Miguel de Icaza <miguel@ximian.com>
15095 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
15096 routine that is used to report the use of a captured variable
15097 whose address has been taken.
15099 There are two checks: one when variables are being captured and
15100 the other check is when the address of a variable is taken.
15102 (because an anonymous methods might be resolved before *or* after
15103 the address has been taken) and
15105 * expression.cs (Conditional.DoResolve): Remove the special
15106 casing that Martin added to trueExpr and falseExpr being both
15107 NullLiteral. We get the right behavior now just by introducing
15108 the null_type into the compiler.
15110 * convert.cs (ExplicitConversion): Change the code to use
15111 null_type instead of testing `expr is NullLiteral'.
15112 (ImplicitConversionStandard): use null_type too.
15113 (ImplicitReferenceConversionExists): use null_type too.
15114 (ImplicitReferenceConversion): use null_type too.
15116 * literal.cs: The type of `NullLiteral' is now null_type instead
15118 (Resolve): Set the type here.
15120 * typemanager.cs: Introduce null_type.
15122 2004-11-17 Martin Baulig <martin@ximian.com>
15124 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
15125 direction, like FindMembers() does. Fixes #69546, testcase is in
15128 2004-11-16 Martin Baulig <martin@ximian.com>
15130 This is based on a patch from Marek Safar, see bug #69082.
15131 Fixes bugs #63705 and #67130.
15133 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
15134 method; create a MemberCache for an interface type and cache the
15137 * decl.cs (IMemberContainer.ParentContainer): Removed.
15138 (IMemberContainer.ParentCache): New property.
15139 (MemberCache.SetupCacheForInterface): Removed.
15140 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
15141 to create a cache for an interface's "parent".
15143 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
15146 2004-11-16 Martin Baulig <martin@ximian.com>
15148 Merged back from gmcs; these changes already went into gmcs a
15149 couple of weeks ago.
15152 (TypeManager.AddUserType): Removed the `ifaces' argument.
15153 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
15155 (TypeManager.AddUserInterface): Removed.
15156 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
15158 (TypeManager.GetInterfaces): Likewise.
15159 (TypeManager.GetExplicitInterfaces): Likewise.
15161 * ecore.cs (TypeExpr.GetInterfaces): Removed.
15163 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
15164 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
15166 2004-11-14 Ben Maurer <bmaurer@ximian.com>
15168 * statement.cs: Avoid adding bools to a hashtable.
15170 2004-11-07 Miguel de Icaza <miguel@ximian.com>
15172 * expression.cs (Invocation.OverloadResolve): Flag error if we are
15173 calling an unsafe method from a safe location.
15175 2004-11-06 Marek Safar <marek.safar@seznam.cz>
15178 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
15180 2004-11-06 Miguel de Icaza <miguel@ximian.com>
15182 * namespace.cs (VerifyUsing): use GetPartialName instead of
15185 2004-11-05 Miguel de Icaza <miguel@ximian.com>
15187 * statement.cs (Return.Resolve): Fix regression in typo: if
15188 `in_exc', we have to request a NeedReturnLabel, this was a typo
15189 introduced in the anonymous method check-in. Fixes #69131.
15191 * Indexers were using the ShortName when defining themselves,
15192 causing a regression in the compiler bootstrap when applying the
15193 patch from 2004-11-02 (first part), now they use their full name
15194 and the bug is gone.
15196 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
15198 * driver.cs: Strip the path from the names of embedded resources. Fixes
15201 2004-11-04 Raja R Harinath <rharinath@novell.com>
15203 Fix error message regression: cs0104-2.cs.
15204 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
15205 (AliasEntry.Resolve): Update.
15206 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
15208 (RootContext.LookupType): Update.
15210 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
15212 * cs-parser.jay: Add support for handling accessor modifiers
15213 * class: Add support port accessor modifiers and error checking,
15214 define PropertyMethod.Define as virtual (not abstract anymore)
15215 * ecore.cs: Add checking for proeprties access with access modifiers
15216 * iterators.cs: Modify Accessor constructor call based in the modified
15218 2004-11-02 Ben Maurer <bmaurer@ximian.com>
15220 * expression.cs (StringConcat): Handle being called twice,
15221 as when we have a concat in a field init with more than two
15224 2004-11-02 Miguel de Icaza <miguel@ximian.com>
15226 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
15227 special case explicit implementations, we should always produce
15228 the .property or .event declaration.
15230 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
15231 since it will not return correct data if people use this
15232 unresolved in the presence of using statements (see test-313).
15234 * class.cs (MethodData.Define): If we are an explicit interface
15235 implementation, set the method name to the full name of the
15236 interface plus the name of the method.
15238 Notice that using the method.MethodName.GetFullName() does not
15239 work, as it will only contain the name as declared on the source
15240 file (it can be a shorthand in the presence of using statements)
15241 and not the fully qualifed type name, for example:
15245 class D : ICloneable {
15246 object ICloneable.Clone () {
15250 Would produce a method called `ICloneable.Clone' instead of
15251 `System.ICloneable.Clone'.
15253 * namespace.cs (Alias.Resolve): Use GetPartialName.
15255 2004-11-01 Marek Safar <marek.safar@seznam.cz>
15257 * cs-parser.jay: Add error 1055 report.
15259 2004-11-01 Miguel de Icaza <miguel@ximian.com>
15261 * assign.cs (Assign.DoResolve): Only do the transform of
15262 assignment into a New if the types are compatible, if not, fall
15263 through and let the implicit code deal with the errors and with
15264 the necessary conversions.
15266 2004-11-01 Marek Safar <marek.safar@seznam.cz>
15268 * cs-parser.jay: Add error 1031 report.
15270 * cs-tokenizer.cs: Add location for error 1038.
15272 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15274 * cs-parser.jay: Add error 1016 report.
15276 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15278 * cs-parser.jay: Add errors 1575,1611 report.
15280 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15282 * cs-parser.jay: Add error 1001 report.
15284 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15287 * attribute.cs (GetMarshal): Add method argument for
15288 caller identification.
15290 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
15291 agument for GetMarshal and RuntimeMissingSupport.
15293 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15295 * attribute.cs (ExtractSecurityPermissionSet): Removed
15296 TypeManager.code_access_permission_type.
15298 * typemanager.cs: Removed TypeManager.code_access_permission_type.
15300 2004-10-27 Miguel de Icaza <miguel@ximian.com>
15302 * expression.cs (LocalVariableReference.DoResolveLValue): Check
15303 for obsolete use of a variable here. Fixes regression on errors
15304 cs0619-25 and cs0619-26.
15306 2004-10-27 Marek Safar <marek.safar@seznam.cz>
15308 Fix #62358, implemented security attribute encoding.
15310 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
15311 Tests permitted SecurityAction for assembly or other types.
15312 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
15313 data from SecurityPermissionAttribute to PermisionSet class.
15315 * class.cs (ApplyAttributeBuilder): Added special handling
15316 for System.Security.Permissions.SecurityAttribute based types.
15318 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
15319 special handling for System.Security.Permissions.SecurityAttribute
15322 * enum.cs (ApplyAttributeBuilder): Added special handling
15323 for System.Security.Permissions.SecurityAttribute based types.
15325 * parameter.cs (ApplyAttributeBuilder): Added special handling
15326 for System.Security.Permissions.SecurityAttribute based types.
15328 * rootcontext.cs: Next 2 core types.
15330 * typemanager.cs (TypeManager.security_permission_attr_type):
15331 Built in type for the SecurityPermission Attribute.
15332 (code_access_permission_type): Build in type.
15334 2004-10-17 Miguel de Icaza <miguel@ximian.com>
15336 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
15337 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
15338 all of this information into
15339 EmitContext.EmitCapturedVariableInstance.
15341 * codegen.cs (EmitCapturedVariableInstance): move here the
15342 funcionality of emitting an ldarg.0 in the presence of a
15343 remapping. This centralizes the instance emit code.
15345 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
15346 then emit a load of this: it means that we have reached the
15347 topmost ScopeInfo: the one that contains the pointer to the
15348 instance of the class hosting the anonymous method.
15350 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
15351 captures to the topmost CaptureContext.
15353 2004-10-12 Miguel de Icaza <miguel@ximian.com>
15355 * expression.cs (LocalVariableReference): Move the knowledge about
15356 the iterators into codegen's EmitCapturedVariableInstance.
15358 2004-10-11 Miguel de Icaza <miguel@ximian.com>
15360 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
15361 all code paths return a value from an anonymous method (it is the
15362 same as the 161 error, but for anonymous methods).
15364 2004-10-08 Miguel de Icaza <miguel@ximian.com>
15366 The introduction of anonymous methods in the compiler changed
15367 various ways of doing things in the compiler. The most
15368 significant one is the hard split between the resolution phase
15369 and the emission phases of the compiler.
15371 For instance, routines that referenced local variables no
15372 longer can safely create temporary variables during the
15373 resolution phase: they must do so from the emission phase,
15374 since the variable might have been "captured", hence access to
15375 it can not be done with the local-variable operations from the runtime.
15379 (Block.Flags): New flag `IsTopLevel' to indicate that this block
15380 is a toplevel block.
15382 (ToplevelBlock): A new kind of Block, these are the blocks that
15383 are created by the parser for all toplevel method bodies. These
15384 include methods, accessors and anonymous methods.
15386 These contain some extra information not found in regular blocks:
15387 A pointer to an optional CaptureContext (for tracking captured
15388 local variables and parameters). A pointer to the parent
15391 (Return.Resolve): Catch missmatches when returning a value from an
15392 anonymous method (error 1662).
15393 Invoke NeedReturnLabel from the Resolve phase instead of the emit
15396 (Break.Resolve): ditto.
15398 (SwitchLabel): instead of defining the labels during the
15399 resolution phase, we now turned the public ILLabel and ILLabelCode
15400 labels into methods called GetILLabelCode() and GetILLabel() that
15401 only define the label during the Emit phase.
15403 (GotoCase): Track the SwitchLabel instead of the computed label
15404 (its contained therein). Emit the code by using
15405 SwitchLabel.GetILLabelCode ().
15407 (LocalInfo.Flags.Captured): A new flag has been introduce to track
15408 whether the Local has been captured or not.
15410 (LocalInfo.IsCaptured): New property, used to tell whether the
15411 local has been captured.
15413 * anonymous.cs: Vastly updated to contain the anonymous method
15416 The main classes here are: CaptureContext which tracks any
15417 captured information for a toplevel block and ScopeInfo used to
15418 track the activation frames for various local variables.
15420 Each toplevel block has an optional capture context associated
15421 with it. When a method contains an anonymous method both the
15422 toplevel method and the anonymous method will create a capture
15423 context. When variables or parameters are captured, they are
15424 recorded on the CaptureContext that owns them, for example:
15428 MyDelegate d = delegate {
15433 Here `a' will be recorded as captured on the toplevel
15434 CapturedContext, the inner captured context will not have anything
15435 (it will only have data if local variables or parameters from it
15436 are captured in a nested anonymous method.
15438 The ScopeInfo is used to track the activation frames for local
15439 variables, for example:
15441 for (int i = 0; i < 10; i++)
15442 for (int j = 0; j < 10; j++){
15443 MyDelegate d = delegate {
15448 At runtime this captures a single captured variable `i', but it
15449 captures 10 different versions of the variable `j'. The variable
15450 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15451 recorded on a child.
15453 The toplevel ScopeInfo will also track information like the `this'
15454 pointer if instance variables were referenced (this is necessary
15455 as the anonymous method lives inside a nested class in the host
15456 type of the method).
15458 (AnonymousMethod): Expanded to track the Toplevel, implement
15459 `AnonymousMethod.Compatible' to tell whether an anonymous method
15460 can be converted to a target delegate type.
15462 The routine now also produces the anonymous method content
15464 (AnonymousDelegate): A helper class that derives from
15465 DelegateCreation, this is used to generate the code necessary to
15466 produce the delegate for the anonymous method that was created.
15468 * assign.cs: API adjustments for new changes in
15469 Convert.ImplicitStandardConversionExists.
15471 * class.cs: Adjustments to cope with the fact that now toplevel
15472 blocks are of type `ToplevelBlock'.
15474 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15475 insteda of standard blocks.
15477 Flag errors if params arguments are passed to anonymous methods.
15479 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15480 `CurrentAnonymousMethod' which points to the current Anonymous
15481 Method. The variable points to the AnonymousMethod class that
15482 holds the code being compiled. It is set in the new EmitContext
15483 created for the anonymous method.
15485 (EmitContext.Phase): Introduce a variable and an enumeration to
15486 assist in enforcing some rules about when and where we are allowed
15487 to invoke certain methods (EmitContext.NeedsReturnLabel is the
15488 only one that enfonces this right now).
15490 (EmitContext.HaveCaptureInfo): new helper method that returns
15491 whether we have a CapturedContext initialized.
15493 (EmitContext.CaptureVariable): New method used to register that a
15494 LocalInfo must be flagged for capturing.
15496 (EmitContext.CapturedParameter): New method used to register that a
15497 parameters must be flagged for capturing.
15499 (EmitContext.CapturedField): New method used to register that a
15500 field must be flagged for capturing.
15502 (EmitContext.HaveCapturedVariables,
15503 EmitContext.HaveCapturedFields): Return whether there are captured
15504 variables or fields.
15506 (EmitContext.EmitMethodHostInstance): This is used to emit the
15507 instance for the anonymous method. The instance might be null
15508 (static methods), this (for anonymous methods that capture nothing
15509 and happen to live side-by-side with the current method body) or a
15510 more complicated expression if the method has a CaptureContext.
15512 (EmitContext.EmitTopBlock): Routine that drives the emission of
15513 code: it will first resolve the top block, then emit any metadata
15514 and then emit the code. The split is done so that we can extract
15515 any anonymous methods and flag any captured variables/parameters.
15517 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15518 during this phase, the ILGenerator should not be used as labels
15519 and local variables declared here might not be accessible to any
15520 code that is part of an anonymous method.
15522 Exceptions to this include the temporary variables that are
15523 created by some statements internally for holding temporary
15526 (EmitContext.EmitMeta): New routine, in charge of emitting all the
15529 (EmitContext.TemporaryReturn): This method is typically called
15530 from the Emit phase, and its the only place where we allow the
15531 ReturnLabel to be defined other than the EmitMeta. The reason is
15532 that otherwise we would have to duplicate a lot of logic in the
15533 Resolve phases of various methods that today is on the Emit
15536 (EmitContext.NeedReturnLabel): This no longer creates the label,
15537 as the ILGenerator is not valid during the resolve phase.
15539 (EmitContext.EmitThis): Extended the knowledge in this class to
15540 work in anonymous methods in addition to iterators.
15542 (EmitContext.EmitCapturedVariableInstance): This emits whatever
15543 code is necessary on the stack to access the instance to a local
15544 variable (the variable will be accessed as a field).
15546 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15547 EmitContext.EmitAddressOfParameter): Routines to support
15548 parameters (not completed at this point).
15550 Removals: Removed RemapLocal and RemapLocalLValue. We probably
15551 will also remove the parameters.
15553 * convert.cs (Convert): Define a `ConstantEC' which points to a
15554 null. This is just to prefity some code that uses
15555 ImplicitStandardConversion code and do not have an EmitContext
15558 The idea is to flag explicitly that at that point in time, it is
15559 known that the conversion will not trigger the delegate checking
15560 code in implicit conversions (which requires a valid
15563 Everywhere: pass new EmitContext parameter since
15564 ImplicitStandardConversionExists now requires it to check for
15565 anonymous method conversions.
15567 (Convert.ImplicitStandardConversionExists): If the type of an
15568 expression is the anonymous_method_type, and the type is a
15569 delegate, we invoke the AnonymousMethod.Compatible method to check
15570 whether an implicit conversion is possible.
15572 (Convert.ImplicitConversionStandard): Only do implicit method
15573 group conversions if the language level is not ISO_1.
15575 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15576 MethodInfo for the Invoke method. used by Delegate and
15579 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15580 method conversions if the target type is a delegate.
15582 Removed extra debugging nops.
15584 (LocalVariableReference): Turn the `local_info' into a public
15587 Add `prepared' field, the same hack used for FieldExprs to cope
15588 with composed assignments, as Local variables do not necessarily
15589 operate purely on the stack as they used to: they can be captured
15592 Add `temp' for a temporary result, like fields.
15594 Refactor DoResolve and DoResolveLValue into DoResolveBase.
15596 It now copes with Local variables that are captured and emits the
15597 proper instance variable to load it from a field in the captured
15600 (ParameterReference.DoResolveBase): During the resolve phase,
15601 capture parameters if we are in an anonymous method.
15603 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15604 anonymous method, use the EmitContext helper routines to emit the
15605 parameter reference.
15607 * iterators.cs: Set RemapToProxy to true/false during the
15610 * parameters.cs (GetParameterByName): New helper method.
15612 * typemanager.cs (anonymous_method_type) a new type that
15613 represents an anonyous method. This is always an internal type,
15614 used as a fencepost to test against the anonymous-methodness of an
15617 2004-10-20 Marek Safar <marek.safar@seznam.cz>
15619 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15621 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15623 2004-10-18 Martin Baulig <martin@ximian.com>
15625 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15626 `Type' directly, but call ResolveType() on it.
15627 (Catch.Resolve): Likewise.
15628 (Foreach.Resolve): Likewise.
15630 2004-10-18 Martin Baulig <martin@ximian.com>
15632 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15633 `Type' directly, but call ResolveType() on it.
15634 (Probe.DoResolve): Likewise.
15635 (ArrayCreation.LookupType): Likewise.
15636 (TypeOf.DoResolve): Likewise.
15637 (SizeOf.DoResolve): Likewise.
15639 2004-10-18 Martin Baulig <martin@ximian.com>
15641 * expression.cs (Invocation.BetterFunction): Put back
15642 TypeManager.TypeToCoreType().
15644 2004-10-18 Raja R Harinath <rharinath@novell.com>
15646 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15649 2004-10-18 Martin Baulig <martin@ximian.com>
15651 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
15652 `Type' directly, but call ResolveType() on it.
15654 2004-10-18 Martin Baulig <martin@ximian.com>
15656 * class.cs (FieldMember.Define): Don't access the TypeExpr's
15657 `Type' directly, but call ResolveType() on it.
15658 (MemberBase.DoDefine): Likewise.
15660 * expression.cs (New.DoResolve): Don't access the TypeExpr's
15661 `Type' directly, but call ResolveType() on it.
15662 (ComposedCast.DoResolveAsTypeStep): Likewise.
15664 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15665 `Type' directly, but call ResolveType() on it.
15667 2004-10-17 John Luke <john.luke@gmail.com>
15669 * class.cs (Operator.GetSignatureForError): use CSharpName
15671 * parameter.cs (Parameter.GetSignatureForError): Returns
15672 correct name even if was not defined.
15674 2004-10-13 Raja R Harinath <rharinath@novell.com>
15677 * class.cs (TypeContainer.EmitContext): New property.
15678 (DefineNestedTypes): Create an emitcontext for each part.
15679 (MethodCore.DoDefineParameters): Use container's emitcontext.
15680 Pass type array to InternalParameters.
15681 (MemberBase.DoDefine): Use container's emitcontext.
15682 (FieldMember.Define): Likewise.
15683 (Event.Define): Likewise.
15684 (SetMethod.GetParameterInfo): Change argument to EmitContext.
15685 Pass type array to InternalParameters.
15686 (SetIndexerMethod.GetParameterInfo): Likewise.
15687 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15688 * delegate.cs (Define): Pass emitcontext to
15689 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
15690 array to InternalParameters.
15691 * expression.cs (ParameterReference.DoResolveBase): Pass
15692 emitcontext to GetParameterInfo.
15693 (ComposedCast.DoResolveAsTypeStep): Remove check on
15694 ec.ResolvingTypeTree.
15695 * parameter.cs (Parameter.Resolve): Change argument to
15696 EmitContext. Use ResolveAsTypeTerminal.
15697 (Parameter.GetSignature): Change argument to EmitContext.
15698 (Parameters.ComputeSignature): Likewise.
15699 (Parameters.ComputeParameterTypes): Likewise.
15700 (Parameters.GetParameterInfo): Likewise.
15701 (Parameters.ComputeAndDefineParameterTypes): Likewise.
15702 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
15703 * support.cs (InternalParameters..ctor): Remove variant that takes
15705 * typemanager.cs (system_intptr_expr): New.
15706 (InitExpressionTypes): Initialize it.
15708 2004-10-12 Chris Toshok <toshok@ximian.com>
15710 * cs-parser.jay: fix location for try_statement and catch_clause.
15712 2004-10-11 Martin Baulig <martin@ximian.com>
15714 * report.cs: Don't make --fatal abort on warnings, we have
15715 -warnaserror for that.
15717 2004-10-07 Raja R Harinath <rharinath@novell.com>
15719 More DeclSpace.ResolveType avoidance.
15720 * decl.cs (MemberCore.InUnsafe): New property.
15721 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
15722 with newly created EmitContext.
15723 (FieldMember.Define): Likewise.
15724 * delegate.cs (Delegate.Define): Likewise.
15725 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15726 only if normal name-lookup fails.
15727 (TypeExpr.DoResolve): Enable error-checking.
15728 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15729 (SizeOf.DoResolve): Likewise.
15730 (ComposedCast.DoResolveAsTypeStep): Likewise.
15731 (StackAlloc.DoResolve): Likewise.
15732 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15733 (Block.Unsafe): New property.
15734 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15735 (Unsafe): Set 'unsafe' flag of contained block.
15736 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15737 (Fixed.Resolve): Likewise.
15738 (Catch.Resolve): Likewise.
15739 (Using.ResolveLocalVariableDecls): Likewise.
15740 (Foreach.Resolve): Likewise.
15742 2004-10-05 John Luke <john.luke@gmail.com>
15744 * cs-parser.jay: add location to error CS0175
15746 2004-10-04 Miguel de Icaza <miguel@ximian.com>
15748 * ecore.cs (Expression.Constantity): Add support for turning null
15751 * const.cs (Const.Define): Allow constants to be reference types
15752 as long as the value is Null.
15754 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
15756 * namespace.cs (NamespaceEntry.Using): No matter which warning
15757 level is set, check if this namespace name has already been added.
15759 2004-10-03 Ben Maurer <bmaurer@ximian.com>
15761 * expression.cs: reftype [!=]= null should always use br[true,false].
15764 2004-10-03 Marek Safar <marek.safar@seznam.cz>
15767 * attribute.cs: Enum conversion moved to
15768 GetAttributeArgumentExpression to be applied to the all
15771 2004-10-01 Raja R Harinath <rharinath@novell.com>
15773 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15774 * class.c (TypeContainer.DefineType): Flag error if
15775 base types aren't accessible due to access permissions.
15776 * decl.cs (DeclSpace.ResolveType): Move logic to
15777 Expression.ResolveAsTypeTerminal.
15778 (DeclSpace.ResolveTypeExpr): Thin layer over
15779 Expression.ResolveAsTypeTerminal.
15780 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15781 Refactor code into NestedAccess. Use it.
15782 (DeclSpace.NestedAccess): New.
15783 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15784 argument to silence errors. Check access permissions.
15785 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15786 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15787 (Cast.DoResolve): Likewise.
15788 (New.DoResolve): Likewise.
15789 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15790 (TypeOf.DoResolve): Likewise.
15792 * expression.cs (Invocation.BetterConversion): Return the Type of
15793 the better conversion. Implement section 14.4.2.3 more faithfully.
15794 (Invocation.BetterFunction): Make boolean. Make correspondence to
15795 section 14.4.2.2 explicit.
15796 (Invocation.OverloadResolve): Update.
15797 (Invocation): Remove is_base field.
15798 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
15799 (Invocation.Emit): Likewise.
15801 2004-09-27 Raja R Harinath <rharinath@novell.com>
15803 * README: Update to changes.
15805 2004-09-24 Marek Safar <marek.safar@seznam.cz>
15807 * cs-parser.jay: Reverted 642 warning fix.
15809 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15812 * decl.cs (FindMemberWithSameName): Indexer can have more than
15815 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15817 * expression.cs (LocalVariableReference.DoResolveLValue):
15818 Do not report warning 219 for out values.
15819 (EmptyExpression.Null): New member to avoid extra allocations.
15821 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15823 * cs-parser.jay: Fix wrong warning 642 report.
15825 * cs-tokenizer.cs (CheckNextToken): New helper;
15826 Inspect next character if is same as expected.
15828 2004-09-23 Martin Baulig <martin@ximian.com>
15830 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15831 (Convert.ImplicitReferenceConversionExists): Likewise.
15833 2004-09-23 Marek Safar <marek.safar@seznam.cz>
15835 * class.cs (Operator.Define): Add error 448 and 559 report.
15837 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15839 * class.cs (MemberBase.IsTypePermitted): New protected
15840 method for checking error CS0610.
15842 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15844 * class.cs (TypeContainer.HasExplicitLayout): New property
15845 Returns whether container has StructLayout attribute set Explicit.
15846 (FieldMember): New abstract class for consts and fields.
15847 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15848 (Field): Reuse FieldMember.
15850 * const.cs (Const): Reuse FieldMember.
15852 * rootcontext.cs: EmitConstants call moved to class.
15854 2004-09-22 Martin Baulig <martin@ximian.com>
15856 Thanks to Peter Sestoft for this bug report.
15858 * expression.cs (Conditional): If both the `trueExpr' and the
15859 `falseExpr' is a NullLiteral, return a NullLiteral.
15861 2004-09-22 Martin Baulig <martin@ximian.com>
15863 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15864 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15865 for the "get_Current" call.
15867 2004-09-22 Martin Baulig <martin@ximian.com>
15869 Marek and me just fixed one of our oldest bugs: #28562 :-)
15871 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15873 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15874 we're an EnumConstant, just return that.
15875 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15876 an EnumConstant. In this case, we need to use GetValueAsEnumType()
15877 to get the value which'll actually be written into the attribute.
15878 However, we have to use GetValue() to access the attribute's value
15881 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15883 * constant.cs (Constant.IsNegative): New abstract property
15886 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15887 (StackAlloc.DoResolve): Reused IsNegative.
15889 2004-09-21 Martin Baulig <martin@ximian.com>
15891 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15892 if we're used in an iterator, we may be called from different
15895 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15896 we actually have an exception block.
15898 2004-09-20 John Luke <jluke@cfl.rr.com>
15900 * class.cs, cs-parser.jay: Improve the error report for 1520:
15901 report the actual line where the error happens, not where the
15902 class was declared.
15904 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15905 Pass location information that was available elsewhere.
15907 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
15909 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15910 runtime to delay sign assemblies.
15912 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15914 * cs-parser.jay: Do not report the stack trace, this is barely
15917 2004-08-22 John Luke <john.luke@gmail.com>
15919 * driver.cs : check that a resource id is not already used
15920 before adding it, report CS1508 if it is, bug #63637
15922 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15924 * ecore.cs: Removed dead code.
15926 2004-09-18 Marek Safar <marek.safar@seznam.cz>
15928 * class.cs: Do not report warning CS0067 on the interfaces.
15930 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15932 * cs-parser.jay: Add error 504 report.
15934 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15936 * rootcontext.cs: WarningLevel is 4 by default now.
15938 * statement.cs (Fixed.Resolve): Do not null
15941 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15944 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15945 deep search when property is not virtual.
15946 (PropertyExpr.ResolveAccessors): Make one call for both
15949 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15952 * statement.cs: Error 152 report constains also location.
15954 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15957 * const.cs: Explicitly set constant as static.
15959 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15962 * cs-parser.jay: Add error 1017 report.
15964 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15966 Fixed bug #59980, #64224
15967 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15969 * typemanager.cs (IsSpecialMethod): Simplified
15971 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15973 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15974 condition with better params.
15976 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15979 * attribute.cs (Resolve): Property has to have both
15982 2004-09-14 Martin Baulig <martin@ximian.com>
15984 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15986 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15989 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15990 called and is obsolete then this member suppress message
15991 when call is inside next [Obsolete] method or type.
15993 * expression.cs: Use TestObsoleteMethodUsage member.
15995 2004-09-14 Martin Baulig <martin@ximian.com>
15997 * cs-parser.jay: Sync a bit with the GMCS version.
15999 2004-09-14 Martin Baulig <martin@ximian.com>
16001 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
16002 (CSharpParser.yacc_verbose_flag): New public field.
16004 * genericparser.cs: Removed.
16006 2004-09-14 Raja R Harinath <rharinath@novell.com>
16008 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
16010 2004-09-13 Marek Safar <marek.safar@seznam.cz>
16012 * class.cs (MethodCore.CheckBase): Fix bug #65757.
16014 2004-09-10 Martin Baulig <martin@ximian.com>
16016 Backported my MemberName changes from GMCS into MCS.
16018 - we are now using a special `MemberName' class instead of using
16019 strings; in GMCS, the `MemberName' also contains the type
16022 - changed the grammar rules a bit:
16023 * the old `member_name' is now a `namespace_or_type_name':
16024 The rule is that we use `namespace_or_type_name' everywhere
16025 where we expect either a "member name" (GetEnumerator) or a
16026 "member name" with an explicit interface name
16027 (IEnumerable.GetEnumerator).
16028 In GMCS, the explicit interface name may include type arguments
16029 (IEnumerable<T>.GetEnumerator).
16030 * we use `member_name' instead of just `IDENTIFIER' for
16032 The rule is that we use `member_name' wherever a member may
16033 have type parameters in GMCS.
16035 * decl.cs (MemberName): New public class.
16036 (MemberCore.MemberName): New public readonly field.
16037 (MemberCore.ctor): Take a `MemberName' argument, not a string.
16038 (DeclSpace): Likewise.
16040 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
16041 * enum.cs (Enum.ctor): Likewise.
16043 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
16045 (AliasEntry.ctor): Take a MemberName, not an Expression.
16046 (AliasEntry.UsingAlias): Likewise.
16048 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
16049 (IMethodData.MemberName): Changed type from string to MemberName.
16050 (MemberBase.ExplicitInterfaceName): Likewise.
16051 (AbstractPropertyEventMethod.SetupName): Make this private.
16052 (AbstractPropertyEventMethod.ctor): Added `string prefix'
16053 argument; compute the member name here.
16054 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
16055 on the `member.MemberName' and the `prefix'.
16057 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
16059 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
16060 thus, we get a `MemberName' instead of a `string'. These
16061 declarations may have type parameters in GMCS.
16062 (interface_method_declaration, delegate_declaration): Likewise.
16063 (class_declaration, interface_declaration): Likewise.
16064 (method_header): Use `namespace_or_type_name' instead of
16065 `member_name'. We may be an explicit interface implementation.
16066 (property_declaration, event_declaration): Likewise.
16067 (member_name): This is now just an `IDENTIFIER', not a
16068 `namespace_or_type_name'.
16069 (type_name, interface_type): Removed.
16070 (namespace_or_type_name): Return a MemberName, not an Expression.
16071 (primary_expression): Use `member_name' instead of `IDENTIFIER';
16072 call GetTypeExpression() on the MemberName to get an expression.
16073 (IndexerDeclaration.interface_type): Changed type from string to
16075 (MakeName): Operate on MemberName's instead of string's.
16077 2004-09-13 Raja R Harinath <rharinath@novell.com>
16080 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
16081 (NamespaceEntry.Lookup): Add new argument to flag if we want the
16082 lookup to avoid symbols introduced by 'using'.
16083 * rootcontext.cs (NamespaceLookup): Update.
16085 2004-09-12 Marek Safar <marek.safar@seznam.cz>
16087 * class.cs (TypeContainer.DoDefineMembers): Do not call
16088 DefineDefaultConstructor for static classes.
16090 2004-09-12 Marek Safar <marek.safar@seznam.cz>
16092 * attribute.cs (Attribute.Resolve): Add error 653 report.
16094 * class.cs (Class.ApplyAttributeBuilder): Add error 641
16096 (Method.ApplyAttributeBuilder): Add error 685 report.
16097 (Operator.Define): Add error 564 report.
16099 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
16101 * expression.cs (Invocation.DoResolve): Add error
16102 245 and 250 report.
16104 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
16107 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16109 * class.cs (ConstructorInitializer.Resolve):
16110 Wrong error number (515->516).
16112 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16114 * class.cs (Indexer.Define): Add error 631 report.
16116 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16118 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
16120 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16122 * expression.cs (Probe.DoResolve): Add error CS0241 report.
16124 2004-09-10 Marek Safar <marek.safar@seznam.cz>
16126 * cs-parser.jay: Added error CS0241 report.
16128 2004-09-10 Raja R Harinath <rharinath@novell.com>
16130 * cs-parser.jay (fixed_statement): Introduce a scope for the
16131 declaration in the 'fixed' statement.
16133 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16135 * cs-parser.jay: Added CS0230 error report.
16137 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16139 * cs-parser.jay: Added errors CS0231 and CS0257 report.
16141 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16143 * expression.cs (Argument.Resolve): Added error CS0192 and
16146 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16148 C# 2.0 #pragma warning feature
16150 * cs-tokenizer.cs (PreProcessPragma): New method;
16151 Handles #pragma directive.
16153 * report.cs (WarningRegions): New class; Support
16154 class for #pragma warning directive. It tests whether
16155 warning is enabled for a given line.
16157 2004-09-08 Miguel de Icaza <miguel@ximian.com>
16159 * const.cs: Add more descriptive error report, tahnks to
16162 2004-09-08 Marek Safar <marek.safar@seznam.cz>
16164 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
16166 2004-09-07 Miguel de Icaza <miguel@ximian.com>
16168 * expression.cs: Apply patch from Ben: Remove dead code from
16169 ArrayCreation, and remove the TurnintoConstant call in const.cs,
16170 as that code just threw an exception anwyays.
16172 * const.cs: Remove the call to the turnintoconstant, for details
16175 * literal.cs: The type of the null-literal is the null type; So
16176 we use a placeholder type (literal.cs:System.Null, defined here)
16179 * expression.cs (Conditional.DoResolve): Remove some old code that
16180 is no longer needed, conversions have been fixed.
16182 (ArrayCreationExpression.DoResolve): Return false if we fail to
16183 resolve the inner expression.
16185 2004-09-07 Raja R Harinath <rharinath@novell.com>
16188 * cs-parser.jay (delegate_declaration): Record a delegate
16189 declaration as a type declaration.
16190 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
16192 2004-09-06 Miguel de Icaza <miguel@ximian.com>
16194 * parameter.cs: Do not crash if the type can not be resolved.
16196 * expression.cs: Report errors with unsafe pointers, fixes #64896
16198 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
16200 * expression.cs: Pointer arith always needs to do a conv.i
16201 if the operand is a long. fix 65320
16203 2004-09-04 Marek Safar <marek.safar@seznam.cz>
16205 Fixed cs0619-37.cs, cs0619-38.cs
16207 * enum.cs (GetObsoleteAttribute): Removed.
16209 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
16210 on Enum member is double staged. The first is tested member
16213 2004-09-04 Marek Safar <marek.safar@seznam.cz>
16215 Fixed #56986, #63631, #65231
16217 * class.cs: (TypeContainer.AddToMemberContainer): New method,
16218 adds member to name container.
16219 (TypeContainer.AddToTypeContainer): New method, adds type to
16221 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
16222 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
16223 AddOperator): Simplified by reusing AddToMemberContainer.
16224 (TypeContainer.UserDefinedStaticConstructor): Changed to property
16226 (Method.CheckForDuplications): Fixed implementation to test all
16228 (MemberBase): Detection whether member is explicit interface
16229 implementation is now in constructor.
16230 (MemberBase.UpdateMemberName): Handles IndexerName.
16231 (Accessor): Changed to keep also location information.
16232 (AbstractPropertyEventMethod): Is derived from MemberCore.
16233 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
16234 will be emited or not.
16235 (PropertyBase.AreAccessorsDuplicateImplementation):
16236 Tests whether accessors are not in collision with some method.
16237 (Operator): Is derived from MethodCore to simplify common
16240 * decl.cs (Flags.TestMethodDuplication): Test for duplication
16242 (DeclSpace.AddToContainer): Adds the member to defined_names
16243 table. It tests for duplications and enclosing name conflicts.
16245 * enum.cs (EnumMember): Clean up to reuse the base structures
16247 2004-09-03 Martin Baulig <martin@ximian.com>
16249 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
16250 into TypeContainer, to make partial classes work again.
16252 2004-09-03 Martin Baulig <martin@ximian.com>
16254 * rootcontext.cs (RootContext.V2): Removed.
16256 2004-03-23 Martin Baulig <martin@ximian.com>
16258 * expression.cs (Invocation.OverloadResolve): Added `bool
16259 may_fail' argument and use it instead of the Location.IsNull() hack.
16261 2004-09-03 Martin Baulig <martin@ximian.com>
16263 Merged latest changes into gmcs. Please keep this comment in
16264 here, it makes it easier for me to see what changed in MCS since
16265 the last time I merged.
16267 2004-09-03 Raja R Harinath <rharinath@novell.com>
16270 * expression.cs (BetterConversion): Don't allow either conversion
16271 to be null. Remove redundant implicit conversion test when 'q ==
16272 null' -- when this function is invoked, we already know that the
16273 implicit conversion exists.
16274 (BetterFunction): Assume that 'best' is non-null. Remove
16275 redundant reimplementation of IsApplicable when 'best' is null.
16276 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
16277 number of arguments.
16278 (IsAncestralType): Extract from OverloadResolve.
16279 (OverloadResolve): Make robust to the MethodGroupExpr being
16280 unsorted. Implement all the logic of Section 14.5.5.1, and
16281 support overloading of methods from multiple applicable types.
16282 Clean up logic somewhat. Don't pass null methods to BetterFunction.
16284 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
16285 (RealError, Warning): Append type of report to related symbol.
16287 2004-09-03 Marek Safar <marek.safar@seznam.cz>
16289 * enum.cs: Fixed CLS-Compliance checks for enum members.
16290 Error tests cs3008-8.cs, cs3014-8.cs
16292 2004-09-02 Marek Safar <marek.safar@seznam.cz>
16294 Fixed bug #62342, #63102
16295 * class.cs: ImplementIndexer uses member.IsExplicitImpl
16296 like ImplementMethod.
16298 2004-09-02 Marek Safar <marek.safar@seznam.cz>
16300 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16303 2004-09-02 Martin Baulig <martin@ximian.com>
16305 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
16306 TypeManager.GetArgumentTypes() rather than calling GetParameters()
16309 2004-09-01 Marek Safar <marek.safar@seznam.cz>
16311 C# 2.0 Static classes implemented
16313 * class.cs (TypeContainer): instance_constructors,
16314 initialized_fields, initialized_static_fields,
16315 default_constructor, base_inteface_types are protected to be
16316 accessible from StaticClass.
16317 (TypeContainer.DefineDefaultConstructor): New virtual method
16318 for custom default constructor generating
16319 (StaticClass): New class to handle "Static classes" feature.
16321 * cs-parser.jay: Handle static keyword on class like instance
16324 * driver.cs: Added "/langversion" command line switch with two
16325 options (iso-1, default).
16327 2004-08-31 Marek Safar <marek.safar@seznam.cz>
16329 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
16331 2004-08-31 Miguel de Icaza <miguel@ximian.com>
16333 * delegate.cs: Style.
16335 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
16337 * delegate.cs: Add seperate instance expr field for miguel.
16339 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
16341 * PointerArithmetic (Resolve): make sure we are not doing
16342 pointer arith on void*. Also, make sure we are resolved
16343 by not setting eclass until resolve.
16345 All callers: Make sure that PointerArithmetic gets resolved.
16347 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
16349 * ArrayCreation (LookupType): If the type does not resolve
16350 to an array, give an error.
16352 2004-08-27 Marek Safar <marek.safar@seznam.cz>
16354 * statement.cs (Try.Resolve): Fixed bug #64222
16356 2004-08-27 Martin Baulig <martin@ximian.com>
16359 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
16362 2004-08-26 Marek Safar <marek.safar@seznam.cz>
16364 * ecore.cs (Constantify): Get underlying type via
16365 System.Enum.GetUnderlyingType to avoid StackOverflow on the
16366 Windows in special cases.
16368 2004-08-26 Marek Safar <marek.safar@seznam.cz>
16370 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
16371 for obtaining also private methods.
16372 (GetRemoveMethod): Used GetRemoveMethod (true)
16373 for obtaining also private methods.
16375 2004-08-24 Martin Baulig <martin@ximian.com>
16377 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
16378 MethodAttributes.HideBySig for operators.
16380 2004-08-23 Martin Baulig <martin@ximian.com>
16382 Back to the old error reporting system :-)
16384 * report.cs (Message): Removed.
16385 (Report.MessageData, ErrorData, WarningData): Removed.
16386 (Report.Error, Warning): Back to the old system.
16388 2004-08-23 Martin Baulig <martin@ximian.com>
16390 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
16392 * class.cs (TypeContainer.ParentContainer): New public virtual
16393 method; replaces the explicit interface implementation.
16394 (ClassPart.ParentContainer): Override.
16396 2004-08-23 Martin Baulig <martin@ximian.com>
16398 * statement.cs (Switch): Added support for constant switches; see
16399 #59428 or test-285.cs.
16401 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16404 * statement.cs (GetEnumeratorFilter): Removed useless
16405 logic because C# specs is strict. GetEnumerator must be
16408 2004-08-22 Martin Baulig <martin@ximian.com>
16410 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16411 a switch and may break, reset the barrier. Fixes #59867.
16413 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16415 CLS-Compliance speed up (~5% for corlib)
16417 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16418 New method. Tests container for CLS-Compliant names
16420 * class.cs (TypeContainer.VerifyClsName): New method.
16421 Checks whether container name is CLS Compliant.
16422 (Constructor): Implements IMethodData.
16424 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16425 low-case table for CLS Compliance test.
16426 (MemberCache.VerifyClsParameterConflict): New method.
16427 Checks method parameters for CS3006 error.
16429 * enum.cs (EnumMember): Is derived from MemberCore.
16430 (Enum.VerifyClsName): Optimized for better performance.
16432 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16434 * report.cs: Renamed Error_T to Error and changed all
16437 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16439 * class.cs (TypeContainer.IndexerArrayList): New inner class
16440 container for indexers.
16441 (TypeContainer.DefaultIndexerName): New constant for default
16442 indexer name. Replaced all "Item" with this constant.
16443 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16445 * typemanager.cs (TypeManager.default_member_ctor): Cache here
16446 DefaultMemberAttribute constructor.
16448 2004-08-05 Martin Baulig <martin@ximian.com>
16450 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16453 2004-08-05 Marek Safar <marek.safar@seznam.cz>
16455 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16456 multi platforms problem.
16458 * compiler.csproj: Included shared files.
16460 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16462 Fix bug 60333, 55971 in the more general way
16463 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16464 Added arg_type argument for constant conversion.
16465 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16467 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16470 * class.cs (TypeContainer ): New inner classes MethodArrayList,
16471 OperatorArrayList, MethodCoreArrayList for typecontainer
16472 containers. Changed class member types to these new types.
16473 (MethodArrayList.DefineMembers): Added test for CS0659.
16475 2004-08-04 Miguel de Icaza <miguel@ximian.com>
16477 * cfold.cs: Synchronize the folding with the code in expression.cs
16478 Binary.DoNumericPromotions for uint operands.
16480 * attribute.cs: Revert patch from Raja, it introduced a regression
16481 while building Blam-1.2.1 (hard to isolate a test case).
16483 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16487 (TypeContainer.Define): Renamed to DefineContainerMembers because of
16489 (MethodCore.parent_method): New member. The method we're overriding
16490 if this is an override method.
16491 (MethodCore.CheckBase): Moved from Method class and made common.
16492 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16494 (MethodCore.CheckForDuplications): New abstract method. For custom
16495 member duplication search in a container
16496 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16497 method and its return type.
16498 (Event.conflict_symbol): New member. Symbol with same name in the
16502 (MemberCache.FindMemberWithSameName): New method. The method
16503 is looking for conflict with inherited symbols.
16505 2004-08-04 Martin Baulig <martin@ximian.com>
16507 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16509 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16511 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16513 * report.cs (Message): New enum for better error, warning reference in
16515 (MessageData): New inner abstract class. It generally handles printing of
16516 error and warning messages.
16517 Removed unused Error, Warning, Message methods.
16519 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16521 Fix for cs0592-8.cs test
16523 (Attributable.ValidAttributeTargets): Made public.
16524 (Attribute.ExplicitTarget): New member for explicit target value.
16525 (Attribute.CheckTargets): Now we translate explicit attribute
16526 target to Target here.
16528 2004-08-03 Ben Maurer <bmaurer@ximian.com>
16530 * ecore.cs (MethodGroupExpr): new IsBase property.
16532 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16534 * delegate.cs (DelegateCreation): store a MethodGroupExpr
16535 rather than an instance expr.
16537 (DelegateCreation.Emit): Use the method group rather than
16538 the instance expression. Also, if you have base.Foo as the
16539 method for a delegate, make sure to emit ldftn, not ldftnvirt.
16541 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
16543 (NewDelegate.DoResolve): Only check for the existance of Invoke
16544 if the method is going to be needed. Use MethodGroupExpr.
16546 (NewDelegate.Emit): Remove, DelegateCreation implements this.
16548 * expression.cs: For pointer arith., make sure to use
16549 the size of the type, not the size of the pointer to
16552 2004-08-03 Marek Safar <marek.safar@seznam.cz>
16555 * class.cs (Class): Added error CS0502 test.
16557 2004-08-03 John Luke <jluke@cfl.rr.com>
16558 Raja R Harinath <rharinath@novell.com>
16561 * attribute.cs (Attribute.complained_before): New flag.
16562 (Attribute.ResolveType, Attribute.Resolve),
16563 (Attribute.DefinePInvokeMethod): Set it.
16564 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16566 2004-08-03 Martin Baulig <martin@ximian.com>
16568 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16569 use a user-defined operator; we still need to do numeric
16570 promotions in case one argument is a builtin type and the other
16571 one has an implicit conversion to that type. Fixes #62322.
16573 2004-08-02 Martin Baulig <martin@ximian.com>
16575 * statement.cs (LocalInfo.Flags): Added `IsThis'.
16576 (LocalInfo.IsThis): New public property.
16577 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16579 2004-08-01 Martin Baulig <martin@ximian.com>
16581 * class.cs (TypeContainer.GetClassBases): Don't set the default
16582 here since we may get called from GetPartialBases().
16583 (TypeContainer.DefineType): If GetClassBases() didn't return a
16584 parent, use the default one.
16586 2004-07-30 Duncan Mak <duncan@ximian.com>
16588 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16590 2004-07-30 Martin Baulig <martin@ximian.com>
16592 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16594 * class.cs (SourceMethod): New public class, derive from the
16595 symbol writer's ISourceMethod.
16596 (Method): Use the new symbol writer API.
16598 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16599 as argument and use the new symbol writer.
16602 (SourceFile): Implement the symbol writer's ISourceFile.
16603 (Location.SymbolDocument): Removed.
16604 (Location.SourceFile): New public property.
16606 * symbolwriter.cs: Use the new symbol writer API.
16608 2004-07-30 Raja R Harinath <rharinath@novell.com>
16610 * Makefile (install-local): Remove. Functionality moved to
16613 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
16615 * Makefile: Install mcs.exe.config file together with mcs.exe.
16616 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16617 correct runtime version.
16619 2004-07-25 Martin Baulig <martin@ximian.com>
16622 (TypeContainer.RegisterOrder): Removed, this was unused.
16623 (TypeContainer, interface_order): Removed.
16624 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16625 TypeContainer as argument since we can also be called with a
16626 `PartialContainer' for a partial class/struct/interface.
16627 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16628 of checking whether we're an `Interface' - we could be a
16629 `PartialContainer'.
16630 (PartialContainer.Register): Override; call
16631 AddClass()/AddStruct()/AddInterface() on our parent.
16633 * cs-parser.jay (interface_member_declaration): Add things to the
16634 `current_container', not the `current_class'.
16636 * rootcontext.cs (RegisterOrder): The overloaded version which
16637 takes an `Interface' was unused, removed.
16639 * typemanager.cs (TypeManager.LookupInterface): Return a
16640 `TypeContainer', not an `Interface'.
16641 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16642 contain a `PartialContainer' for an interface, so check it's
16643 `Kind' to figure out what it is.
16645 2004-07-25 Martin Baulig <martin@ximian.com>
16647 * class.cs (Class.DefaultTypeAttributes): New public constant.
16648 (Struct.DefaultTypeAttributes): Likewise.
16649 (Interface.DefaultTypeAttributes): Likewise.
16650 (PartialContainer.TypeAttr): Override this and add the
16651 DefaultTypeAttributes.
16653 2004-07-25 Martin Baulig <martin@ximian.com>
16655 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16656 we can just use the `Parent' field instead.
16658 2004-07-25 Martin Baulig <martin@ximian.com>
16660 * class.cs (TypeContainer.Emit): Renamed to EmitType().
16662 2004-07-25 Martin Baulig <martin@ximian.com>
16664 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16665 our parts before defining any methods.
16666 (TypeContainer.VerifyImplements): Make this virtual.
16667 (ClassPart.VerifyImplements): Override and call VerifyImplements()
16668 on our PartialContainer.
16670 2004-07-25 Martin Baulig <martin@ximian.com>
16672 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16674 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16675 argument, we can just use the `Parent' field instead.
16678 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
16679 (MemberBase.DoDefine): Likewise.
16681 2004-07-24 Martin Baulig <martin@ximian.com>
16683 * decl.cs (MemberCore.Parent): New public field.
16684 (DeclSpace.Parent): Moved to MemberCore.
16686 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16687 (MemberBase.ctor): Added TypeContainer argument, pass it to our
16689 (FieldBase, Field, Operator): Likewise.
16690 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16691 (EventField, Event): Likewise.
16693 2004-07-23 Martin Baulig <martin@ximian.com>
16695 * class.cs (PartialContainer): New public class.
16696 (ClassPart): New public class.
16697 (TypeContainer): Added support for partial classes.
16698 (TypeContainer.GetClassBases): Splitted some of the functionality
16699 out into GetNormalBases() and GetPartialBases().
16701 * cs-tokenizer.cs (Token.PARTIAL): New token.
16702 (Tokenizer.consume_identifier): Added some hacks to recognize
16703 `partial', but only if it's immediately followed by `class',
16704 `struct' or `interface'.
16706 * cs-parser.jay: Added support for partial clases.
16708 2004-07-23 Martin Baulig <martin@ximian.com>
16710 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16711 a `DeclSpace' and also made it readonly.
16712 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16713 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16714 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16716 * cs-parser.jay: Pass the `current_class', not the
16717 `current_container' (at the moment, this is still the same thing)
16718 to a new Method, Property, Event, Indexer or Constructor.
16720 2004-07-23 Martin Baulig <martin@ximian.com>
16722 * cs-parser.jay (CSharpParser): Added a new `current_class' field
16723 and removed the `current_interface' one.
16724 (struct_declaration, class_declaration, interface_declaration):
16725 Set `current_class' to the newly created class/struct/interface;
16726 set their `Bases' and call Register() before parsing their body.
16728 2004-07-23 Martin Baulig <martin@ximian.com>
16730 * class.cs (Kind): New public enum.
16731 (TypeContainer): Made this class abstract.
16732 (TypeContainer.Kind): New public readonly field.
16733 (TypeContainer.CheckDef): New public method; moved here from
16735 (TypeContainer.Register): New public abstract method.
16736 (TypeContainer.GetPendingImplementations): New public abstract
16738 (TypeContainer.GetClassBases): Removed the `is_class' and
16739 `is_iface' parameters.
16740 (TypeContainer.DefineNestedTypes): Formerly known as
16742 (ClassOrStruct): Made this class abstract.
16744 * tree.cs (RootTypes): New public type.
16746 2004-07-20 Martin Baulig <martin@ximian.com>
16748 * tree.cs (Tree.RecordNamespace): Removed.
16749 (Tree.Namespaces): Removed.
16751 * rootcontext.cs (RootContext.IsNamespace): Removed.
16753 * cs-parser.jay (namespace_declaration): Just create a new
16754 NamespaceEntry here.
16756 2004-07-20 Martin Baulig <martin@ximian.com>
16758 * statement.cs (ExceptionStatement): New abstract class. This is
16759 now used as a base class for everyone who's using `finally'.
16760 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16761 our local variables before using them.
16763 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16764 virtual method. This is used by Yield.Resolve() to "steal" an
16765 outer block's `finally' clauses.
16766 (FlowBranchingException): The .ctor now takes an ExceptionStatement
16769 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16770 version which takes an ExceptionStatement. This version must be
16771 used to create exception branchings.
16774 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16775 (Iterator.EmitMoveNext): Added exception support; protect the
16776 block with a `fault' clause, properly handle 'finally' clauses.
16777 (Iterator.EmitDispose): Run all the `finally' clauses here.
16779 2004-07-20 Martin Baulig <martin@ximian.com>
16781 * iterator.cs: This is the first of a set of changes in the
16782 iterator code. Match the spec more closely: if we're an
16783 IEnumerable, then GetEnumerator() must be called. The first time
16784 GetEnumerator() is called, it returns the current instance; all
16785 subsequent invocations (if any) must create a copy.
16787 2004-07-19 Miguel de Icaza <miguel@ximian.com>
16789 * expression.cs: Resolve the constant expression before returning
16792 2004-07-19 Martin Baulig <martin@ximian.com>
16794 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16795 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16796 the return type of the new EmitContext.
16798 2004-07-18 Martin Baulig <martin@ximian.com>
16800 * class.cs (Property.Define): Fix iterators.
16802 * iterators.cs (Iterator.Define): Moved the
16803 `container.AddInterator (this)' call here from the .ctor; only do
16804 it if we resolved successfully.
16806 2004-07-17 Miguel de Icaza <miguel@ximian.com>
16808 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16809 `true' for preprocessing directives that we parse. The return
16810 value indicates whether we should return to regular tokenizing or
16811 not, not whether it was parsed successfully.
16813 In the past if we were in: #if false ... #line #endif, we would
16814 resume parsing after `#line'. See bug 61604.
16816 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16817 building: IsEnumType should return true only for enums, not for
16818 enums or System.Enum itself. This fixes #61593.
16820 Likely what happened is that corlib was wrong: mcs depended on
16821 this bug in some places. The bug got fixed, we had to add the
16822 hack, which caused bug 61593.
16824 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16825 that was a workaround for the older conditions.
16827 2004-07-16 Ben Maurer <bmaurer@ximian.com>
16829 * assign.cs: IAssignMethod has a new interface, as documented
16830 inline. All assignment code now uses this new api.
16832 * ecore.cs, expression.cs: All classes which implement
16833 IAssignMethod now use the new interface.
16835 * expression.cs (Invocation): add a hack to EmitCall so that
16836 IndexerAccess can be the target of a compound assignment without
16837 evaluating its arguments twice.
16839 * statement.cs: Handle changes in Invocation api.
16841 2004-07-16 Martin Baulig <martin@ximian.com>
16843 * iterators.cs: Rewrote this. We're now using one single Proxy
16844 class for both the IEnumerable and the IEnumerator interface and
16845 `Iterator' derives from Class so we can use the high-level API.
16847 * class.cs (TypeContainer.AddIterator): New method.
16848 (TypeContainer.DoDefineType): New protected virtual method, which
16849 is called from DefineType().
16850 (TypeContainer.DoDefineMembers): Call DefineType() and
16851 DefineMembers() on all our iterators.
16852 (TypeContainer.Emit): Call Emit() on all our iterators.
16853 (TypeContainer.CloseType): Call CloseType() on all our iterators.
16855 * codegen.cs (EmitContext.CurrentIterator): New public field.
16857 2004-07-15 Martin Baulig <martin@ximian.com>
16860 (TypeManager.not_supported_exception_type): New type.
16862 2004-07-14 Martin Baulig <martin@ximian.com>
16864 * iterators.cs: Use real error numbers.
16866 2004-07-14 Martin Baulig <martin@ximian.com>
16868 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16869 requires this to be a System.Collection.IEnumerable and not a
16870 class implementing that interface.
16871 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
16873 2004-07-13 Marek Safar <marek.safar@seznam.cz>
16875 * class.cs: Fixed previous fix, it broke some error tests.
16877 2004-07-12 Martin Baulig <martin@ximian.com>
16879 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16882 2004-07-09 Miguel de Icaza <miguel@ximian.com>
16884 * assign.cs (LocalTemporary): Add new argument: is_address,If
16885 `is_address' is true, then the value that we store is the address
16886 to the real value, and not the value itself.
16888 * ecore.cs (PropertyExpr): use the new local temporary
16889 stuff to allow us to handle X.Y += z (where X is a struct)
16891 2004-07-08 Martin Baulig <martin@ximian.com>
16893 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16894 not always return, just like we're doing in Using.Resolve().
16896 2004-07-07 Miguel de Icaza <miguel@ximian.com>
16898 * cs-parser.jay (fixed_statement): flag this as Pinned.
16900 2004-07-06 Miguel de Icaza <miguel@ximian.com>
16902 * typemanager.cs (TypeManager): Removed MakePinned method, this
16903 mechanism is replaced with the .NET 2.x compatible mechanism of
16904 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16906 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
16907 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16908 `IsFixed' property which has a different meaning.
16910 2004-07-02 Raja R Harinath <rharinath@novell.com>
16912 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16913 visible from inside a nested class, not just the names of the
16914 immediately enclosing class.
16915 Fix for bug #60730.
16917 2004-06-24 Raja R Harinath <rharinath@novell.com>
16919 * expression.cs (BetterConversion): Remove buggy special-case
16920 handling of "implicit constant expression conversions". At this
16921 point, we already know that the conversion is possible -- we're
16922 only checking to see which is better.
16924 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16926 * cs-parser.jay: Added error CS0210 test.
16928 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16930 * cs-parser.jay: Added error CS0134 test.
16932 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16935 * cs-parser.jay: Added error CS0145 test.
16937 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16939 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16941 2004-06-23 Ben Maurer <bmaurer@ximian.com>
16943 * expression.cs (StackAlloc.Resolve): The argument may not
16944 be a constant; deal with this case.
16946 2004-06-23 Marek Safar <marek.safar@seznam.cz>
16948 * attribute.cs (IndexerName_GetIndexerName): Renamed to
16949 GetIndexerAttributeValue.
16950 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16952 * class.cs (Indexer.Define): Added error tests for CS0415,
16955 2004-06-23 Miguel de Icaza <miguel@ximian.com>
16957 * attribute.cs (Attribute.Resolve): Keep field code in sync with
16960 2004-06-23 Martin Baulig <martin@ximian.com>
16962 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16963 neither return nor throw, reset the barrier as well. Fixes #60457.
16965 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
16967 * class.cs : EventAttributes is now set to None by default.
16968 This fixes bug #60459.
16970 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16973 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16974 Don't throw exception but return null (it's sufficient now).
16976 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16978 * typemanager.cs (GetArgumentTypes): Faster implementation.
16980 2004-06-18 Martin Baulig <martin@ximian.com>
16982 * attribute.cs (Attribute.Resolve): Check whether we're an
16983 EmptyCast which a Constant child. Fixes #60333.
16985 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16987 * statement.cs (EmitCollectionForeach): Account for the fact that
16988 not all valuetypes are in areas which we can take the address of.
16989 For these variables, we store to a temporary variable. Also, make
16990 sure that we dont emit a `callvirt' on a valuetype method.
16992 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16994 * expression.cs (StackAlloc.DoReSolve): Added test for
16995 negative parameter (CS0247).
16997 2004-06-15 Marek Safar <marek.safar@seznam.cz>
17000 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
17002 2004-06-15 Marek Safar <marek.safar@seznam.cz>
17005 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
17008 2004-06-14 Marek Safar <marek.safar@seznam.cz>
17010 Fix bug #58254 & cs1555.cs, cs1556.cs
17011 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
17013 2004-06-14 Marek Safar <marek.safar@seznam.cz>
17015 * cs-parser.jay: Added error CS1669 test for indexers.
17017 2004-06-11 Martin Baulig <martin@ximian.com>
17019 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
17020 call this twice: for params and varargs methods.
17022 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17025 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
17027 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17029 * attribute.cs (Attribute.GetValidTargets): Made public.
17032 (AbstractPropertyEventMethod): New class for better code sharing.
17033 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
17035 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
17037 2004-06-11 Raja R Harinath <rharinath@novell.com>
17040 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
17041 that the call to Resolve is part of a MemberAccess.
17042 (Expression.Resolve): Use it for SimpleName resolution.
17043 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
17044 Add 'intermediate' boolean argument.
17045 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
17046 error message when the SimpleName can be resolved ambiguously
17047 between an expression and a type.
17048 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
17050 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
17051 call on the left-side.
17053 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17056 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
17058 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17060 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
17062 2004-06-11 Martin Baulig <martin@ximian.com>
17064 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
17065 varargs methods if applicable.
17067 2004-06-11 Martin Baulig <martin@ximian.com>
17069 * expression.cs (Invocation.EmitCall): Don't use
17070 `method.CallingConvention == CallingConventions.VarArgs' since the
17071 method could also have `CallingConventions.HasThis'.
17073 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17075 * class.cs (Event.GetSignatureForError): Implemented.
17076 Fixed crash in error test cs3010.cs
17078 2004-06-10 Miguel de Icaza <miguel@ximian.com>
17080 * cs-tokenizer.cs: Change the way we track __arglist to be
17081 consistent with the other keywords.
17083 2004-06-09 Miguel de Icaza <miguel@ximian.com>
17085 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
17088 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
17090 * codegen.cs: Check that all referenced assemblies have a strongname
17091 before strongnaming the compiled assembly. If not report error CS1577.
17092 Fix bug #56563. Patch by Jackson Harper.
17093 * typemanager.cs: Added a method to return all referenced assemblies.
17094 Fix bug #56563. Patch by Jackson Harper.
17096 2004-06-08 Marek Safar <marek.safar@seznam.cz>
17099 (Method.ApplyAttributeBuilder): Moved and added conditional
17100 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
17103 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
17105 2004-06-08 Marek Safar <marek.safar@seznam.cz>
17108 * class.cs: (EventField.attribute_targets): Changed default target.
17110 2004-06-08 Martin Baulig <martin@ximian.com>
17112 * expression.cs (Invocation.EmitCall): Enable varargs methods.
17114 2004-06-08 Martin Baulig <martin@ximian.com>
17116 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
17118 2004-06-07 Martin Baulig <martin@ximian.com>
17120 Added support for varargs methods.
17122 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
17125 * cs-parser.jay: Added support for `__arglist'.
17127 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
17129 * expression.cs (Argument.AType): Added `ArgList'.
17130 (Invocation): Added support for varargs methods.
17131 (ArglistAccess): New public class.
17132 (Arglist): New public class.
17134 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
17136 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
17137 a method's top-level block if the method has varargs.
17139 * support.cs (ReflectionParameters, InternalParameters): Added
17140 support for varargs methods.
17142 2004-06-07 Miguel de Icaza <miguel@ximian.com>
17144 * class.cs: Provide location in indexer error report.
17146 * driver.cs: Use standard names.
17148 * namespace.cs: Catch the use of using after a namespace has been
17149 declared also on using aliases.
17151 2004-06-03 Raja R Harinath <rharinath@novell.com>
17154 * typemanager.cs (closure_private_ok, closure_invocation_type)
17155 (closure_qualifier_type, closure_invocation_assembly)
17156 (FilterWithClosure): Move to ...
17157 (Closure): New internal nested class.
17158 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
17159 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
17160 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
17161 (MemberLookup, MemberLookupFailed): Use it.
17162 * expression.cs (New.DoResolve): Treat the lookup for the
17163 constructor as being qualified by the 'new'ed type.
17164 (Indexers.GetIndexersForTypeOrInterface): Update.
17166 2004-06-03 Marek Safar <marek.safar@seznam.cz>
17169 (GetConditionalAttributeValue): New method. Returns
17170 condition of ConditionalAttribute.
17171 (SearchMulti): New method. Returns all attributes of type 't'.
17172 Use it when attribute is AllowMultiple = true.
17173 (IsConditionalMethodExcluded): New method.
17176 (Method.IsExcluded): Implemented. Returns true if method has conditional
17177 attribute and the conditions is not defined (method is excluded).
17178 (IMethodData): Extended interface for ConditionalAttribute support.
17179 (PropertyMethod.IsExcluded): Implemented.
17182 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
17185 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
17188 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
17190 * expression.cs (ArrayCreationExpression): Make this just an
17191 `expression'. It can't be a statement, so the code here was
17194 2004-06-02 Marek Safar <marek.safar@seznam.cz>
17197 * typemanager.cs (GetFullNameSignature): New method for
17200 2004-06-02 Marek Safar <marek.safar@seznam.cz>
17203 * class.cs (MemberBase.GetSignatureForError): New virtual method.
17204 Use this method when MethodBuilder is null.
17205 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
17206 Added test for error CS0626 (MONO reports error for this situation).
17207 (IMethodData.GetSignatureForError): Extended interface.
17209 2004-06-01 Marek Safar <marek.safar@seznam.cz>
17212 (AttributeTester.GetObsoleteAttribute): Returns instance of
17213 ObsoleteAttribute when type is obsolete.
17216 (TypeContainer.VerifyObsoleteAttribute): Override.
17217 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
17218 (MethodCode.VerifyObsoleteAttribute): Override.
17219 (MemberBase.VerifyObsoleteAttribute): Override.
17222 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
17223 and report proper error.
17226 Delegate.VerifyObsoleteAttribute): Override.
17229 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
17230 and report proper error.
17231 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
17234 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
17238 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
17239 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
17240 Added test for ObsoleteAttribute.
17243 (Catch): Derived from Statement.
17245 2004-06-01 Marek Safar <marek.safar@seznam.cz>
17247 Fixed bug #59071 & cs0160.cs
17249 * statement.cs (Try.Resolve): Check here whether order of catch
17250 clauses matches their dependencies.
17252 2004-05-31 Miguel de Icaza <miguel@ximian.com>
17254 * Reverted patch to namespace.cs (Use lookuptypedirect). This
17255 caused a regression: #59343. Referencing nested classes from an
17256 assembly stopped working.
17258 2004-05-31 Martin Baulig <martin@ximian.com>
17260 MCS is now frozen for beta 2.
17262 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17264 * convert.cs: add a trivial cache for overload operator resolution.
17266 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17268 * decl.cs: If possible, use lookuptypedirect here. We can only do
17269 this if there is no `.' after the namespace. Avoids using
17270 LookupType, which does lots of slow processing.
17271 (FindNestedType) New method, does what it says :-).
17272 * namespace.cs: use LookupTypeDirect.
17273 * rootcontext.cs: use membercache, if possible.
17274 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
17276 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17279 According to the spec,
17281 In a member access of the form E.I, if E is a single identifier,
17282 and if the meaning of E as a simple-name (§7.5.2) is a constant,
17283 field, property, localvariable, or parameter with the same type as
17284 the meaning of E as a type-name (§3.8), then both possible
17285 meanings of E are permitted.
17287 We did not check that E as a simple-name had the same type as E as
17290 This trivial check gives us 5-7% on bootstrap time.
17292 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17294 * expression.cs (Invocation.OverloadResolve): Avoid the
17295 use of hashtables and boxing here by allocating on demand.
17297 2004-05-30 Martin Baulig <martin@ximian.com>
17299 * rootcontext.cs (RootContext.LookupType): Don't cache things if
17300 we're doing a silent lookup. Don't try to lookup nested types in
17301 TypeManager.object_type (thanks to Ben Maurer).
17303 2004-05-30 Martin Baulig <martin@ximian.com>
17305 Committing a patch from Ben Maurer.
17307 * rootcontext.cs (RootContext.LookupType): Cache negative results.
17309 2004-05-29 Martin Baulig <martin@ximian.com>
17311 * class.cs (IMethodData.ShouldIgnore): New method.
17313 * typemanager.cs (TypeManager.MethodFlags): Don't take a
17314 `Location' argument, we don't need it anywhere. Use
17315 `IMethodData.ShouldIgnore ()' instead of
17316 `MethodData.GetMethodFlags ()'.
17317 (TypeManager.AddMethod): Removed.
17318 (TypeManager.AddMethod2): Renamed to AddMethod.
17320 2004-05-29 Martin Baulig <martin@ximian.com>
17322 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
17324 * convert.cs (Convert.ImplicitReferenceConversion): If we're
17325 converting from a class type S to an interface type and we already
17326 have an object on the stack, don't box it again. Fixes #52578.
17328 2004-05-29 Martin Baulig <martin@ximian.com>
17330 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17331 Added support for `params' parameters. Fixes #59267.
17333 2004-05-29 Martin Baulig <martin@ximian.com>
17335 * literal.cs (NullPointer): Provide a private .ctor which sets
17336 `type' to TypeManager.object_type. Fixes #59048.
17338 2004-05-29 Martin Baulig <martin@ximian.com>
17340 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
17341 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
17343 * ecore.cs (EventExpr.instance_expr): Make the field private.
17345 2004-05-26 Marek Safar <marek.safar@seznam.cz>
17347 Fixed bug #50080 & cs0214-2.cs
17348 * expression.cs (Cast.DoResolve): Check unsafe context here.
17350 * statement.cs (Resolve.DoResolve): Likewise.
17352 2004-05-26 Martin Baulig <martin@ximian.com>
17354 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
17356 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
17357 (RootContext.LookupType): Pass down the `silent' flag.
17359 2004-05-25 Martin Baulig <martin@ximian.com>
17362 (MethodGroupExpr.IdenticalTypeName): New public property.
17363 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
17364 expression actually refers to a type.
17366 2004-05-25 Martin Baulig <martin@ximian.com>
17368 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
17369 for #56176 and made it actually work.
17371 2004-05-25 Martin Baulig <martin@ximian.com>
17373 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
17374 (FieldExpr, PropertyExpr): Override and implement
17375 CacheTemporaries. Fixes #52279.
17377 2004-05-25 Miguel de Icaza <miguel@ximian.com>
17379 * location.cs: In the new compiler listing a file twice is a
17380 warning, not an error.
17382 2004-05-24 Martin Baulig <martin@ximian.com>
17384 * enum.cs (Enum.DefineType): For the `BaseType' to be a
17385 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
17387 2004-05-24 Martin Baulig <martin@ximian.com>
17389 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
17390 walking the `using' list. Fixes #53921.
17392 2004-05-24 Martin Baulig <martin@ximian.com>
17394 * const.cs (Const.LookupConstantValue): Added support for
17395 EmptyCast's; fixes #55251.
17397 2004-05-24 Martin Baulig <martin@ximian.com>
17399 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17400 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17401 which does the CS0135 check. The reason is that we first need to
17402 check whether the variable actually exists.
17404 2004-05-24 Martin Baulig <martin@ximian.com>
17406 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17407 than RootContext.LookupType() to find the explicit interface
17408 type. Fixes #58584.
17410 2004-05-24 Raja R Harinath <rharinath@novell.com>
17412 * Makefile: Simplify. Use executable.make.
17413 * mcs.exe.sources: New file. List of sources of mcs.exe.
17415 2004-05-24 Anders Carlsson <andersca@gnome.org>
17419 Use the invariant culture when doing String.Compare for CLS case
17422 2004-05-23 Martin Baulig <martin@ximian.com>
17424 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17425 don't have any dots. Fixes #52622, added cs0246-8.cs.
17427 * namespace.cs (NamespaceEntry.Lookup): Likewise.
17429 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17431 * class.cs (MemberBase.Define): Reuse MemberType member for
17432 resolved type. Other methods can use it too.
17434 2004-05-23 Martin Baulig <martin@ximian.com>
17436 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17437 the variable also exists in the current block (otherwise, we need
17438 to report a CS0103). Fixes #58670.
17440 2004-05-23 Martin Baulig <martin@ximian.com>
17442 * flowanalysis.cs (Reachability.Reachable): Compute this
17443 on-the-fly rather than storing it as a field.
17445 2004-05-23 Martin Baulig <martin@ximian.com>
17447 * flowanalysis.cs (Reachability.And): Manually compute the
17448 resulting `barrier' from the reachability.
17450 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17453 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17454 instance of ObsoleteAttribute when symbol is obsolete.
17457 (IMethodData): Extended interface for ObsoleteAttribute support.
17459 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17461 * attribute.cs: Fix bug #55970
17463 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17467 (GetObsoleteAttribute): New method. Creates the instance of
17469 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17470 ObsoleteAttribute when member is obsolete.
17471 (AttributeTester.Report_ObsoleteMessage): Common method for
17472 Obsolete error/warning reporting.
17475 (TypeContainer.base_classs_type): New member for storing parent type.
17478 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17479 for this MemberCore.
17481 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17483 * attribute.cs, const.cs: Fix bug #58590
17485 2004-05-21 Martin Baulig <martin@ximian.com>
17487 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17488 out parameters if the end of the method is unreachable. Fixes
17491 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17493 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17494 Hari was right, why extra method.
17496 2004-05-21 Marek Safar <marek.safar@seznam.cz>
17498 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17500 2004-05-20 Martin Baulig <martin@ximian.com>
17502 Merged this back from gmcs to keep the differences to a minumum.
17504 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17505 instead of a Declspace.
17506 (Attribute.ResolveType): Likewise.
17507 (Attributes.Search): Likewise.
17508 (Attributes.Contains): Likewise.
17509 (Attributes.GetClsCompliantAttribute): Likewise.
17511 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17513 (MethodData.ApplyAttributes): Take an EmitContext instead of a
17516 2004-05-19 Marek Safar <marek.safar@seznam.cz>
17518 Fix bug #58688 (MCS does not report error when the same attribute
17521 * attribute.cs (Attribute.Emit): Distinction between null and default.
17523 2004-05-19 Raja R Harinath <rharinath@novell.com>
17525 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17526 of a top-level attribute without an attribute target.
17527 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
17529 (Attribute.Conditional_GetConditionName),
17530 (Attribute.Obsolete_GetObsoleteMessage): Update.
17531 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
17532 part of ScanForIndexerName.
17533 (Attribute.CanIgnoreInvalidAttribute): New function.
17534 (Attribute.ScanForIndexerName): Move to ...
17535 (Attributes.ScanForIndexerName): ... here.
17536 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17537 (Attributes.Search): New internal variant that can choose not to
17538 complain if types aren't resolved. The original signature now
17540 (Attributes.GetClsCompliantAttribute): Use internal variant, with
17541 complaints suppressed.
17542 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17543 only if it not useful.
17544 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17545 top-level for attributes that are shared between the assembly
17546 and a top-level class.
17547 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17548 * class.cs: Update to reflect changes.
17549 (DefineIndexers): Fuse loops.
17550 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
17551 a couple more variants of attribute names.
17553 2004-05-18 Marek Safar <marek.safar@seznam.cz>
17555 Fix bug #52585 (Implemented explicit attribute declaration)
17558 (Attributable.ValidAttributeTargets): New abstract method. It gets
17559 list of valid attribute targets for explicit target declaration.
17560 (Attribute.Target): It holds target itself.
17561 (AttributeSection): Removed.
17562 (Attribute.CheckTargets): New method. It checks whether attribute
17563 target is valid for the current element.
17566 (EventProperty): New class. For events that are declared like
17567 property (with add and remove accessors).
17568 (EventField): New class. For events that are declared like field.
17571 * cs-parser.jay: Implemented explicit attribute target declaration.
17573 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
17574 Override ValidAttributeTargets.
17577 (ReturnParameter): Class for applying custom attributes on
17579 (ParameterAtribute): New class. Class for applying custom
17580 attributes on the parameter type.
17582 2004-05-17 Miguel de Icaza <miguel@ximian.com>
17584 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17587 (Method): Allow UNSAFE here.
17589 * modifiers.cs: Support unsafe reporting.
17591 2004-05-17 Marek Safar <marek.safar@seznam.cz>
17593 * decl.cs: Fix bug #58478.
17595 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17597 * statement.cs: When checking for unreachable code on an EmptyStatement,
17598 set the location. Fixes bug #58488.
17600 2004-05-13 Miguel de Icaza <miguel@ximian.com>
17602 * driver.cs: Add -pkg handling.
17604 From Gonzalo: UseShelLExecute=false
17606 2004-05-12 Marek Safar <marek.safar@seznam.cz>
17609 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17611 (Attribute.IsClsCompliaceRequired): Moved to base for better
17613 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17614 when attribute is AttributeUsageAttribute.
17615 (Attribute.GetValidTargets): Simplified.
17616 (Attribute.GetAttributeUsage): New method returns AttributeUsage
17617 attribute for this type.
17618 (Attribute.ApplyAttributes): Method renamed to Emit and make
17620 (GlobalAttributeSection): New class for special handling of global
17621 attributes (assembly, module).
17622 (AttributeSection.Emit): New method.
17624 * class.cs: Implemented Attributable abstract methods.
17625 (MethodCore.LabelParameters): Moved to Parameter class.
17626 (Accessor): Is back simple class.
17627 (PropertyMethod): Implemented Attributable abstract class.
17628 (DelegateMethod): Implemented Attributable abstract class.
17629 (Event): New constructor for disctintion between normal Event
17630 and Event with accessors.
17632 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17634 * codegen.cs, const.cs, decl.cs, delegate.cs:
17635 (CommonAssemblyModulClass): Implemented Attributable abstract class
17638 * enum.cs: Implement IAttributeSupport interface.
17639 (EnumMember): New class for emum members. Implemented Attributable
17643 (ParameterBase): Is abstract.
17644 (ReturnParameter): New class for easier [return:] attribute handling.
17646 * typemanager.cs: Removed builder_to_attr.
17648 2004-05-11 Raja R Harinath <rharinath@novell.com>
17651 * attribute.cs (Attribute.GetPositionalValue): New function.
17652 * class.cs (TypeContainer.VerifyMembers): New function.
17653 (TypeContainer.Emit): Use it.
17654 (ClassOrStruct): New base class for Class and Struct.
17655 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
17656 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17658 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17659 then each non-static field should have a FieldOffset attribute.
17660 Otherwise, none of the fields should have a FieldOffset attribute.
17661 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
17662 and FieldOffset attributes.
17663 * typemanager.cs (TypeManager.struct_layout_attribute_type)
17664 (TypeManager.field_offset_attribute_type): New core types.
17665 (TypeManager.InitCoreTypes): Initialize them.
17667 2004-05-11 Michal Moskal <malekith@pld-linux.org>
17669 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17670 Return correct type.
17673 2004-05-09 Miguel de Icaza <miguel@ximian.com>
17675 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17676 be implicitly converted to ulong.
17678 * expression.cs: The logic for allowing operator &, | and ^ worked
17679 was wrong, it worked before because we did not report an error in
17680 an else branch. Fixes 57895.
17682 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17683 allow volatile fields to be reference types.
17685 2004-05-07 Miguel de Icaza <miguel@ximian.com>
17687 * driver.cs: Add support for /debug-
17689 2004-05-07 Raja R Harinath <rharinath@novell.com>
17691 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
17692 Add a 'complain' parameter to silence errors.
17693 (Attribute.Resolve): Update to changes. Put in sanity check to catch
17694 silently overlooked type-resolutions.
17695 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17696 to reflect changes.
17697 (Attributes.Search): New function.
17698 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17699 (Attributes.GetAttributeFullName): Remove hack.
17700 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
17701 Update to reflect changes.
17702 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17703 Use Attributes.Search instead of nested loops.
17705 2004-05-07 Marek Safar <marek.safar@seznam.cz>
17708 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17709 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17710 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17712 * report.cs: (Report.Warning): Renamed to Warning_T because of
17713 parameter collision.
17715 2004-05-05 Raja R Harinath <rharinath@novell.com>
17717 * expression.cs (MemberAccess.ResolveMemberAccess):
17718 Exit with non-zero status after Report.Error.
17719 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17721 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17723 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17725 * support.cs: Don't hang when the file is empty.
17727 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
17729 * support.cs: In SeekableStreamReader, compute the preamble size of the
17730 underlying stream. Position changes should take into account that initial
17733 2004-05-03 Todd Berman <tberman@sevenl.net>
17735 * driver.cs: remove unused GetSysVersion function.
17737 2004-05-03 Todd Berman <tberman@sevenl.net>
17739 * driver.cs: Remove the hack from saturday, as well as the hack
17740 from jackson (LoadAssemblyFromGac), also adds the CWD to the
17741 link_paths to get that bit proper.
17743 2004-05-01 Todd Berman <tberman@sevenl.net>
17745 * driver.cs: Try a LoadFrom before a Load, this checks the current
17746 path. This is currently a bug in mono that is be fixed, however, this
17747 provides a workaround for now. This will be removed when the bug
17750 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
17752 * CryptoConvert.cs: Updated to latest version. Fix issue with
17753 incomplete key pairs (#57941).
17755 2004-05-01 Todd Berman <tberman@sevenl.net>
17757 * driver.cs: Remove '.' from path_chars, now System.* loads properly
17760 2004-04-30 Jackson Harper <jackson@ximian.com>
17762 * codegen.cs: Open keys readonly.
17764 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17766 * typemanager.cs: don't report cyclic struct layout when a struct
17767 contains 2 or more fields of the same type. Failed for Pango.AttrShape
17768 which has 2 Pango.Rectangle fields.
17770 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
17772 * expression.cs: Handle IntPtr comparisons with IL code
17773 rather than a method call.
17775 2004-04-29 Martin Baulig <martin@ximian.com>
17777 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
17778 the list of PropertyInfo's in class hierarchy and find the
17779 accessor. Fixes #56013.
17781 2004-04-29 Martin Baulig <martin@ximian.com>
17783 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17785 2004-04-29 Martin Baulig <martin@ximian.com>
17787 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17789 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17791 2004-04-29 Martin Baulig <martin@ximian.com>
17793 * class.cs (ConstructorInitializer.Resolve): Check whether the
17794 parent .ctor is accessible. Fixes #52146.
17796 2004-04-29 Martin Baulig <martin@ximian.com>
17798 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17800 * statement.cs (Using.EmitLocalVariableDecls): Use
17801 TypeManager.idisposable_type, not typeof (IDisposable).
17802 (Foreach.EmitCollectionForeach): Added support for valuetypes.
17804 2004-04-29 Martin Baulig <martin@ximian.com>
17806 * class.cs (Event.Define): Don't emit the field and don't set
17807 RTSpecialName and SpecialName for events on interfaces. Fixes
17810 2004-04-29 Raja R Harinath <rharinath@novell.com>
17812 Refactor Attribute.ApplyAttributes.
17813 * attribute.cs (Attributable): New base class for objects that can
17814 have Attributes applied on them.
17815 (Attribute): Make AttributeUsage fields public.
17816 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17817 (Attribute.IsInternalCall): New property.
17818 (Attribute.UsageAttr): Convert to a public read-only property.
17819 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17820 (Attribute.ResolveType, Attribute.Resolve)
17821 (Attribute.ScanForIndexerName): Update to reflect changes.
17822 (Attribute.CheckAttributeTarget): Re-format.
17823 (Attribute.ApplyAttributes): Refactor, to various
17824 Attributable.ApplyAttributeBuilder methods.
17825 * decl.cs (MemberCore): Make Attributable.
17826 * class.cs (Accessor): Make Attributable.
17827 (MethodData.ApplyAttributes): Use proper attribute types, not
17829 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17830 (TypeContainer.ApplyAttributeBuilder)
17831 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17832 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
17833 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17834 (Operator.ApplyAttributeBuilder): New factored-out methods.
17835 * const.cs (Const.ApplyAttributeBuilder): Likewise.
17836 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17837 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17838 * parameter.cs (ParameterBase): New Attributable base class
17839 that can also represent Return types.
17840 (Parameter): Update to the changes.
17842 2004-04-29 Jackson Harper <jackson@ximian.com>
17844 * driver.cs: Prefer the corlib system version when looking for
17845 assemblies in the GAC. This is still a hack, but its a better hack
17848 2004-04-29 Marek Safar <marek.safar@seznam.cz>
17850 * decl.cs, enum.cs: Improved error 3005 reporting.
17852 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17853 (related_symbols): New private member for list of symbols
17854 related to reported error/warning.
17856 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17858 2004-04-29 Martin Baulig <martin@ximian.com>
17860 * ecore.cs (Expression.Constantify): If we're an enum and
17861 TypeManager.TypeToCoreType() doesn't give us another type, use
17862 t.UnderlyingSystemType. Fixes #56178.
17864 2004-04-29 Martin Baulig <martin@ximian.com>
17866 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17867 interfaces and for each interface, only add members directly
17868 declared in that interface. Fixes #53255.
17870 2004-04-28 Martin Baulig <martin@ximian.com>
17872 * expression.cs (ConditionalLogicalOperator): Use a temporary
17873 variable for `left' to avoid that we evaluate it more than once;
17876 2004-04-28 Martin Baulig <martin@ximian.com>
17878 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17881 2004-04-28 Martin Baulig <martin@ximian.com>
17883 * statement.cs (LocalInfo.Resolve): Check whether the type is not
17886 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17887 whether the type is not void (CS1547).
17889 2004-04-28 Martin Baulig <martin@ximian.com>
17891 * expression.cs (Unary.DoResolveLValue): Override this and report
17892 CS0131 for anything but Operator.Indirection.
17894 2004-04-28 Martin Baulig <martin@ximian.com>
17896 Committing a patch from Ben Maurer; see bug #50820.
17898 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17901 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17904 2004-04-28 Martin Baulig <martin@ximian.com>
17906 Committing a patch from Ben Maurer; see bug #50820.
17908 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17911 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17914 2004-04-28 Martin Baulig <martin@ximian.com>
17916 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17917 (Block.AddLabel): Call DoLookupLabel() to only search in the
17920 2004-04-28 Martin Baulig <martin@ximian.com>
17922 * cfold.cs (ConstantFold.BinaryFold): Added special support for
17923 comparing StringConstants and NullLiterals in Equality and Inequality.
17925 2004-04-28 Jackson Harper <jackson@ximian.com>
17927 * driver.cs: Attempt to load referenced assemblies from the
17928 GAC. This is the quick and dirty version of this method that
17929 doesnt take into account versions and just takes the first
17930 canidate found. Will be good enough for now as we will not have more
17931 then one version installed into the GAC until I update this method.
17933 2004-04-28 Martin Baulig <martin@ximian.com>
17935 * typemanager.cs (TypeManager.CheckStructCycles): New public
17936 static method to check for cycles in the struct layout.
17938 * rootcontext.cs (RootContext.PopulateTypes): Call
17939 TypeManager.CheckStructCycles() for each TypeContainer.
17940 [Note: We only need to visit each type once.]
17942 2004-04-28 Martin Baulig <martin@ximian.com>
17944 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17946 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17947 success and added `out object value'. Use a `bool resolved' field
17948 to check whether we've already been called rather than
17949 `ConstantValue != null' since this breaks for NullLiterals.
17951 2004-04-28 Raja R Harinath <rharinath@novell.com>
17953 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17954 setting of this flag, since the 'set' method may be non-public.
17956 2004-04-28 Raja R Harinath <rharinath@novell.com>
17958 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17959 check on current_vector.Block.
17961 2004-04-27 Martin Baulig <martin@ximian.com>
17963 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17964 a field initializer. Fixes #56459.
17966 2004-04-27 Martin Baulig <martin@ximian.com>
17968 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17969 we're not attempting to use an indexer. Fixes #52154.
17971 2004-04-27 Martin Baulig <martin@ximian.com>
17973 * statement.cs (Return): Don't create a return label if we don't
17974 need it; reverts my change from January 20th. Thanks to Ben
17977 2004-04-27 Martin Baulig <martin@ximian.com>
17979 According to the spec, `goto' can only leave a nested scope, but
17982 * statement.cs (Block.LookupLabel): Only lookup in the current
17983 block, don't recurse into parent or child blocks.
17984 (Block.AddLabel): Check in parent and child blocks, report
17985 CS0140/CS0158 if we find a duplicate.
17986 (Block): Removed this indexer for label lookups.
17987 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17988 this already does the error reporting for us.
17991 (FlowBranching.UsageVector.Block): New public variable; may be null.
17992 (FlowBranching.CreateSibling): Added `Block' argument.
17993 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17994 label for the target of a `goto' and check whether we're not
17995 leaving a `finally'.
17997 2004-04-27 Martin Baulig <martin@ximian.com>
17999 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
18000 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
18003 2004-04-27 Martin Baulig <martin@ximian.com>
18005 * statement.cs (Block.AddLabel): Also check for implicit blocks
18006 and added a CS0158 check.
18008 2004-04-27 Martin Baulig <martin@ximian.com>
18010 * flowanalysis.cs (FlowBranchingLoop): New class.
18011 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
18012 UsageVector's instead of an ArrayList.
18013 (FlowBranching.Label): Likewise.
18014 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
18015 (FlowBranching.AddBreakVector): New method.
18017 2004-04-27 Miguel de Icaza <miguel@ximian.com>
18019 * attribute.cs: Small regression fix: only convert the type if we
18020 the type is different, fixes System.Drawing build.
18022 2004-04-27 Martin Baulig <martin@ximian.com>
18024 * attribute.cs (Attribute.Resolve): If we have a constant value
18025 for a named field or property, implicity convert it to the correct
18028 2004-04-27 Raja R Harinath <rharinath@novell.com>
18030 * statement.cs (Block.Block): Implicit blocks share
18031 'child_variable_names' fields with parent blocks.
18032 (Block.AddChildVariableNames): Remove.
18033 (Block.AddVariable): Mark variable as "used by a child block" in
18034 every surrounding block.
18035 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
18036 been used in a child block, complain about violation of "Invariant
18037 meaning in blocks" rule.
18038 * cs-parser.jay (declare_local_variables): Don't use
18039 AddChildVariableNames.
18040 (foreach_statement): Don't create an implicit block: 'foreach'
18041 introduces a scope.
18043 2004-04-23 Miguel de Icaza <miguel@ximian.com>
18045 * convert.cs (ImplicitNumericConversion): 0 is also positive when
18046 converting from 0L to ulong. Fixes 57522.
18048 2004-04-22 Marek Safar <marek.safar@seznam.cz>
18050 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
18051 derived class hides via 'new' keyword field from base class (test-242.cs).
18052 TODO: Handle this in the more general way.
18054 * class.cs (CheckBase): Ditto.
18056 2004-04-22 Marek Safar <marek.safar@seznam.cz>
18058 * decl.cs (caching_flags): New member for storing cached values
18060 (MemberCore.Flags): New enum where bit flags for caching_flags
18062 (MemberCore.cls_compliance): Moved to caching_flags.
18063 (DeclSpace.Created): Moved to caching_flags.
18065 * class.cs: Use caching_flags instead of DeclSpace.Created
18067 2004-04-21 Miguel de Icaza <miguel@ximian.com>
18069 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
18070 if we are only a derived class, not a nested class.
18072 * typemanager.cs: Same as above, but do this at the MemberLookup
18073 level (used by field and methods, properties are handled in
18074 PropertyExpr). Allow for the qualified access if we are a nested
18077 2004-04-21 Marek Safar <marek.safar@seznam.cz>
18079 * class.cs: Refactoring.
18080 (IMethodData): New inteface; Holds links to parent members
18081 to avoid member duplication (reduced memory allocation).
18082 (Method): Implemented IMethodData interface.
18083 (PropertyBase): New inner classes for get/set methods.
18084 (PropertyBase.PropertyMethod): Implemented IMethodData interface
18085 (Event): New inner classes for add/remove methods.
18086 (Event.DelegateMethod): Implemented IMethodData interface.
18088 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
18089 EmitContext (related to class.cs refactoring).
18091 2004-04-21 Raja R Harinath <rharinath@novell.com>
18093 * delegate.cs (Delegate.VerifyApplicability): If the number of
18094 arguments are the same as the number of parameters, first try to
18095 verify applicability ignoring any 'params' modifier on the last
18099 2004-04-16 Raja R Harinath <rharinath@novell.com>
18101 * class.cs (TypeContainer.AddIndexer): Use
18102 'ExplicitInterfaceName' to determine if interface name was
18103 explicitly specified. 'InterfaceType' is not initialized at this time.
18104 (TypeContainer.DefineIndexers): Remove use of temporary list. The
18105 Indexers array is already in the required order. Initialize
18106 'IndexerName' only if there are normal indexers.
18107 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
18108 (TypeContainer.Emit): Emit DefaultMember attribute only if
18109 IndexerName is initialized.
18112 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
18114 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
18117 2004-04-15 Raja R Harinath <rharinath@novell.com>
18119 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
18123 * attribute.cs (Attribute.Resolve): Check for duplicate named
18127 2004-04-15 Miguel de Icaza <miguel@ximian.com>
18129 * iterators.cs (MarkYield): track whether we are in an exception,
18130 and generate code accordingly. Use a temporary value to store the
18131 result for our state.
18133 I had ignored a bit the interaction of try/catch with iterators
18134 since their behavior was not entirely obvious, but now it is
18135 possible to verify that our behavior is the same as MS .NET 2.0
18139 2004-04-14 Miguel de Icaza <miguel@ximian.com>
18141 * iterators.cs: Avoid creating temporaries if there is no work to
18144 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
18145 Enumerations, use TypeManager.EnumToUnderlying and call
18148 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
18151 (This.Emit): Use EmitContext.EmitThis to emit our
18154 (This.EmitAssign): Ditto.
18156 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
18157 codepaths, we will move all the functionality into
18160 (FieldExpr.EmitAssign): Ditto.
18162 This fixes several hidden bugs that I uncovered while doing a code
18163 review of this today.
18165 * codegen.cs (EmitThis): reworked so the semantics are more clear
18166 and also support value types "this" instances.
18168 * iterators.cs: Changed so that for iterators in value types, we
18169 do not pass the value type as a parameter.
18171 Initialization of the enumerator helpers is now done in the caller
18172 instead of passing the parameters to the constructors and having
18173 the constructor set the fields.
18175 The fields have now `assembly' visibility instead of private.
18177 2004-04-11 Miguel de Icaza <miguel@ximian.com>
18179 * expression.cs (Argument.Resolve): Check if fields passed as ref
18180 or out are contained in a MarshalByRefObject.
18182 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
18183 another compiler type.
18185 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
18187 * class.cs (Indexer.Define): use the new name checking method.
18188 Also, return false on an error.
18189 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
18190 (is_identifier_[start/part]_character): make static.
18192 2004-04-10 Miguel de Icaza <miguel@ximian.com>
18194 * expression.cs (Binary.ResolveOperator): Do no append strings
18195 twice: since we can be invoked more than once (array evaluation)
18196 on the same concatenation, take care of this here. Based on a fix
18197 from Ben (bug #56454)
18199 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
18201 * codegen.cs: Fix another case where CS1548 must be reported (when
18202 delay-sign isn't specified and no private is available #56564). Fix
18203 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
18204 error when MCS is used on the MS runtime and we need to delay-sign
18205 (which seems unsupported by AssemblyBuilder - see #56621).
18207 2004-04-08 Marek Safar <marek.safar@seznam.cz>
18209 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
18210 (TypeManager.ComputeNamespaces): Faster implementation for
18213 * compiler.csproj: Updated AssemblyName to mcs.
18215 2004-04-07 Miguel de Icaza <miguel@ximian.com>
18217 * rootcontext.cs: Add new types to the boot resolution.
18219 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
18220 MulticastDelegate is not allowed.
18222 * typemanager.cs: Add new types to lookup: System.TypedReference
18225 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
18226 check for TypedReference or ArgIterator, they are not allowed.
18228 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
18229 makes us properly catch 1510 in some conditions (see bug 56016 for
18232 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
18234 * CryptoConvert.cs: update from corlib version
18237 2004-04-05 Miguel de Icaza <miguel@ximian.com>
18239 * class.cs (Indexer.Define): Check indexername declaration
18241 2004-04-05 Marek Safar <marek.safar@seznam.cz>
18243 * attribute.cs (IsClsCompliant): Fixed problem with handling
18244 all three states (compliant, not-compliant, undetected).
18246 2004-03-30 Marek Safar <marek.safar@seznam.cz>
18248 * attribute.cs (Attribute): Location is now public.
18249 (Resolve): Store resolved arguments (pos_values) in attribute class.
18250 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
18251 (GetClsCompliantAttributeValue): New method that gets
18252 CLSCompliantAttribute value.
18253 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
18254 if exists else null.
18255 (AttributeTester): New class for CLS-Compliant verification routines.
18257 * class.cs (Emit): Add CLS-Compliant verification.
18258 (Method.GetSignatureForError): Implemented.
18259 (Constructor.GetSignatureForError): Implemented
18260 (Constructor.HasCompliantArgs): Returns if constructor has
18261 CLS-Compliant arguments.
18262 (Constructor.Emit): Override.
18263 (Construcor.IsIdentifierClsCompliant): New method; For constructors
18264 is needed to test only parameters.
18265 (FieldBase.GetSignatureForError): Implemented.
18266 (TypeContainer): New member for storing base interfaces.
18267 (TypeContainer.FindMembers): Search in base interfaces too.
18269 * codegen.cs (GetClsComplianceAttribute): New method that gets
18270 assembly or module CLSCompliantAttribute value.
18271 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
18273 (ModuleClass.Emit): Add error 3012 test.
18275 * const.cs (Emit): Override and call base for CLS-Compliant tests.
18277 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
18278 state for all decl types.
18279 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
18280 if CLS-Compliant tests are required.
18281 (IsClsCompliaceRequired): New method. Analyze whether code
18282 must be CLS-Compliant.
18283 (IsExposedFromAssembly): New method. Returns true when MemberCore
18284 is exposed from assembly.
18285 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
18286 value or gets cached value.
18287 (HasClsCompliantAttribute): New method. Returns true if MemberCore
18288 is explicitly marked with CLSCompliantAttribute.
18289 (IsIdentifierClsCompliant): New abstract method. This method is
18290 used to testing error 3005.
18291 (IsIdentifierAndParamClsCompliant): New method. Common helper method
18292 for identifier and parameters CLS-Compliant testing.
18293 (VerifyClsCompliance): New method. The main virtual method for
18294 CLS-Compliant verifications.
18295 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
18296 null. I don't know why is null (too many public members !).
18297 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
18298 and get value of first CLSCompliantAttribute that found.
18300 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
18301 (VerifyClsCompliance): Override and add extra tests.
18303 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
18304 clscheck- disable CLS-Compliant verification event if assembly is has
18305 CLSCompliantAttribute(true).
18307 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
18308 ApllyAttribute is now called in emit section as in the other cases.
18309 Possible future Emit integration.
18310 (IsIdentifierClsCompliant): New override.
18311 (VerifyClsCompliance): New override.
18312 (GetEnumeratorName): Returns full enum name.
18314 * parameter.cs (GetSignatureForError): Implemented.
18316 * report.cs (WarningData): New struct for Warning message information.
18317 (LocationOfPreviousError): New method.
18318 (Warning): New method. Reports warning based on the warning table.
18319 (Error_T): New method. Reports error based on the error table.
18321 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
18322 verifications are done here.
18324 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
18326 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
18327 CLSCompliantAttribute.
18328 (all_imported_types): New member holds all imported types from other
18330 (LoadAllImportedTypes): New method fills static table with exported types
18331 from all referenced assemblies.
18332 (Modules): New property returns all assembly modules.
18334 2004-03-30 Miguel de Icaza <miguel@ximian.com>
18336 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
18337 throwing a parser error.
18339 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
18340 which removes the hardcoded get_/set_ prefixes for properties, as
18341 IL allows for the properties to be named something else.
18345 * expression.cs: Do not override operand before we know if it is
18346 non-null. Fix 56207
18348 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18350 * typemanager.cs: support for pinned variables.
18352 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18354 * decl.cs, typemanager.cs: Avoid using an arraylist
18355 as a buffer if there is only one result set.
18357 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18359 * expression.cs: Make sure you cant call a static method
18360 with an instance expression, bug #56174.
18362 2004-03-29 Miguel de Icaza <miguel@ximian.com>
18364 * class.cs (IsDuplicateImplementation): Improve error reporting to
18365 flag 663 (method only differs in parameter modifier).
18367 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
18368 in preprocessor directives.
18370 * location.cs (LookupFile): Allow for the empty path.
18372 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
18373 better approach for some of that patch, but its failing with the
18374 CharSet enumeration. For now try/catch will do.
18376 * typemanager.cs: Do not crash if a struct does not have fields.
18379 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18381 * expression.cs: cs0213, cant fix a fixed expression.
18384 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18386 * cs-parser.jay: detect invalid embeded statements gracefully.
18389 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18391 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
18394 the invocation type may not be a subclass of the tye of the item/
18395 The type of the item must be a subclass of the invocation item.
18400 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
18402 * attribute.cs: Added methods to get a string and a bool from an
18403 attribute. Required to information from AssemblyKeyFileAttribute,
18404 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18405 * codegen.cs: Modified AssemblyName creation to include support for
18406 strongnames. Catch additional exceptions to report them as CS1548.
18407 * compiler.csproj: Updated include CryptoConvert.cs.
18408 * compiler.csproj.user: Removed file - user specific configuration.
18409 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
18410 Mono.Security assembly. The original class is maintained and tested in
18411 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18412 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18413 like CSC 8.0 (C# v2) supports.
18414 * Makefile: Added CryptoConvert.cs to mcs sources.
18415 * rootcontext.cs: Added new options for strongnames.
18417 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
18419 * driver.cs: For --expect-error, report error code `2'
18420 if the program compiled with no errors, error code `1' if
18421 it compiled with an error other than the one expected.
18423 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
18425 * compiler.csproj: Updated for Visual Studio .NET 2003.
18426 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18427 * compiler.sln: Updated for Visual Studio .NET 2003.
18429 2004-03-24 Ravi Pratap M <ravi@ximian.com>
18431 * expression.cs: Fix bug #47234. We basically need to apply the
18432 rule that we prefer the conversion of null to a reference type
18433 when faced with a conversion to 'object' (csc behaviour).
18435 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18437 * statement.cs: Shorter form for foreach, eliminates
18438 a local variable. r=Martin.
18440 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18442 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18443 checks if we can use brtrue/brfalse to test for 0.
18444 * expression.cs: use the above in the test for using brtrue/brfalse.
18445 cleanup code a bit.
18447 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18449 * expression.cs: Rewrite string concat stuff. Benefits:
18451 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18452 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18453 rather than a concat chain.
18455 * typemanager.cs: Add lookups for more concat overloads.
18457 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18459 * expression.cs: Emit shorter il code for array init.
18476 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
18478 * statement.cs: Before, two switch blocks would be merged if the
18479 total size of the blocks (end_item - begin_item + 1) was less than
18480 two times the combined sizes of the blocks.
18482 Now, it will only merge if after the merge at least half of the
18487 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
18489 * class.cs : csc build fix for GetMethods(). See bug #52503.
18491 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
18493 * expression.cs: Make sure fp comparisons work with NaN.
18494 This fixes bug #54303. Mig approved this patch a long
18495 time ago, but we were not able to test b/c the runtime
18498 2004-03-19 Miguel de Icaza <miguel@ximian.com>
18500 * ecore.cs (TypExpr.GetHashCode): implement this overload.
18502 2004-03-19 Martin Baulig <martin@ximian.com>
18504 * class.cs (MemberCore.IsDuplicateImplementation): Report the
18505 error here and not in our caller.
18507 2004-03-19 Martin Baulig <martin@ximian.com>
18509 * interface.cs: Completely killed this file.
18510 (Interface): We're now a TypeContainer and live in class.cs.
18512 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18513 argument; we're now also called for interfaces.
18514 (TypeContainer.DefineMembers): Allow this method being called
18516 (TypeContainer.GetMethods): New public method; formerly known as
18517 Interface.GetMethod(). This is used by PendingImplementation.
18518 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18519 it's now private and non-static.
18520 (Interface): Moved this here; it's now implemented similar to
18522 (Method, Property, Event, Indexer): Added `bool is_interface'
18523 argument to their .ctor's.
18524 (MemberBase.IsInterface): New public field.
18526 * cs-parser.jay: Create normal Method, Property, Event, Indexer
18527 instances instead of InterfaceMethod, InterfaceProperty, etc.
18528 (opt_interface_base): Removed; we now use `opt_class_base' instead.
18529 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18531 2004-03-19 Martin Baulig <martin@ximian.com>
18533 * class.cs (MethodCore.IsDuplicateImplementation): New private
18534 method which does the CS0111 checking.
18535 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18536 Use IsDuplicateImplementation().
18538 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
18540 * decl.cs (FindMemberToOverride): New method to find the correct
18541 method or property to override in the base class.
18543 - Make Method/Property use the above method to find the
18544 version in the base class.
18545 - Remove the InheritableMemberSignatureCompare as it is now
18548 This patch makes large code bases much faster to compile, as it is
18549 O(n) rather than O(n^2) to do this validation.
18551 Also, it fixes bug 52458 which is that nested classes are not
18552 taken into account when finding the base class member.
18554 Reviewed/Approved by Martin.
18556 2004-03-17 Marek Safar <marek.safar@seznam.cz>
18558 * interface.cs: In all interface classes removed redundant
18559 member initialization.
18561 2004-03-16 Martin Baulig <martin@ximian.com>
18563 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18565 2004-03-15 Miguel de Icaza <miguel@ximian.com>
18567 * decl.cs (DefineTypeAndParents): New helper method to define a
18568 type's containers before the type itself is defined; This is a
18569 bug exposed by the recent changes to Windows.Forms when an
18570 implemented interface was defined inside a class that had not been
18573 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18575 (Check): Loop correctly to report errors modifiers
18576 (UNSAFE was not in the loop, since it was the same as TOP).
18578 * interface.cs: Every interface member now takes a ModFlags,
18579 instead of a "is_new" bool, which we set on the base MemberCore.
18581 Every place where we called "UnsafeOk" in the interface, now we
18582 call the proper member (InterfaceMethod.UnsafeOK) instead to get
18583 the unsafe settings from the member declaration instead of the
18584 container interface.
18586 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
18588 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18589 `set_indexer_name' to the pending bits (one per type).
18591 We fixed a bug today that was picking the wrong method to
18592 override, since for properties the existing InterfaceMethod code
18593 basically ignored the method name. Now we make sure that the
18594 method name is one of the valid indexer names.
18596 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
18598 * support.cs (SeekableStreamReader): Keep track of stream byte
18599 positions and don't mix them with character offsets to the buffer.
18601 Patch from Gustavo Giráldez
18603 2004-03-15 Marek Safar <marek.safar@seznam.cz>
18605 * interface.cs (InterfaceSetGetBase): Removed double member
18606 initialization, base class does it as well.
18608 2004-03-13 Martin Baulig <martin@ximian.com>
18610 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18611 when compiling corlib.
18613 2004-03-13 Miguel de Icaza <miguel@ximian.com>
18615 * convert.cs (ExplicitConversion): We were reporting an error on
18616 certain conversions (object_type source to a value type, when the
18617 expression was `null') before we had a chance to pass it through
18618 the user defined conversions.
18620 * driver.cs: Replace / and \ in resource specifications to dots.
18623 * class.cs: Add check for duplicate operators. Fixes 52477
18625 2004-03-11 Miguel de Icaza <miguel@ximian.com>
18627 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18628 that are in the middle of the statements, not only at the end.
18631 * class.cs (TypeContainer.AddField): No longer set the
18632 `HaveStaticConstructor' flag, now we call it
18633 `UserDefineStaticConstructor' to diferentiate the slightly
18634 semantic difference.
18636 The situation is that we were not adding BeforeFieldInit (from
18637 Modifiers.TypeAttr) to classes that could have it.
18638 BeforeFieldInit should be set to classes that have no static
18643 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18645 And most importantly Zoltan's comment:
18647 http://bugzilla.ximian.com/show_bug.cgi?id=44229
18649 "I think beforefieldinit means 'it's ok to initialize the type sometime
18650 before its static fields are used', i.e. initialization does not need
18651 to be triggered by the first access to the type. Setting this flag
18652 helps the JIT to compile better code, since it can run the static
18653 constructor at JIT time, and does not need to generate code to call it
18654 (possibly lots of times) at runtime. Unfortunately, mcs does not set
18655 this flag for lots of classes like String.
18657 csc sets this flag if the type does not have an explicit static
18658 constructor. The reasoning seems to be that if there are only static
18659 initalizers for a type, and no static constructor, then the programmer
18660 does not care when this initialization happens, so beforefieldinit
18663 This bug prevents the AOT compiler from being usable, since it
18664 generates so many calls to mono_runtime_class_init that the AOT code
18665 is much slower than the JITted code. The JITted code is faster,
18666 because it does not generate these calls if the vtable is type is
18667 already initialized, which is true in the majority of cases. But the
18668 AOT compiler can't do this."
18670 2004-03-10 Miguel de Icaza <miguel@ximian.com>
18672 * class.cs (MethodData.Emit): Refactor the code so symbolic
18673 information is generated for destructors; For some reasons we
18674 were taking a code path that did not generate symbolic information
18677 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
18679 * class.cs: Create a Constructor.CheckBase method that
18680 takes care of all validation type code. The method
18681 contains some code that was moved from Define.
18683 It also includes new code that checks for duplicate ctors.
18684 This fixes bug #55148.
18686 2004-03-09 Joshua Tauberer <tauberer@for.net>
18688 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18689 a { ... }-style array creation invokes EmitStaticInitializers
18690 which is not good for reference-type arrays. String, decimal
18691 and now null constants (NullCast) are not counted toward
18692 static initializers.
18694 2004-03-05 Martin Baulig <martin@ximian.com>
18696 * location.cs (SourceFile.HasLineDirective): New public field;
18697 specifies whether the file contains or is referenced by a "#line"
18699 (Location.DefineSymbolDocuments): Ignore source files which
18700 either contain or are referenced by a "#line" directive.
18702 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
18704 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18705 direct access to our parent, so check the method inline there.
18707 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
18709 * expression.cs (Invocation.EmitCall): Miguel's last commit
18710 caused a regression. If you had:
18715 In Foo the implict this would be null.
18717 2004-02-27 Miguel de Icaza <miguel@ximian.com>
18719 * expression.cs (Invocation.EmitCall): If the method is not
18720 virtual, do not emit a CallVirt to it, use Call.
18722 * typemanager.cs (GetFullNameSignature): Improve the method to
18723 cope with ".ctor" and replace it with the type name.
18725 * class.cs (ConstructorInitializer.Resolve): Now the method takes
18726 as an argument the ConstructorBuilder where it is being defined,
18727 to catch the recursive constructor invocations.
18729 2004-02-26 Miguel de Icaza <miguel@ximian.com>
18731 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18732 routines to check if a type is an enumerable/enumerator allow
18733 classes that implement the IEnumerable or IEnumerator interfaces.
18735 * class.cs (Property, Operator): Implement IIteratorContainer, and
18736 implement SetYields.
18738 (Property.Define): Do the block swapping for get_methods in the
18739 context of iterators. We need to check if Properties also
18740 include indexers or not.
18742 (Operator): Assign the Block before invoking the
18743 OperatorMethod.Define, so we can trigger the Iterator code
18746 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
18747 Property and Operator classes are not created when we parse the
18748 declarator but until we have the block completed, so we use a
18749 singleton SimpleIteratorContainer.Simple to flag whether the
18750 SetYields has been invoked.
18752 We propagate this setting then to the Property or the Operator to
18753 allow the `yield' to function.
18755 2004-02-25 Marek Safar <marek.safar@seznam.cz>
18757 * codegen.cs: Implemented attribute support for modules.
18758 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18759 Assembly/Module functionality.
18761 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18762 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18763 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18765 2004-02-16 Marek Safar <marek.safar@seznam.cz>
18767 * interface.cs (FindMembers): The operation is performed on all base
18768 interfaces and not only on the first. It is required for future CLS Compliance patch.
18770 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
18772 * statement.cs, codegen.cs:
18773 This patch deals with patterns such as:
18775 public class List : IEnumerable {
18777 public MyEnumerator GetEnumerator () {
18778 return new MyEnumerator(this);
18781 IEnumerator IEnumerable.GetEnumerator () {
18785 public struct MyEnumerator : IEnumerator {
18790 Before, there were a few things we did wrong:
18791 1) we would emit callvirt on a struct, which is illegal
18792 2) we emited ldarg when we needed to emit ldarga
18793 3) we would mistakenly call the interface methods on an enumerator
18794 type that derived from IEnumerator and was in another assembly. For example:
18796 public class MyEnumerator : IEnumerator
18798 Would have the interface methods called, even if there were public impls of the
18799 method. In a struct, this lead to invalid IL code.
18801 2004-02-11 Marek Safar <marek.safar@seznam.cz>
18803 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18806 * delegate.cs (Define): Fixed crash when delegate type is undefined.
18808 2004-02-11 Miguel de Icaza <miguel@ximian.com>
18810 * cs-parser.jay: Fix small regression: we were not testing V2
18811 compiler features correctly.
18813 * interface.cs: If the emit context is null, then create one
18815 2004-02-09 Marek Safar <marek.safar@seznam.cz>
18817 * decl.cs (GetSignatureForError): New virtual method to get full name
18818 for error messages.
18820 * attribute.cs (IAttributeSupport): New interface for attribute setting.
18821 Now it is possible to rewrite ApplyAttributes method to be less if/else.
18823 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18824 Duplicated members and code in these classes has been removed.
18825 Better encapsulation in these classes.
18827 2004-02-07 Miguel de Icaza <miguel@ximian.com>
18829 * assign.cs (Assign.DoResolve): When dealing with compound
18830 assignments, there is a new rule in ECMA C# 2.4 (might have been
18831 there before, but it is documented here) that states that in:
18835 If b is of type int, and the `op' is a shift-operator, then the
18836 above is evaluated as:
18840 * expression.cs (Binary.ResolveOperator): Instead of testing for
18841 int/uint/long/ulong, try to implicitly convert to any of those
18842 types and use that in pointer arithmetic.
18844 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18845 method to print information for from the type, not from the
18846 null-method we were given.
18848 2004-02-01 Duncan Mak <duncan@ximian.com>
18850 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18851 parsing for cmd, fixes bug #53694.
18853 2004-02-04 Marek Safar <marek.safar@seznam.cz>
18855 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18856 in the member name duplication tests. Property and operator name duplication
18857 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18859 2004-02-03 Marek Safar <marek.safar@seznam.cz>
18861 * interface.cs (PopulateMethod): Fixed crash when interface method
18862 returns not existing type (error test cs0246-3.cs).
18864 2004-02-02 Ravi Pratap M <ravi@ximian.com>
18866 * cs-parser.jay (interface_accessors): Re-write actions to also
18867 store attributes attached to get and set methods. Fix spelling
18870 (inteface_property_declaration): Modify accordingly.
18872 (InterfaceAccessorInfo): New helper class to store information to pass
18873 around between rules that use interface_accessors.
18875 * interface.cs (Emit): Apply attributes on the get and set
18876 accessors of properties and indexers too.
18878 * attribute.cs (ApplyAttributes): Modify accordingly to use the
18879 right MethodBuilder when applying attributes to the get and set accessors.
18881 2004-01-31 Miguel de Icaza <miguel@ximian.com>
18883 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18885 2004-01-26 Miguel de Icaza <miguel@ximian.com>
18887 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18889 2004-01-25 Miguel de Icaza <miguel@ximian.com>
18891 * cs-parser.jay: Remove YIELD token, instead use the new grammar
18892 changes that treat `yield' specially when present before `break'
18893 or `return' tokens.
18895 * cs-tokenizer.cs: yield is no longer a keyword.
18897 2004-01-23 Marek Safar <marek.safar@seznam.cz>
18899 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18900 setting for default constructors.
18901 For default constructors are almost every time set wrong Modifier. The
18902 generated IL code has been alright. But inside mcs this values was
18903 wrong and this was reason why several of my CLS Compliance tests
18906 2004-01-22 Martin Baulig <martin@ximian.com>
18908 * cs-parser.jay (namespace_or_type_name): Return an Expression,
18909 not a QualifiedIdentifier. This is what `type_name_expression'
18910 was previously doing.
18911 (type_name_expression): Removed; the code is now in
18912 `namespace_or_type_name'.
18913 (qualified_identifier): Removed, use `namespace_or_type_name'
18915 (QualifiedIdentifier): Removed this class.
18917 2004-01-22 Martin Baulig <martin@ximian.com>
18919 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18920 not a string as alias name.
18922 2004-01-21 Miguel de Icaza <miguel@ximian.com>
18924 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18925 #52730 bug, and instead compute correctly the need to use a
18926 temporary variable when requesting an address based on the
18927 static/instace modified of the field and the constructor.
18929 2004-01-21 Martin Baulig <martin@ximian.com>
18931 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18932 class and namespace before looking up aliases. Fixes #52517.
18934 2004-01-21 Martin Baulig <martin@ximian.com>
18936 * flowanalysis.cs (UsageVector.Merge): Allow variables being
18937 assinged in a 'try'; fixes exception4.cs.
18939 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18940 * class.cs : Implemented parameter-less constructor for TypeContainer
18942 * decl.cs: Attributes are now stored here. New property OptAttributes
18944 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18946 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18948 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18950 * typemanager.cs (CSharpSignature): Now reports also inner class name.
18951 (CSharpSignature): New method for indexer and property signature.
18953 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18955 * pending.cs (IsVirtualFilter): Faster implementation.
18957 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18959 * typemanager.cs: Avoid inclusion of same assembly more than once.
18961 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18963 * cs-parser.jay: Fixed problem where the last assembly attribute
18964 has been applied also to following declaration (class, struct, etc.)
18966 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18968 * class.cs: Added error CS0538, CS0539 reporting.
18969 Fixed crash on Microsoft runtime when field type is void.
18971 * cs-parser.jay: Added error CS0537 reporting.
18973 * pending.cs: Added error CS0535 reporting.
18974 Improved error report for errors CS0536, CS0534.
18976 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18978 Merge a few bits from the Anonymous Method MCS tree.
18980 * statement.cs (ToplevelBlock): New class for toplevel methods,
18981 will hold anonymous methods, lifted variables.
18983 * cs-parser.jay: Create toplevel blocks for delegates and for
18984 regular blocks of code.
18986 2004-01-20 Martin Baulig <martin@ximian.com>
18988 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18989 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18990 and `NeedExplicitReturn'; added `IsLastStatement'.
18991 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18992 have a `ReturnLabel' or we're not unreachable.
18994 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18995 child's reachability; don't just override ours with it. Fixes
18996 #58058 (lluis's example).
18997 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18998 InFinally(), InLoop(), InSwitch() and
18999 BreakCrossesTryCatchBoundary() methods.
19001 * statement.cs (Return): Do all error checking in Resolve().
19002 Unless we are the last statement in a top-level block, always
19003 create a return label and jump to it.
19004 (Break, Continue): Do all error checking in Resolve(); also make
19005 sure we aren't leaving a `finally'.
19006 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
19007 statement in a top-level block.
19008 (Block.Flags): Added `IsDestructor'.
19009 (Block.IsDestructor): New public property.
19011 2004-01-20 Martin Baulig <martin@ximian.com>
19013 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
19015 2004-01-20 Martin Baulig <martin@ximian.com>
19017 * statement.cs (Statement.ResolveUnreachable): New public method.
19018 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
19019 (Block.Resolve): Resolve unreachable statements.
19021 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
19023 * expression.cs: We need to fix the case where we do
19024 not have a temp variable here.
19026 * assign.cs: Only expression compound assignments need
19027 temporary variables.
19029 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
19031 * flowanalysis.cs: Reduce memory allocation in a few ways:
19032 - A block with no variables should not allocate a bit
19034 - A method with no out parameters does not need any tracking
19035 for assignment of the parameters, so we need not allocate
19038 public readonly Type[] VariableTypes;
19039 public readonly string[] VariableNames;
19040 Are redundant. The data is already stored in the variable
19041 map, so we need not allocate another array for it.
19042 - We need to add alot of checks for if (params | locals) == null
19043 due to the first two changes.
19045 2004-01-18 Miguel de Icaza <miguel@ximian.com>
19047 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
19048 implement IMemoryLocation, we store a copy on a local variable and
19049 take the address of it. Patch from Benjamin Jemlich
19051 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
19052 to use a special "type_name_expression" rule which reduces the
19053 number of "QualifiedIdentifier" classes created, and instead
19054 directly creates MemberAccess expressions.
19056 2004-01-17 Miguel de Icaza <miguel@ximian.com>
19058 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
19059 that fixes #52853. Null literal assignment to ValueType
19061 * class.cs (MethodData.Emit): Instead of checking the name of the
19062 method to determine if its a destructor, create a new derived
19063 class from Method called Destructor, and test for that.
19065 * cs-parser.jay: Create a Destructor object instead of a Method.
19067 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
19071 2004-01-16 Miguel de Icaza <miguel@ximian.com>
19073 * expression.cs (Binary.ResolveOperator): Perform an implicit
19074 conversion from MethodGroups to their delegate types on the
19075 Addition operation.
19077 * delegate.cs: Introduce a new class DelegateCreation that is the
19078 base class for `NewDelegate' and `ImplicitDelegateCreation',
19079 factor some code in here.
19081 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
19082 conversion from MethodGroups to compatible delegate types.
19084 * ecore.cs (Expression.Resolve): Do not flag error 654
19085 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
19086 we allow conversions from MethodGroups to delegate types now.
19088 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
19089 assignments in v2 either.
19091 2004-01-10 Miguel de Icaza <miguel@ximian.com>
19093 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
19094 static read-only fields in ctors.
19096 Applied patch from Benjamin Jemlich
19098 * expression.cs (UnaryMutator): Avoid leaking local variables.
19100 2004-01-09 Miguel de Icaza <miguel@ximian.com>
19102 * cs-tokenizer.cs (IsCastToken): Allow the various native types
19103 here to return true, as they can be used like this:
19105 (XXX) int.MEMBER ()
19107 Fixed 49836 and all the other dups
19109 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
19111 * driver.cs: Implement /win32res and /win32icon.
19113 2004-01-08 Miguel de Icaza <miguel@ximian.com>
19115 * cs-parser.jay: Add a rule to improve error handling for the
19116 common mistake of placing modifiers after the type.
19118 2004-01-07 Miguel de Icaza <miguel@ximian.com>
19120 * cs-parser.jay (interface_event_declaration): Catch
19121 initialization of events on interfaces, and report cs0068
19123 * cs-parser.jay (interface_event_declaration): Catch
19124 initialization of events.
19126 * ecore.cs: Better report missing constructors.
19128 * expression.cs (Binary.ResolveOperator): My previous bug fix had
19129 the error reporting done in the wrong place. Fix.
19131 * expression.cs (Binary.ResolveOperator): Catch the
19132 operator + (E x, E y) error earlier, and later allow for implicit
19133 conversions in operator +/- (E e, U x) from U to the underlying
19136 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
19137 52596, if the container class is abstract, the default constructor
19138 is protected otherwise its public (before, we were always public).
19140 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
19143 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
19144 Jemlich that fixes bug #52597, MCS was generating invalid code for
19145 idisposable structs. Thanks to Ben for following up with this
19148 2004-01-06 Miguel de Icaza <miguel@ximian.com>
19150 * driver.cs: Allow assemblies without code to be generated, fixes
19153 2004-01-07 Nick Drochak <ndrochak@gol.com>
19155 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
19157 2004-01-05 Miguel de Icaza <miguel@ximian.com>
19159 * cs-parser.jay: Add rules to improve error reporting if fields or
19160 methods are declared at the namespace level (error 116)
19162 * Add rules to catch event add/remove
19164 2004-01-04 David Sheldon <dave-mono@earth.li>
19166 * expression.cs: Added matching ")" to error message for
19169 2004-01-03 Todd Berman <tberman@gentoo.org>
19171 * ecore.cs, attribute.cs:
19172 Applying fix from #52429.
19174 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19176 * ecore.cs, expression.cs, statement.cs:
19177 Total rewrite of how we handle branching. We
19178 now handle complex boolean expressions with fewer
19179 jumps. As well if (x == 0) no longer emits a ceq.
19181 if (x is Foo) is much faster now, because we generate
19184 Overall, we get a pretty big improvement on our benchmark
19185 tests. The code we generate is smaller and more readable.
19187 I did a full two-stage bootstrap. The patch was reviewed
19188 by Martin and Miguel.
19190 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19192 * cs-parser.jay: Make primary_expression not take a QI.
19193 we dont need this because the member_access rule covers
19194 us here. So we replace the rule with just IDENTIFIER.
19196 This has two good effects. First, we remove a s/r conflict.
19197 Second, we allocate many fewer QualifiedIdentifier objects.
19199 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19201 * attribute.cs: Handle MarshalAs attributes as pseudo, and
19202 set the correct information via SRE. This prevents
19203 hanging on the MS runtime. Fixes #29374.
19205 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19207 * convert.cs: correctly handle conversions to value types
19208 from Enum and ValueType as unboxing conversions.
19210 Fixes bug #52569. Patch by Benjamin Jemlich.
19212 2004-01-02 Ravi Pratap <ravi@ximian.com>
19214 * expression.cs (BetterConversion): Prefer int -> uint
19215 over int -> ulong (csc's behaviour). This fixed bug #52046.
19217 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
19219 * decl.cs (MemberCache.FindMembers): now returns a
19222 * typemanager.cs: In general, go with with ^^.
19223 (CopyNewMethods): take an IList.
19224 (RealMemberLookup): Only allocate an arraylist
19225 if we copy from two sets of methods.
19227 This change basically does two things:
19228 1) Fewer array lists allocated due to CopyNewMethods.
19229 2) the explicit cast in MemberList costed ALOT.
19231 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
19233 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
19234 a hashtable to avoid needless string allocations when an identifier is
19235 used more than once (the common case).
19237 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
19239 * pending.cs: MS's TypeBuilder.GetInterfaces ()
19240 is broken, it will not return anything. So, we
19241 have to use the information we have in mcs to
19244 * typemanager.cs: Add a cache for GetInterfaces,
19245 since this will now be used more often (due to ^^)
19247 (GetExplicitInterfaces) New method that gets the
19248 declared, not effective, interfaces on a type
19249 builder (eg, if you have interface IFoo, interface
19250 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
19253 This patch makes MCS able to bootstrap itself on
19256 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
19258 * expression.cs: Remove the Nop's that Miguel put
19261 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
19263 * report.cs, codegen.cs: Give the real stack trace to
19264 the error when an exception is thrown.
19266 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
19268 * decl.cs: only allocate hashtables for ifaces if
19271 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
19273 * expression.cs: fix the error from cs0121-2.cs
19274 (a parent interface has two child interfaces that
19275 have a function with the same name and 0 params
19276 and the function is called through the parent).
19278 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
19280 * class.cs, rootcontext.cs, typmanager.cs: do not
19283 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
19285 * codegen.cs: remove stack for the ec flow branching.
19286 It is already a linked list, so no need.
19288 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
19290 * Makefile: Allow custom profiler here.
19292 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
19294 * typemanager.cs (LookupType):
19295 - Use a static char [], because split takes
19296 a param array for args, so it was allocating
19298 - Do not store true in a hashtable, it boxes.
19300 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
19302 * flowanalysis.cs: bytify common enums.
19304 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19306 * modifiers.cs: Add a new set of flags for the
19307 flags allowed on explicit interface impls.
19308 * cs-parser.jay: catch the use of modifiers in
19309 interfaces correctly.
19310 * class.cs: catch private void IFoo.Blah ().
19312 All related to bug #50572.
19314 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19316 * decl.cs: Rewrite the consistant accessability checking.
19317 Accessability is not linear, it must be implemented in
19318 a tableish way. Fixes #49704.
19320 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19322 * expression.cs: Handle negation in a checked context.
19323 We must use subtraction from zero. Fixes #38674.
19325 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
19327 * class.cs: Ignore static void main in DLLs.
19328 * rootcontext.cs: Handle the target type here,
19329 since we are have to access it from class.cs
19330 * driver.cs: account for the above.
19332 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
19334 * report.cs: Give line numbers and files if available.
19336 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
19338 * driver.cs: Implement /addmodule.
19340 * typemanager.cs: Change 'modules' field so it now contains Modules not
19343 2003-12-20 Martin Baulig <martin@ximian.com>
19345 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
19346 (FieldBase.IsAssigned): Removed this field.
19347 (FieldBase.SetAssigned): New public method.
19348 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
19350 2003-12-20 Martin Baulig <martin@ximian.com>
19352 * expression.cs (LocalVariableReference.DoResolve): Don't set
19353 `vi.Used' if we're called from DoResolveLValue().
19355 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
19356 returns the usage vector it just merged into the current one -
19357 pass this one to UsageWarning().
19358 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
19359 of the `EmitContext', don't call this recursively on our children.
19361 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
19363 * driver.cs: Implement /target:module.
19365 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
19367 * support.cs (CharArrayHashtable): New helper class.
19369 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
19370 char arrays, not strings, so we can avoid creating a string in
19371 consume_identifier if the identifier is a keyword.
19373 2003-12-16 Martin Baulig <martin@ximian.com>
19375 * statement.cs (LocalInfo.Assigned): Removed this property.
19376 (LocalInfo.Flags): Removed `Assigned'.
19377 (LocalInfo.IsAssigned): New public method; takes the EmitContext
19378 and uses flow analysis.
19379 (Block.UsageWarning): Made this method private.
19380 (Block.Resolve): Call UsageWarning() if appropriate.
19382 * expression.cs (LocalVariableReference.DoResolve): Always set
19383 LocalInfo.Used here.
19385 2003-12-13 Martin Baulig <martin@ximian.com>
19387 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
19388 any value here; we're now using flow analysis to figure out
19389 whether a statement/block returns a value.
19391 2003-12-13 Martin Baulig <martin@ximian.com>
19393 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
19395 (FlowBranching.MergeFinally): Don't call
19396 `branching.CheckOutParameters()' here, this is called in
19398 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19399 when adding the `finally' vector.
19401 2003-12-13 Martin Baulig <martin@ximian.com>
19404 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19405 actually work and also fix #48962.
19407 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
19409 * decl.cs: Do not check System.Object for nested types,
19410 since we know it does not have any. Big bang for buck:
19413 Run 1: 8.35 seconds
19414 Run 2: 8.32 seconds
19415 corlib: 17.99 seconds
19417 Run 1: 8.17 seconds
19418 Run 2: 8.17 seconds
19419 corlib: 17.39 seconds
19421 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
19423 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19424 time we are returning 0 members, so we save alot here.
19426 2003-12-11 Martin Baulig <martin@ximian.com>
19428 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19429 `MergeChild()', also just take the `FlowBranching' as argument;
19430 call Merge() on it and return the result.
19431 (FlowBranching.Merge): We don't need to do anything if we just
19434 2003-12-11 Martin Baulig <martin@ximian.com>
19436 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19437 them in an `ArrayList' to reduce memory usage. Thanks to Ben
19438 Maurer for this idea.
19440 2003-12-11 Martin Baulig <martin@ximian.com>
19442 * flowanalysis.cs (MergeResult): This class is now gone; we now
19443 use the `UsageVector' for this. The reason for this is that if a
19444 branching just has one sibling, we don't need to "merge" them at
19445 all - that's the next step to do.
19446 (FlowBranching.Merge): We now return a `UsageVector' instead of a
19449 2003-12-11 Martin Baulig <martin@ximian.com>
19451 Reworked flow analyis and made it more precise and bug-free. The
19452 most important change is that we're now using a special `Reachability'
19453 class instead of having "magic" meanings of `FlowReturns'. I'll
19454 do some more cleanups and optimizations and also add some more
19455 documentation this week.
19457 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19458 largely reworked this class.
19459 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19460 the new `Reachability' class instead of having "magic" values here.
19461 (FlowBranching): We're now using an instance of `Reachability'
19462 instead of having separate `Returns', `Breaks' etc. fields.
19464 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19465 based on flow analysis; ignore the return value of block.Emit ().
19467 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
19469 * driver.cs typemanager.cs: Find the mono extensions to corlib even
19470 if they are private.
19472 2003-12-09 Martin Baulig <martin@ximian.com>
19474 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19475 call them directly on the UsageVector.
19477 2003-12-09 Martin Baulig <martin@ximian.com>
19479 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19480 Changed return type from `FlowReturns' to `Reachability'.
19482 2003-12-09 Martin Baulig <martin@ximian.com>
19484 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19485 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19486 `Reachable' fields with a single `Reachability' one.
19488 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19490 * class.cs (FindMembers): Remove foreach's.
19495 Run 1: 8.74 seconds
19496 Run 2: 8.71 seconds
19499 Run 1: 8.64 seconds
19500 Run 2: 8.58 seconds
19503 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19508 This patch does a few things:
19509 1. EmptyStatement is now a singleton, so it is never reallocated.
19510 2. All blah is EmptyStatement constructs have been changed to
19511 blah == EmptyStatement.Value, which is much faster and valid
19512 now that EmptyStatement is a singleton.
19513 3. When resolving a block, rather than allocating a new array for
19514 the non-empty statements, empty statements are replaced with
19515 EmptyStatement.Value
19516 4. Some recursive functions have been made non-recursive.
19517 Mainly the performance impact is from (3), however (1) and (2) are needed for
19518 this to work. (4) does not make a big difference in normal situations, however
19519 it makes the profile look saner.
19524 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19525 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19526 Total memory allocated: 56397 KB
19529 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19530 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19531 Total memory allocated: 55666 KB
19533 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19535 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19536 than the hashtable in a hashtable version
19538 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19539 we always end up concating a string. This results in a huge perf
19540 loss, because many strings have to be tracked by the GC. In this
19541 patch, we first use a hashtable that works with two keys, so that
19542 the strings do not need to be concat'ed.
19546 Run 1: 8.74 seconds
19547 Run 2: 8.71 seconds
19550 Run 1: 8.65 seconds
19551 Run 2: 8.56 seconds
19553 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
19555 * Makefile: Add a new target `do-time' that does a quick and simple
19556 profile, leaving easy to parse output.
19558 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
19560 * codegen.cs (Init): Create the dynamic assembly with
19561 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19563 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
19565 * support.cs: Make the PtrHashtable use only one
19566 instance of its comparer.
19568 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
19570 * typemanager.cs: Fix lookup of GetNamespaces.
19572 2003-11-29 Miguel de Icaza <miguel@ximian.com>
19574 * expression.cs: Removed redundant line.
19576 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19577 ArrayLists, use for loops with bounds.
19579 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19582 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19583 arraylists, use for loop with bounds.
19585 The above three changes give us a 0.071 second performance
19586 improvement out of 3.294 seconds down to 3.223. On my machine
19587 the above changes reduced the memory usage by 1,387 KB during
19588 compiler bootstrap.
19590 * cs-parser.jay (QualifiedIdentifier): New class used to represent
19591 QualifiedIdentifiers. Before we created a new string through
19592 concatenation, and mostly later on, the result would be
19593 manipulated by DecomposeQI through string manipulation.
19595 This reduced the compiler memory usage for bootstrapping from
19596 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19597 compile times in 0.05 seconds.
19599 2003-11-28 Dick Porter <dick@ximian.com>
19601 * support.cs: Do string compares with the Invariant culture.
19609 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19610 the comparison is done with the Invariant culture.
19612 2003-11-27 Miguel de Icaza <miguel@ximian.com>
19614 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19615 GetEnumerator method.
19617 (ProbeCollectionType): Iterate starting at the most specific type
19618 upwards looking for a GetEnumerator
19620 * expression.cs: Shift count can be up to 31 for int/uint and 63
19623 2003-11-26 Miguel de Icaza <miguel@ximian.com>
19625 * statement.cs (Block.LookupLabel): Also look for the label on the
19626 children blocks. Use a hash table to keep track of visited
19629 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19630 we actually did transform the other operand, otherwise fall back
19631 to the common codepath that casts to long.
19633 * cs-tokenizer.cs: Use the same code pattern as the int case.
19634 Maybe I should do the parsing myself, and avoid depending on the
19635 Parse routines to get this done.
19637 2003-11-25 Miguel de Icaza <miguel@ximian.com>
19639 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19640 which fixes bug 51347. This time test it.
19642 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19643 attributes for example can not tell the difference between these.
19644 The difference was only a syntax feature of the language.
19646 * attribute.cs: Apply attributes to delegates.
19648 * delegate.cs: Call the apply attributes method.
19650 2003-11-24 Miguel de Icaza <miguel@ximian.com>
19652 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19653 comparing 0 vs Byte.MinValue, not the value
19655 (ImplicitConversionRequired): When reporting a conversion error,
19656 use error 31 to print out the constant error instead of the
19659 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
19660 which fixes bug 51347.
19662 2003-11-22 Miguel de Icaza <miguel@ximian.com>
19664 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
19665 which fixes the -warnaserror command line option.
19667 2003-11-21 Miguel de Icaza <miguel@ximian.com>
19669 * cfold.cs (DoNumericPromotions): During constant folding of
19670 additions on UIntConstant, special case intconstants with
19671 IntConstants like we do on the expression binary operator.
19673 2003-11-12 Miguel de Icaza <miguel@ximian.com>
19675 * convert.cs (ImplicitReferenceConversion): We were missing a case
19676 (System.Enum are not value types or class types, so we need to
19677 classify them separatedly).
19679 * driver.cs: We do not support error 2007.
19681 2003-11-12 Jackson Harper <jackson@ximian.com>
19683 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19684 system directory. Also use the full file name so users can
19685 libraries names mscorlib-o-tron.dll in a non system dir.
19687 2003-11-10 Martin Baulig <martin@ximian.com>
19689 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19690 (TypeManager.InitCoreTypes): Initialize them here, but instead of
19691 calling `ResolveType()' on them, directly assign their `Type'.
19693 2003-11-08 Martin Baulig <martin@ximian.com>
19695 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19696 return value and the `out parent' parameter.
19697 (TypeContainer.DefineType): Moved the CS0644 check into
19698 GetClassBases(). Don't pass the interface types to the
19699 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19700 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19702 * ecore.cs (TypeExpr.IsAttribute): New property.
19703 (TypeExpr.GetInterfaces): New method.
19705 * interface.cs (Interface.GetInterfaceTypeByName): Return a
19706 TypeExpr instead of a Type.
19707 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19708 (Interface.DefineType): Don't pass the interface types to the
19709 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19710 them later and then call `TypeBulider.AddInterfaceImplementation()'.
19712 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19713 instead of a `Type[]'.
19714 (TypeManager.RegisterBuilder): Likewise.
19715 (TypeManager.AddUserInterface): Likewise.
19716 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19717 `Type[]' and also return a `TypeExpr[]'.
19718 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19720 2003-11-08 Martin Baulig <martin@ximian.com>
19722 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19725 2003-11-08 Martin Baulig <martin@ximian.com>
19727 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19728 TypeManager.ResolveExpressionTypes().
19730 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19731 instead of an Expression.
19732 (TypeExpr): This is now an abstract base class for `TypeExpression'.
19733 (TypeExpression): New public class; formerly known as `TypeExpr'.
19735 * expression.cs (ComposedCast): Derive from TypeExpr.
19737 * typemanager.cs (TypeManager.system_*_expr): These are now
19738 TypExpr's instead of Expression's.
19739 (TypeManager.ResolveExpressionTypes): New public static function;
19740 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19743 2003-11-06 Miguel de Icaza <miguel@ximian.com>
19745 * expression.cs (New.DoResolve): Do not dereference value that
19746 might be a null return.
19748 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19749 sure that the constant value has the right type. Fixes an
19750 unreported bug, similar to 50425.
19752 * const.cs (Const.LookupConstantValue): Call
19753 ImplicitStandardConversionExists before doing a conversion to
19754 avoid havng the TypeManager.ChangeType do conversions.
19756 Reduced the number of casts used
19758 (Const.ChangeType): New routine to enable reuse of the constant
19759 type changing code from statement.
19761 * typemanager.cs (ChangeType): Move common initialization to
19762 static global variables.
19766 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19767 every value type to go through, even if it was void. Fix that.
19769 * cs-tokenizer.cs: Use is_identifier_start_character on the start
19770 character of the define, and the is_identifier_part_character for
19771 the rest of the string.
19773 2003-11-05 Miguel de Icaza <miguel@ximian.com>
19775 * expression.cs (UnaryMutator.EmitCode): When I updated
19776 LocalVariableReference.DoResolve, I overdid it, and dropped an
19777 optimization done on local variable references.
19779 2003-11-04 Miguel de Icaza <miguel@ximian.com>
19781 * ecore.cs: Convert the return from Ldlen into an int.
19783 2003-10-20 Miguel de Icaza <miguel@ximian.com>
19785 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19786 the accessibility, this is a special case for toplevel non-public
19787 classes (internal for instance).
19789 2003-10-20 Nick Drochak <ndrochak@gol.com>
19791 * ecore.cs: Fix typo and build. Needed another right paren.
19793 2003-10-19 Miguel de Icaza <miguel@ximian.com>
19795 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
19796 `internal' case regular and protected, but not allowing protected
19797 to be evaluated later. Bug 49840
19799 2003-10-15 Miguel de Icaza <miguel@ximian.com>
19801 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19802 to kb.Nlast, and not the kb.nFirst to isolate the switch
19805 Extract the underlying type, so enumerations of long/ulong are
19806 treated like long/ulong.
19808 2003-10-14 Miguel de Icaza <miguel@ximian.com>
19810 * expression.cs (New): Overload the meaning of RequestedType to
19811 track the possible creation of the NewDelegate type, since
19812 DoResolve is invoked more than once for new constructors on field
19815 See bugs: #48800 and #37014
19817 * cs-parser.jay (declare_local_constants): Take an arraylist
19818 instead of a single constant.
19820 (local_constant_declaration): It should take a
19821 constant_declarators, not a constant_declarator. Fixes 49487
19823 * convert.cs: Fix error report.
19825 2003-10-13 Jackson Harper <jackson@ximian.com>
19827 * typemanager.cs (TypeToCoreType): Add float and double this fixes
19830 2003-10-09 Martin Baulig <martin@ximian.com>
19832 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19834 (MethodCore.DoDefineParameters): Removed the TypeContainer
19835 argument; use the DeclSpace which was passed to the .ctor instead.
19836 (MethodCore.CheckParameter): Take a DeclSpace instead of a
19837 TypeContainer; we only need a DeclSpace here.
19839 2003-10-09 Martin Baulig <martin@ximian.com>
19841 * class.cs (MethodData): Added additional `DeclSpace ds' argument
19843 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19844 EmitContext's .ctor.
19846 2003-10-09 Martin Baulig <martin@ximian.com>
19848 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19849 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19850 AsAccessible(), moved them as well.
19852 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19854 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19856 * cs-parser.jay : Renamed yyName to yyNames related to jay.
19858 2003-10-07 Miguel de Icaza <miguel@ximian.com>
19860 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19861 generation for >=, as spotted by Paolo, bug 48679.
19862 Patch from David Waite.
19864 * cs-tokenizer.cs: Add handling for #pragma.
19866 * cs-parser.jay: Allow for both yield and yield return in the
19867 syntax. The anti-cobolization of C# fight will go on!
19869 * class.cs (TypeBuilder.DefineType): Catch error condition here
19870 (Parent.DefineType erroring out and returning null).
19872 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19873 coping with enumerations variables, we were mistakenly processing
19874 them as a regular value type instead of built-in types. Fixes the
19877 * typemanager.cs (IsBuiltinOrEnum): New method.
19879 2003-09-30 Miguel de Icaza <miguel@ximian.com>
19881 * cs-parser.jay: Upgrade: yield now needs the return clause.
19883 2003-09-19 Martin Baulig <martin@ximian.com>
19885 * decl.cs (MemberCache.SetupCacheForInterface): Take a
19886 `MemberCache parent' argument. Normally, an interface doesn't
19887 have a parent type except System.Object, but we use this in gmcs
19888 for generic type parameters.
19890 2003-09-18 Martin Baulig <martin@ximian.com>
19892 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19893 on `type.IsInterface'; don't check whether the type has a parent
19894 to determine whether it's an interface.
19896 2003-09-15 Martin Baulig <martin@ximian.com>
19898 * class.cs (TypeContainer.DefineType): Added an error flag to
19899 avoid reporting duplicate CS0146's ("class definition is
19902 * driver.cs (Driver.MainDriver): Abort if
19903 RootContext.ResolveTree() reported any errors.
19905 2003-09-07 Martin Baulig <martin@ximian.com>
19907 * report.cs (Error, Warning): Added overloaded versions which take
19908 a `params object[] args' and call String.Format().
19910 2003-09-07 Martin Baulig <martin@ximian.com>
19912 * decl.cs (DeclSpace..ctor): Don't call
19913 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19914 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
19915 (DeclSpace.RecordDecl): New method.
19917 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19919 2003-09-02 Ravi Pratap <ravi@ximian.com>
19921 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19922 value attributes to be applied to ParameterBuilders.
19924 * class.cs (MethodCore.LabelParameters): Make static and more
19925 generic so that it can be used from other places - like interface
19926 methods, for instance.
19928 * interface.cs (Interface.Emit): Call LabelParameters before
19929 emitting attributes on the InterfaceMethod.
19931 2003-08-26 Martin Baulig <martin@ximian.com>
19933 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19934 resolving aliases; fixes #47927.
19936 2003-08-26 Martin Baulig <martin@ximian.com>
19938 * statement.cs (Using.DoResolve): This is internally emitting a
19939 try/finally clause, so we need to set ec.NeedExplicitReturn if we
19940 do not always return. Fixes #47681.
19942 2003-08-26 Martin Baulig <martin@ximian.com>
19944 * decl.cs (MemberCore): Moved WarningNotHiding(),
19945 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19947 (AdditionResult): Make this nested in DeclSpace.
19948 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19949 argument; call NamespaceEntry.Define() unless we're nested in a
19952 * namespace.cs (Namespace.DefineName): New public function. This
19953 is called from DeclSpace's .ctor to add
19954 (Namespace.Lookup): Include DeclSpaces in the lookup.
19956 * class.cs (Operator): Derive from MemberBase, not MemberCore.
19958 * const.cs (Const): Derive from MemberBase, not MemberCore.
19960 2003-08-25 Martin Baulig <martin@ximian.com>
19962 * convert.cs (Convert.ExplicitReferenceConversion): When
19963 converting from an interface type to a class, unbox if the target
19964 type is a struct type. Fixes #47822.
19966 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19968 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19971 2003-08-22 Martin Baulig <martin@ximian.com>
19973 * class.cs (TypeManager.DefineType): When defining a nested type,
19974 call DefineType() on our parent; fixes #47801.
19976 2003-08-22 Martin Baulig <martin@ximian.com>
19978 * class.cs (MethodData.Define): While checking if a method is an
19979 interface implementation, improve the test a bit more to fix #47654.
19981 2003-08-22 Martin Baulig <martin@ximian.com>
19983 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19984 correctly; fixes #47722.
19986 2003-08-22 Martin Baulig <martin@ximian.com>
19988 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19989 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19991 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19993 2003-08-22 Martin Baulig <martin@ximian.com>
19995 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19996 can only be assigned in static constructors. Fixes #47161.
19998 2003-08-22 Martin Baulig <martin@ximian.com>
20000 Rewrote and improved the flow analysis code.
20002 * flowbranching.cs (FlowBranching): Make this class abstract.
20003 (FlowBranching.CreateBranching): New static function to create a
20004 new flow branching.
20005 (FlowBranchingBlock, FlowBranchingException): New classes.
20006 (FlowBranching.UsageVector.Type): New public readonly field.
20007 (FlowBranching.UsageVector.Breaks): Removed the setter.
20008 (FlowBranching.UsageVector.Returns): Removed the setter.
20009 (FlowBranching.UsageVector): Added Break(), Return(),
20010 NeverReachable() and Throw() methods to modify the reachability.
20011 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
20012 done by FlowBranching.Merge().
20013 (FlowBranching.UsageVector.MergeChild): New method; merges the
20014 merge result into the current vector.
20015 (FlowBranching.Merge): New abstract method to merge a branching.
20017 2003-08-12 Martin Baulig <martin@ximian.com>
20019 * expression.cs (Indirection.CacheTemporaries): Create the
20020 LocalTemporary with the pointer type, not its element type.
20022 2003-08-10 Miguel de Icaza <miguel@ximian.com>
20024 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
20025 token was a keyword or not.
20027 Add `error' options where an IDENTIFIER was expected; Provide
20028 CheckToken and CheckIdentifierToken convenience error reporting
20031 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
20033 * decl.cs: Rename `NamespaceEntry Namespace' public field into
20034 NameSpaceEntry NameSpaceEntry.
20036 (LookupInterfaceOrClass): Avoid creating a full qualified name
20037 from namespace and name: avoid doing lookups when we know the
20038 namespace is non-existant. Use new Tree.LookupByNamespace which
20039 looks up DeclSpaces based on their namespace, name pair.
20041 * driver.cs: Provide a new `parser verbose' to display the
20042 exception thrown during parsing. This is turned off by default
20043 now, so the output of a failure from mcs is more graceful.
20045 * namespace.cs: Track all the namespaces defined in a hashtable
20048 (IsNamespace): New method
20050 2003-08-09 Miguel de Icaza <miguel@ximian.com>
20052 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
20053 we know that we need to concatenate (full typename can never be
20058 * statement.cs: Use a bitfield; Do not initialize to null things
20059 which are done by the constructor by default.
20061 * cs-parser.jay: bug fix, parameter was 4, not 3.
20063 * expression.cs: Just use the property;
20065 * statement.cs: No need for GetVariableInfo method.
20067 2003-08-08 Martin Baulig <martin@ximian.com>
20069 * flowanalysis.cs (FlowReturns): This is now nested in the
20070 `FlowBranching' class.
20071 (MyBitVector): Moved this here from statement.cs.
20072 (FlowBranching.SiblingType): New enum type.
20073 (FlowBranching.CreateSibling): Added `SiblingType' argument.
20075 2003-08-07 Martin Baulig <martin@ximian.com>
20077 * flowanalysis.cs (FlowBranchingType): This is now nested in the
20078 `FlowBranching' class and called `BranchingType'.
20080 2003-08-07 Martin Baulig <martin@ximian.com>
20082 * flowanalysis.cs: Moved all the control flow analysis code into
20085 2003-08-07 Martin Baulig <martin@ximian.com>
20087 * assign.cs (Assign.DoResolve): `target' must either be an
20088 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
20091 2003-08-07 Miguel de Icaza <miguel@ximian.com>
20093 * expression.cs (BinaryMethod): This kind of expression is created by the
20094 Binary class if it determines that the operator has to be handled
20097 (BinaryDelegate): This kind of expression is created if we are
20098 dealing with a + or - operator on delegates.
20100 (Binary): remove method, argumetns, and DelegateOperator: when
20101 dealing with methods,
20103 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
20105 * statement.cs (Block): use bitfields for the three extra booleans
20106 we had in use. Remove unused topblock parameter.
20108 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
20110 * assign.cs: Drop extra unneeded tests.
20112 2003-08-06 Miguel de Icaza <miguel@ximian.com>
20114 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
20116 * statement.cs (Foreach): Use VariableStorage instead of
20119 * codegen.cs (VariableStorage): New class used by clients that
20120 require a variable stored: locals or fields for variables that
20121 need to live across yield.
20123 Maybe provide a convenience api for EmitThis+EmitLoad?
20125 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
20128 2003-08-05 Miguel de Icaza <miguel@ximian.com>
20130 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
20131 RemapParameterLValue): New methods that are used to turn a
20132 precomputed FieldInfo into an expression like this:
20136 The idea is to use this instead of making LocalVariableReference
20137 have more than one meaning.
20139 * cs-parser.jay: Add error production to BASE.
20141 * ecore.cs: Deal with TypeManager.GetField returning null, which
20142 is now a valid return value.
20144 (FieldExprNoAddress): New expression for Fields whose address can
20147 * expression.cs (LocalVariableReference): During the resolve
20148 phases, create new expressions if we are in a remapping context.
20149 Remove code that dealt with remapping here.
20151 (ParameterReference): same.
20153 (ProxyInstance): New expression, like the `This' expression, but
20154 it is born fully resolved. We know what we are doing, so remove
20155 the errors that are targeted to user-provided uses of `this'.
20157 * statement.cs (Foreach): our variable is now stored as an
20158 Expression; During resolution, follow the protocol, dont just
20159 assume it will return this.
20161 2003-08-06 Martin Baulig <martin@ximian.com>
20163 * support.cs (SeekableStreamReader.cs): New public class.
20165 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
20166 SeekableStreamReader instead of the normal StreamReader.
20168 2003-08-04 Martin Baulig <martin@ximian.com>
20170 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
20171 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
20172 deambiguate casts and delegate invocations.
20173 (parenthesized_expression): Use the new tokens to ensure this is
20174 not a cast of method invocation.
20176 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
20177 when reading a `)' and Deambiguate_CloseParens () was previously
20180 * expression.cs (ParenthesizedExpression): New class. This is
20181 just used for the CS0075 test.
20182 (Binary.DoResolve): Check for CS0075.
20184 2003-07-29 Ravi Pratap <ravi@ximian.com>
20186 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
20187 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
20188 reference comparison.
20190 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
20191 examine the ReturnType for equality - this is necessary in the
20192 cases of implicit and explicit operators whose signature also
20193 includes the return type.
20195 2003-07-26 Miguel de Icaza <miguel@ximian.com>
20197 * namespace.cs: Cache the result of the namespace computation,
20198 instead of computing it every time.
20200 2003-07-24 Miguel de Icaza <miguel@ximian.com>
20202 * decl.cs: Use a global arraylist that we reuse over invocations
20203 to avoid excesive memory consumption. Reduces memory usage on an
20204 mcs compile by one meg (45 average).
20206 * typemanager.cs (LookupTypeReflection): In .NET pointers are
20207 private, work around that.
20209 2003-07-23 Miguel de Icaza <miguel@ximian.com>
20211 * literal.cs (IntLiteral): Define Zero and One static literals.
20213 * cs-parser.jay (integer_literal): use static literals to reduce
20214 memory usage for the most used literals (0, 1 and -1). 211kb
20215 reduced in memory usage.
20217 Replace all calls to `new ArrayList' with `new
20218 ArrayList(4)' which is a good average number for most allocations,
20219 and also requires only 16 bytes of memory for its buffer by
20222 This reduced MCS memory usage in seven megabytes for the RSS after
20225 2003-07-28 Ravi Pratap <ravi@ximian.com>
20227 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
20228 handle params methods the correct way by forming only one
20229 applicable set with params and normal methods in them. Earlier we
20230 were looking at params methods only if we found no normal methods
20231 which was not the correct thing to do.
20233 (Invocation.BetterFunction): Take separate arguments indicating
20234 when candidate and the best method are params methods in their
20237 This fixes bugs #43367 and #46199.
20239 * attribute.cs: Documentation updates.
20241 (CheckAttribute): Rename to CheckAttributeTarget.
20242 (GetValidPlaces): Rename to GetValidTargets.
20244 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
20245 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
20249 2003-07-28 Martin Baulig <martin@ximian.com>
20251 * class.cs (TypeContainer.DefineMembers): Use the base type's full
20252 name when looking up the base class of a nested class. Fixes #46977.
20254 2003-07-26 Martin Baulig <martin@ximian.com>
20256 * expression.cs (Indexers.Indexer): New nested struct; contains
20257 getter, setter and the indexer's type.
20258 (Indexers.Properties): This is now an ArrayList of
20259 Indexers.Indexer's.
20260 (IndexerAccess.DoResolveLValue): Correctly set the type if the
20261 indexer doesn't have any getters.
20263 * assign.cs (Assign.DoResolve): Also do the implicit conversions
20264 for embedded property and indexer assignments.
20266 2003-07-26 Martin Baulig <martin@ximian.com>
20268 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
20269 preprocessor directive is not the first non-whitespace character
20272 2003-07-26 Martin Baulig <martin@ximian.com>
20274 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
20275 namespace parsing, follow the spec more closely.
20277 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
20278 NamespaceEntry.Lookup().
20280 2003-07-25 Martin Baulig <martin@ximian.com>
20282 * MethodCore.cs (OverridesSomething): New public field; it's set
20283 from TypeContainer.DefineMembers if this method overrides
20284 something (which doesn't need to be a method). Fix #39462.
20286 2003-07-25 Ravi Pratap <ravi@ximian.com>
20288 * typemanager.cs (GetMembers): Ensure that the list of members is
20289 reversed. This keeps things in sync.
20291 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
20292 find an AttributeUsage attribute.
20294 * expression.cs (Invocation.OverloadResolve): Perform the check
20295 which disallows Invoke to be directly called on a Delegate.
20297 (Error_InvokeOnDelegate): Report error cs1533.
20299 2003-07-25 Martin Baulig <martin@ximian.com>
20301 * expression.cs (Indexers.GetIndexersForType): Only look in the
20302 interface hierarchy if the requested type is already an
20303 interface. Fixes #46788 while keeping #46502 fixed.
20305 2003-07-25 Martin Baulig <martin@ximian.com>
20307 * class.cs (TypeContainer.DefineMembers): Check whether all
20308 readonly fields have been assigned and report warning CS0649 if
20311 * statement.cs (LocalInfo.IsFixed): Always return true if this is
20314 2003-07-24 Ravi Pratap <ravi@ximian.com>
20316 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
20317 returned from GetMethods to make things consistent with the
20318 assumptions MCS makes about ordering of methods.
20320 This should comprehensively fix bug #45127 and it does :-)
20322 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
20323 ordering is actually reverse.
20325 * Clean up some debug messages I left lying around.
20327 * interface.cs (Populate*): Get rid of code which emits attributes
20328 since the stage in which we emit attributes is the 'Emit' stage,
20329 not the define stage.
20331 (Emit): Move attribute emission for interface members here.
20333 2003-07-22 Ravi Pratap <ravi@ximian.com>
20335 * expression.cs (Invocation.OverloadResolve): Follow the spec more
20336 closely: we eliminate methods in base types when we have an
20337 applicable method in a top-level type.
20339 Please see section 14.5.5.1 for an exact description of what goes
20342 This fixes bug #45127 and a host of other related to corlib compilation.
20344 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
20345 array is the method corresponding to the top-level type (this is
20346 because of the changes made to icall.c) so we change this
20349 (MethodGroupExpr.Name): This too.
20351 * typemanager.cs (GetElementType): New method which does the right
20352 thing when compiling corlib.
20354 * everywhere: Make use of the above in the relevant places.
20356 2003-07-22 Martin Baulig <martin@ximian.com>
20358 * cs-parser.jay (invocation_expression): Moved
20359 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
20360 `cast_expression', but create a InvocationOrCast which later
20361 resolves to either an Invocation or a Cast.
20363 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
20364 method; call this before EmitStatement() to make sure that this
20365 expression can be used as a statement.
20367 * expression.cs (InvocationOrCast): New class; resolves to either
20368 an Invocation or a Cast.
20370 * statement.cs (StatementExpression): Call ResolveStatement() on
20371 the ExpressionStatement before emitting it.
20373 2003-07-21 Martin Baulig <martin@ximian.com>
20375 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
20376 `ref' and `out' attributes match; fixes #46220.
20377 (MemberAccess.ResolveMemberAccess): You can't reference a type
20378 through an expression; fixes #33180.
20379 (Indexers.GetIndexersForType): Don't return the indexers from
20380 interfaces the class implements; fixes #46502.
20382 2003-07-21 Martin Baulig <martin@ximian.com>
20384 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
20385 CS0661 checks; fixes bug #30442.
20387 2003-07-21 Martin Baulig <martin@ximian.com>
20389 * decl.cs (AdditionResult): Added `Error'.
20391 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
20393 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
20394 makes cs0031.cs actually work.
20396 2003-07-20 Martin Baulig <martin@ximian.com>
20398 * namespace.cs: Fixed that bug which caused a crash when compiling
20399 the debugger's GUI.
20401 2003-07-20 Miguel de Icaza <miguel@ximian.com>
20403 * typemanager.cs (LookupTypeReflection): Never expose types which
20404 are NotPublic, NestedPrivate, NestedAssembly, or
20405 NestedFamANDAssem. We used to return these, and later do a check
20406 that would report a meaningful error, but the problem is that we
20407 would not get the real match, if there was a name override.
20409 2003-07-18 Miguel de Icaza <miguel@ximian.com>
20411 * namespace.cs (Namespace, Name): Do not compute the namespace
20412 name dynamically, compute it in the constructor. This reduced
20413 memory usage by 1697 KB.
20415 * driver.cs: Use --pause to pause at the end.
20417 2003-07-17 Peter Williams <peter@newton.cx>
20419 * Makefile: Change the name of the test target so that it doesn't
20420 conflict with the recursive test target.
20422 2003-07-17 Miguel de Icaza <miguel@ximian.com>
20424 * expression.cs (LocalVariableReference.Emit, EmitAssign,
20425 AddressOf): Do not use EmitThis, that was wrong, use the actual
20428 2003-07-15 Miguel de Icaza <miguel@ximian.com>
20430 * class.cs (MethodData.Define): While checking if a method is an
20431 interface implementation, improve the test: If we are not public
20432 (use new test here: use the computed MethodAttributes directly,
20433 instead of the parsed modifier flags) check if the `implementing'
20434 method comes from an interface or not.
20436 * pending.cs (VerifyPendingMethods): Slightly better error
20439 * makefile: add test target that does the mcs bootstrap.
20441 2003-07-16 Ravi Pratap <ravi@ximian.com>
20443 * interface.cs (Define): Do nothing here since there are no
20444 members to populate etc. Move the attribute emission out of here
20445 since this was just totally the wrong place to put it. Attribute
20446 application happens during the 'Emit' phase, not in the 'Define'
20449 (Emit): Add this method and move the attribute emission here
20451 * rootcontext.cs (EmitCode): Call the Emit method on interface
20454 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20456 * expression.cs (OverloadResolve): Report error only if Location
20457 is not 'Null' which means that there was a probe going on.
20459 2003-07-14 Martin Baulig <martin@ximian.com>
20461 * expression.cs (ConditionalLogicalOperator): New public class to
20462 implement user defined conditional logical operators.
20463 This is section 14.11.2 in the spec and bug #40505.
20465 2003-07-14 Martin Baulig <martin@ximian.com>
20467 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20469 2003-07-14 Martin Baulig <martin@ximian.com>
20471 * codegen.cs (EmitContext.InFixedInitializer): New public field.
20473 * ecore.cs (IVariable.VerifyFixed): New interface method.
20475 * expression.cs (Unary.ResolveOperator): When resolving the `&'
20476 operator, check whether the variable is actually fixed. Fixes bug
20477 #36055. Set a variable definitely assigned when taking its
20478 address as required by the spec.
20480 * statement.cs (LocalInfo.IsFixed): New field.
20481 (LocalInfo.MakePinned): Set `IsFixed' to true.
20483 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20485 * attribute.cs (Attribute.Resolve): While doing a Member lookup
20486 for .ctors, ensure that we only ask for members declared in the
20487 attribute type (BindingFlags.DeclaredOnly).
20491 * expression.cs (Error_WrongNumArguments): Report error 1501
20492 correctly the way CSC does.
20494 2003-07-13 Martin Baulig <martin@ximian.com>
20496 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20497 lookup on the fully qualified name, to make things like "X.X" work
20498 where "X.X" is a fully qualified type name, but we also have a
20499 namespace "X" in the using list. Fixes #41975.
20501 2003-07-13 Martin Baulig <martin@ximian.com>
20503 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20504 function. If we're a CompoundAssign, we need to create an embedded
20505 CompoundAssign, not an embedded Assign.
20506 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20509 2003-07-13 Martin Baulig <martin@ximian.com>
20511 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20512 work to fix bug #46088.
20514 2003-07-13 Ravi Pratap <ravi@ximian.com>
20516 * class.cs (Operator.Emit): Do not emit attributes here - it is
20517 taken care of by the Method class that we delegate too. This takes
20518 care of bug #45876.
20520 2003-07-10 Martin Baulig <martin@ximian.com>
20522 * expression.cs (TypeOfVoid): New class.
20523 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
20525 2003-07-10 Martin Baulig <martin@ximian.com>
20527 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20530 2003-07-10 Martin Baulig <martin@ximian.com>
20532 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20533 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20535 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20537 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20539 2003-07-10 Martin Baulig <martin@ximian.com>
20541 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20542 of decimal. Fixes #42850.
20544 NOTE: I also fixed the created byte blob, but this doesn't work on
20545 the MS runtime and csc never produces any byte blobs for decimal
20548 2003-07-10 Martin Baulig <martin@ximian.com>
20550 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20551 structs; fixes #32068.
20552 (Block.AddChildVariableNames): Fixed #44302.
20554 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20556 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20558 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20560 * attribute.cs: And this test is onger needed.
20562 2003-07-08 Martin Baulig <martin@ximian.com>
20564 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20565 inaccessible types. Fixes #36313.
20567 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20569 * namespace.cs (NamespaceEntry): Create implicit entries for all
20570 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20571 implicit entries for N1.N2 and N1.
20573 2003-07-08 Martin Baulig <martin@ximian.com>
20575 Rewrote the handling of namespaces to fix a lot of the issues
20576 wrt. `using' aliases etc.
20578 * namespace.cs (Namespace): Splitted this class into a
20579 per-assembly `Namespace' and a per-file `NamespaceEntry'.
20581 * typemanager.cs (TypeManager.IsNamespace): Removed.
20582 (TypeManager.ComputeNamespaces): Only compute namespaces from
20583 loaded assemblies here, not the namespaces from the assembly we're
20584 currently compiling.
20586 2003-07-08 Martin Baulig <martin@ximian.com>
20588 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20590 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20592 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20595 I thought about the memory savings here, but LookupTypeReflection
20596 is used under already very constrained scenarios. Compiling
20597 corlib or mcs only exposes one hit, so it would not really reduce
20598 any memory consumption.
20600 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20602 * typemanager.cs: fixes bug #45889 by only adding public types from
20603 other assemblies to the list of known types.
20605 2003-07-07 Miguel de Icaza <miguel@ximian.com>
20607 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20608 on the type we resolved.
20610 2003-07-05 Martin Baulig <martin@ximian.com>
20612 * pending.cs (PendingImplementation.ParentImplements): Don't
20613 create the proxy if the parent is abstract.
20615 * class.cs (TypeContainer.DefineIndexers): Process explicit
20616 interface implementations first. Fixes #37714.
20618 2003-07-04 Miguel de Icaza <miguel@ximian.com>
20620 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20621 defined recursively; but since we modify the input parameters
20622 (left is set to `this' temporarily), we reset this value if the
20623 left_is_explicit is false, which gives the original semantics to
20626 * literal.cs (NullPointer): new class used to represent a null
20627 literal in a pointer context.
20629 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20630 type is a pointer, use a NullPointer object instead of a
20631 NullLiteral. Closes 43687
20633 (ExplicitConversion): Convert pointer values using
20634 the conv opcode to the proper type.
20636 * ecore.cs (New): change ValueTypeVariable property into a method,
20637 that returns whether the valuetype is suitable for being used.
20639 * expression.cs (Binary.DoNumericPromotions): Only return if we
20640 the int constant was a valid uint, and we can return both left and
20641 right as uints. If not, we continue processing, to trigger the
20642 type conversion. This fixes 39018.
20644 * statement.cs (Block.EmitMeta): During constant resolution, set
20645 the CurrentBlock property on the emitcontext, so that we resolve
20646 constants propertly.
20648 2003-07-02 Martin Baulig <martin@ximian.com>
20650 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20651 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20653 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20654 than emitting it here.
20656 * statement.cs: Fixed some more flow analysis bugs.
20658 2003-07-02 Martin Baulig <martin@ximian.com>
20660 * class.cs (MethodData.Define): When implementing interface
20661 methods, set Final unless we're Virtual.
20663 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20664 check work for interface methods.
20666 2003-07-01 Martin Baulig <martin@ximian.com>
20668 * ecore.cs (EmitContext.This): Replaced this property with a
20669 GetThis() method which takes a Location argument. This ensures
20670 that we get the correct error location for a CS0188.
20672 2003-07-01 Miguel de Icaza <miguel@ximian.com>
20674 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20675 ImplicitStandardConversion.
20677 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20679 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
20681 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20684 2003-06-30 Miguel de Icaza <miguel@ximian.com>
20686 * class.cs (Constructor.Define): Turn off initlocals for unsafe
20689 (MethodData.Define): Turn off initlocals for unsafe methods.
20691 2003-06-29 Miguel de Icaza <miguel@ximian.com>
20693 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20694 complete; Fixes #37521.
20696 * delegate.cs: Use Modifiers.TypeAttr to compute the
20697 TypeAttributes, instead of rolling our own. This makes the flags
20698 correct for the delegates.
20700 2003-06-28 Miguel de Icaza <miguel@ximian.com>
20702 * class.cs (Constructor.Define): Set the private flag for static
20703 constructors as well.
20705 * cs-parser.jay (statement_expression): Set the return value to
20706 null, to avoid a crash when we catch an error.
20708 2003-06-24 Miguel de Icaza <miguel@ximian.com>
20710 * cs-parser.jay: Applied patch from Jackson that adds support for
20711 extern and unsafe modifiers to destructor declarations.
20713 * expression.cs: Report error 21 if the user is trying to index a
20716 * driver.cs: Add an error message, suggested by the bug report.
20718 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20719 if we do not have a ": this ()" constructor initializer. Fixes 45149
20721 2003-06-14 Miguel de Icaza <miguel@ximian.com>
20723 * namespace.cs: Add some information to reduce FAQs.
20725 2003-06-13 Miguel de Icaza <miguel@ximian.com>
20727 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20728 underlying enumeration types. Fixes #43915.
20730 * expression.cs: Treat ushort/short as legal values to be used in
20731 bitwise operations.
20733 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20735 * delegate.cs: transfer custom attributes for paramenters from
20736 the delegate declaration to Invoke and BeginInvoke.
20738 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20740 * attribute.cs: handle custom marshalers and emit marshal info
20743 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
20745 * makefile.gnu: Added anonymous.cs to the compiler sources.
20747 2003-05-28 Miguel de Icaza <miguel@ximian.com>
20749 * iterators.cs: Change the name of the proxy class to include two
20752 * cs-parser.jay: Update grammar to include anonymous methods.
20754 * anonymous.cs: new file.
20756 2003-05-27 Miguel de Icaza <miguel@ximian.com>
20758 * class.cs (Field.Define): Add missing test for pointers and
20761 2003-05-27 Ravi Pratap <ravi@ximian.com>
20763 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20764 we use the stobj opcode.
20766 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20767 since it wasn't the correct fix.
20769 It still is puzzling that we are required to use stobj for IntPtr
20770 which seems to be a ValueType.
20772 2003-05-26 Miguel de Icaza <miguel@ximian.com>
20774 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20775 during regular simple name resolution. Now, the trick is that
20776 instead of returning for processing the simplename, we do a
20777 TypeManager.LookupType (ie, a rooted lookup as opposed to a
20778 contextual lookup type). If a match is found, return that, if
20779 not, return for further composition.
20781 This fixes long-standing 30485.
20783 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20784 using the address to initialize an object, do an Stobj instead of
20785 using the regular Stelem.
20787 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20788 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20789 Because if we are a BaseIndexerAccess that value will be true.
20792 * statement.cs (GotoCase.Resolve): Return after reporting an
20793 error, do not attempt to continue.
20795 * expression.cs (PointerArithmetic.Emit): If our operand is a
20796 long, convert our constants to match the operand before
20797 multiplying. Convert to I type before adding. Fixes 43670.
20799 2003-05-14 Ravi Pratap <ravi@ximian.com>
20801 * enum.cs (ImplicitConversionExists) : Rename to
20802 ImplicitEnumConversionExists to remove ambiguity.
20804 * ecore.cs (NullCast): New type of cast expression class which
20805 basically is very similar to EmptyCast with the difference being
20806 it still is a constant since it is used only to cast a null to
20808 (eg. (string) null)
20810 * convert.cs (ImplicitReferenceConversion): When casting a null
20811 literal, we return a NullCast.
20813 * literal.cs (NullLiteralTyped): Remove - I don't see why this
20814 should be around anymore.
20816 The renaming (reported was slightly wrong). Corrections:
20818 ConvertImplicitStandard -> ImplicitConversionStandard
20819 ConvertExplicitStandard -> ExplicitConversionStandard
20821 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20822 before passing them in !
20824 * convert.cs (ImplicitConversionStandard): When comparing for
20825 equal expr and target types, ensure that expr is not a
20828 In general, we must not be checking (expr_type ==
20829 target_type) in the top level conversion methods
20830 (ImplicitConversion, ExplicitConversion etc). This checking is
20831 done in the methods that they delegate to.
20833 2003-05-20 Miguel de Icaza <miguel@ximian.com>
20835 * convert.cs: Move Error_CannotConvertType,
20836 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20837 ImplicitNumericConversion, ImplicitConversionExists,
20838 ImplicitUserConversionExists, StandardConversionExists,
20839 FindMostEncompassedType, FindMostSpecificSource,
20840 FindMostSpecificTarget, ImplicitUserConversion,
20841 ExplicitUserConversion, GetConversionOperators,
20842 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20843 TryImplicitIntConversion, Error_CannotConvertImplicit,
20844 ConvertImplicitRequired, ConvertNumericExplicit,
20845 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20846 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20849 Perform the following renames:
20851 StandardConversionExists -> ImplicitStandardConversionExists
20852 ConvertImplicit -> ImplicitConversion
20853 ConvertImplicitStandard -> ImplicitStandardConversion
20854 TryImplicitIntConversion -> ImplicitIntConversion
20855 ConvertImplicitRequired -> ImplicitConversionRequired
20856 ConvertNumericExplicit -> ExplicitNumericConversion
20857 ConvertReferenceExplicit -> ExplicitReferenceConversion
20858 ConvertExplicit -> ExplicitConversion
20859 ConvertExplicitStandard -> ExplicitStandardConversion
20861 2003-05-19 Martin Baulig <martin@ximian.com>
20863 * statement.cs (TypeInfo.StructInfo): Made this type protected.
20864 (TypeInfo): Added support for structs having structs as fields.
20866 * ecore.cs (FieldExpr): Implement IVariable.
20867 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20868 VariableInfo for the field.
20870 2003-05-18 Martin Baulig <martin@ximian.com>
20872 * expression.cs (This.DoResolve): Report a CS0027 if we're
20873 emitting a field initializer.
20875 2003-05-18 Martin Baulig <martin@ximian.com>
20877 * expression.cs (This.ResolveBase): New public function.
20878 (This.DoResolve): Check for CS0188.
20880 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20883 * ecore.cs (MethodGroupExpr.DoResolve): Set the
20884 `instance_expression' to null if we don't have any non-static
20887 2003-05-18 Martin Baulig <martin@ximian.com>
20889 Reworked the way how local variables and parameters are handled by
20890 the flow analysis code.
20892 * statement.cs (TypeInfo, VariableMap): New public classes.
20893 (VariableInfo): New public class. This is now responsible for
20894 checking whether a variable has been assigned. It is used for
20895 parameters and local variables.
20896 (Block.EmitMeta): Take the InternalParameters as argument; compute
20897 the layout of the flow vectors here.
20898 (Block.LocalMap, Block.ParameterMap): New public properties.
20899 (FlowBranching): The .ctor doesn't get the InternalParameters
20900 anymore since Block.EmitMeta() now computes the layout of the flow
20902 (MyStructInfo): This class is now known as `StructInfo' and nested
20903 in `TypeInfo'; we don't access this directly anymore.
20905 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20906 property and removed IsAssigned(), IsFieldAssigned(),
20907 SetAssigned() and SetFieldAssigned(); we now call them on the
20908 VariableInfo so we don't need to duplicate this code everywhere.
20910 * expression.cs (ParameterReference): Added `Block block' argument
20912 (LocalVariableReference, ParameterReference, This): The new
20913 VariableInfo class is now responsible for all the definite
20916 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20917 IsParameterAssigned, SetParameterAssigned): Removed.
20919 2003-05-18 Martin Baulig <martin@ximian.com>
20921 * typemanager.cs (InitCoreTypes): Try calling
20922 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20923 the 3-args-version. Corlib now also needs our `void_type'.
20924 (GetMethod): Added overloaded version which takes an optional
20925 `bool report_errors' to allow lookups of optional methods.
20927 2003-05-12 Martin Baulig <martin@ximian.com>
20929 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20930 only used for locals and not for parameters.
20932 2003-05-12 Miguel de Icaza <miguel@ximian.com>
20934 * support.cs (InternalParameters.ParameterType): Return the
20935 ExternalType of the parameter.
20937 * parameter.cs (Parameter.ExternalType): drop the two arguments,
20940 2003-05-11 Miguel de Icaza <miguel@ximian.com>
20942 * class.cs (MethodData.Define): Do not set the `newslot' on
20943 interface members, if they are also flagged as "override".
20945 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20946 better code for ++i and i++. This only works for static fields
20947 and local variables.
20949 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20950 want to pull the DeclSpace out of the builder_to_declspace instead
20951 of the TypeBuilder (like in TypeContainer.FindMembers).
20953 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20954 instead of LookupTypeContainer. Fixes the crash on .NET for
20955 looking up interface members.
20957 * const.cs: Create our own emit context during the Definition
20958 stage, so that constants are evaluated in the proper context, when
20959 a recursive definition happens.
20961 2003-05-11 Martin Baulig <martin@ximian.com>
20963 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
20964 new block for a switch section.
20965 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20966 the adding/lookup in the switch block. Fixes #39828.
20968 2003-05-09 Miguel de Icaza <miguel@ximian.com>
20970 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20971 functionality: I needed to convert the data after I had performed
20972 the add/sub operation into the operands type size.
20974 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20975 pass the type for the box operation, otherwise the resulting
20976 object would have been of type object.
20978 (BoxedCast): Add constructor to specify the type to box as.
20980 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20982 * iterators.cs: I was reusing the `count' variable inadvertently,
20983 take steps to not allow this to happen.
20985 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20987 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20988 by creating an array at the point where the params starts and
20989 putting all those arguments there, then adjusting the size of the
20992 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20994 * expression.cs (New.AddressOf): Implement interface
20995 IMemoryLocation. This is used when the `new' operator is used in
20996 the context of an invocation to a method on a value type.
20998 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
21001 * namespace.cs: Also check the using aliases here.
21003 * driver.cs: Move the test for using validity after the types have
21004 been entered, so we do a single pass that also includes the using
21007 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
21008 in the regular case. CreateSiblingForFinally is doing extra
21011 * attribute.cs (GetAttributeArgumentExpression): Store the result
21012 on an out value, and use the return value to indicate failure
21013 instead of using null (which is a valid return for Constant.GetValue).
21015 * statement.cs: Perform the analysis flow for the increment
21016 portion after the statement, because this will be the real flow of
21017 execution. Fixes #42385
21019 * codegen.cs (EmitContext.EmitArgument,
21020 EmitContext.EmitStoreArgument): New helper functions when the
21021 RemapToProxy flag is set.
21023 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
21026 Add support for remapping parameters.
21028 * iterators.cs: Propagate parameter values; Store parameter
21029 values in the proxy classes.
21031 2003-05-04 Miguel de Icaza <miguel@ximian.com>
21033 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
21034 need a proxy reference; I do not know what I was thinking
21036 * cs-parser.jay (constructor_initializer): catch another error,
21037 and display nice message.
21039 (field_declaration): catch void field declaration
21040 to flag a better error.
21042 * class.cs (MemberBase.CheckBase): Report an error instead of a
21043 warning if a new protected member is declared in a struct.
21044 (Field.Define): catch the error of readonly/volatile.
21046 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
21048 (FieldExpr.AddressOf): ditto. Catch error where the address of a
21049 volatile variable is taken
21051 2003-05-02 Miguel de Icaza <miguel@ximian.com>
21053 * statement.cs (Fixed.Resolve): Report an error if we are not in
21056 2003-05-01 Miguel de Icaza <miguel@ximian.com>
21058 * typemanager.cs: reuse the code that handles type clashes for
21059 delegates and enumerations.
21061 * class.cs (Report28): Always report.
21063 * expression.cs (EncodeAsAttribute): Allow nulls here.
21065 2003-04-28 Miguel de Icaza <miguel@ximian.com>
21067 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
21068 the functionality for testing whether an expression is valid for
21069 an attribute here. Also handle the case of arrays of elements
21072 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
21073 encoding a linear array into an array of objects that are suitable
21074 to be passed to an CustomAttributeBuilder.
21076 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
21078 * ecore.cs: (FieldExpr): Handle field remapping here.
21080 * iteratators.cs: Pass the instance variable (if the method is an
21081 instance method) to the constructors, so we can access the field
21082 variables on the class.
21084 TODO: Test this with structs. I think the THIS variable on
21085 structs might have to be a pointer, and not a refenrece
21087 2003-04-27 Miguel de Icaza <miguel@ximian.com>
21089 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
21090 local variables to fields in a proxy class.
21092 * iterators.cs (PopulateProxy): Rename our internal fields to
21094 Create a <THIS> field if we are an instance method, so we can
21095 reference our parent container variables.
21096 (MapVariable): Called back from the EmitContext code to enter a
21097 new variable to field mapping into the proxy class (we just create
21101 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
21102 for using the remapped locals to fields.
21104 I placed the code here, because that gives the same semantics to
21105 local variables, and only changes the Emit code.
21107 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
21108 statements inside iterators.
21109 (VariableInfo): Add a FieldBuilder for the cases when we are
21110 remapping local variables to fields in a proxy class
21112 * ecore.cs (SimpleNameResolve): Avoid testing two times for
21113 current_block != null.
21115 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
21116 not cope with strings, as it has been moved to the
21117 TableSwitchEmit. Fixed bug in switch generation.
21119 * expression.cs (New.DoResolve): Provide more context for the user
21120 when reporting an error.
21122 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
21125 * expression.cs (MemberAccess.DoResolve): When we get a type back,
21126 check the permissions for it. Note than in a type-resolution
21127 context the check was already present in DeclSpace.ResolveType,
21128 but was missing from the MemberAccess.
21130 (ArrayCreation.CheckIndices): warn if the user has
21131 more nested levels of expressions, but there are no more
21132 dimensions specified. Avoids crash on bug 41906.
21134 2003-04-26 Miguel de Icaza <miguel@ximian.com>
21136 * statement.cs (Block): replace Implicit bool, for a generic
21138 New flag: `Unchecked'. This is used during the EmitMeta phase
21139 (which is out-of-line with the regular Resolve/Emit process for a
21140 statement, as this is done ahead of time, but still gets a chance
21141 to call constant resolve).
21143 (Block.Flags): new enum for adding a new flag.
21145 (Block.EmitMeta): track the state of unchecked.
21147 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
21148 to enable constant resolution to work there as well.
21150 2003-04-22 Miguel de Icaza <miguel@ximian.com>
21152 * typemanager.cs (ienumerable_type): Also look up
21153 System.Collections.IEnumerable.
21155 2003-04-21 Miguel de Icaza <miguel@ximian.com>
21157 TODO: Test more than one conditional per method.
21159 * class.cs (Indexer.Define): Report the location where the user is
21160 referencing the unsupported feature.
21162 (MethodData): Overload the use of `conditionals' to
21163 minimize the creation of needless ArrayLists. This saves roughly
21164 212kb on my machine.
21166 (Method): Implement the new IIteratorContainer interface.
21167 (Method.SetYields): Implement the method by setting the ModFlags
21168 to contain METHOD_YIELDS.
21170 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
21171 which just got set to null.
21173 * iterators.cs: New file.
21175 (Yield, YieldBreak): New statements.
21177 * statement.cs (Return.Resolve): Flag an error if we are used in
21178 an iterator method.
21180 * codegen.cs (InIterator): New flag set if the code is being
21181 compiled in an iterator method.
21183 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
21184 internal modifier, and we just use it to avoid adding extra
21185 fields, as this is seldom used.
21187 * cs-parser.jay: Add yield_statement (yield and yield break).
21189 * driver.cs: New flag -v2 to turn on version 2 features.
21191 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
21192 hashtable when v2 is enabled.
21194 2003-04-20 Miguel de Icaza <miguel@ximian.com>
21196 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
21197 there is already a namespace defined with this name.
21199 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
21200 people upgraded their corlibs.
21202 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
21203 always use fully qualified types, no need to use the compiler
21206 (TypeManager.IsNamespace): Use binarysearch.
21208 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
21209 AddDelegate): I did not quite use the new IsValid API properly: I
21210 have to pass the short-name and the fullname. I was passing only
21211 the basename instead of the fullname sometimes.
21213 (TypeContainer.DefineType): call NamespaceClash.
21215 * interface.cs (Interface.DefineType): use NamespaceClash before
21218 * delegate.cs (Delegate.DefineType): use NamespaceClash before
21221 * enum.cs: (Enum.DefineType): use NamespaceClash before
21224 * typemanager.cs (: 3-line patch that gives us some tasty 11%
21225 speed increase. First, use the negative_hits cache when we get a
21226 negative. Second, add the type with its full original name
21227 instead of the new . and + encoded name (reflection uses + to
21228 separate type from a nested type). Use LookupTypeReflection
21229 directly which bypasses the type->name hashtable (that we already
21230 know does not contain the type.
21232 * decl.cs (DeclSpace.ResolveTypeExpr): track the
21233 location/container type.
21235 * driver.cs: When passing utf8, use directly the UTF8Encoding.
21237 2003-04-19 Miguel de Icaza <miguel@ximian.com>
21239 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
21241 * delegate.cs (NewDelegate.Resolve): Test whether an instance
21242 method is being referenced in the method group from a static
21243 context, and report error 120 if so.
21245 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
21248 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
21249 is created, we create the A namespace).
21251 * cs-parser.jay: A namespace also introduces a DeclarationFound.
21254 2003-04-18 Miguel de Icaza <miguel@ximian.com>
21256 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
21257 invocation to ModuleBuilder.GetType with the same values will
21258 return a new type instance, so we need to cache its return
21261 * expression.cs (Binary.ResolveOperator): Only allow the compare
21262 operators on enums if they are of the same type.
21264 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
21265 types of ValueType on their own case. Before we were giving them
21266 the same treatment as objects.
21268 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
21269 fullname. Short name is used to compare against container name.
21270 Fullname is used to check against defined namespace names.
21272 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
21273 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
21275 (Method.CheckBase): Call parent.
21276 (MemberBase.CheckBase): Check for protected members on sealed
21278 (PropertyBase.CheckBase): Call parent.
21279 (Field.Define): Call parent.
21281 * report.cs: Negative error codes are now mapped to 8000 - code,
21282 so that the display is render more nicely.
21284 * typemanager.cs: Do not use try/catch, instead report a regular
21287 (GetPointerType, GetReferenceType): These methods provide
21288 mechanisms to obtain the T* and T& from a T. We had the code
21289 previously scattered around the code base, and it also used
21290 TypeManager.LookupType that would go through plenty of caches.
21291 This one goes directly to the type source.
21293 In some places we did the Type.GetType followed by
21294 ModuleBuilder.GetType, but not in others, so this unifies the
21295 processing as well.
21297 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
21298 statements now that we have namespace information.
21300 * typemanager.cs (IsNamespace): New method, returns whether the
21301 string presented is a namespace or not.
21303 (ComputeNamespaces): New public entry point, computes the list of
21304 available namespaces, using the GetNamespaces API call in Mono, or
21305 the slower version in MS.NET.
21307 Now before we start the semantic analysis phase, we have a
21308 complete list of namespaces including everything that the user has
21311 Deleted old code to cache namespaces in .nsc files.
21313 2003-04-17 Miguel de Icaza <miguel@ximian.com>
21315 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
21316 class/struct location definition Location for the implicit
21317 constructor location.
21319 (Operator.Define): Use the location of the operator for the
21320 implicit Method definition.
21322 (Constructor.Emit): use the constructor location for the implicit
21323 base initializer constructor.
21325 * ecore.cs: Remove ITypeExpression. This interface is now gone,
21326 and the Expression class now contains two new methods:
21328 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
21329 isolate type lookup from the rest of the resolution process.
21331 Since we use Expressions to hold type definitions due to the way
21332 we parse the input we have historically overloaded Resolve to
21333 perform the Type lookups if a special flag is passed. Now this is
21334 eliminated and two methods take their place.
21336 The differences in the two methods between xStep and xTerminal is
21337 that xStep is involved in our current lookup system that uses
21338 SimpleNames to compose a name, while xTerminal is used just to
21339 catch the case where the simplename lookup failed.
21341 2003-04-16 Miguel de Icaza <miguel@ximian.com>
21343 * expression.cs (ResolveMemberAccess): Remove redundant code.
21344 TypeExpr expressions are always born fully resolved.
21346 * interface.cs (PopulateMethod): Do not lookup the types twice.
21347 We were doing it once during SemanticAnalysis and once during
21350 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
21351 in local variable type definitions, were being returned as a
21352 SimpleName (we decomposed everything into a string), that is
21353 because primary_expression was being used instead of a type in the
21354 grammar (reduce/reduce conflicts).
21356 The part that was wrong is that we converted the expression into a
21357 string (an oversimplification in one hand, compounded with primary
21358 expressions doing string concatenation).
21364 Would return "A.B.C[]" as a SimpleName. This stopped things like
21365 using clauses from working on this particular context. And a type
21366 was being matched directly against "A.B.C[]".
21368 We now use the correct approach, and allow for ComposedCast to be
21369 part of the unary expression. So the "A.B.C []" become a composed
21370 cast of "A.B.C" (as a nested group of MemberAccess with a
21371 SimpleName at the end) plus the rank composition "[]".
21375 2003-04-10 Miguel de Icaza <miguel@ximian.com>
21377 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
21378 for the access level checking.
21380 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
21381 `TypeContainer container', because I kept getting confused when I
21382 was debugging this code.
21384 * expression.cs (Indexers): Instead of tracking getters/setters,
21385 we now track them in parallel. We create one arraylist less, but
21386 most importantly it is possible now for the LValue code to find a
21387 matching get for a set.
21389 (IndexerAccess.DoResolveLValue): Update the code.
21390 GetIndexersForType has been modified already to extract all the
21391 indexers from a type. The code assumed it did not.
21393 Also make the code set the correct return type for the indexer.
21394 This was fixed a long time ago for properties, but was missing for
21395 indexers. It used to be void_type.
21397 (Binary.Emit): Test first for doubles instead of
21398 floats, as they are more common.
21400 (Binary.EmitBranchable): Use the .un version of the branch opcodes
21401 when dealing with floats and the <=, >= operators. This fixes bug
21404 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21405 to load the array value by emitting a load on the foreach variable
21406 type. This was incorrect.
21408 We now emit the code to load an element using the the array
21409 variable type, and then we emit the conversion operator.
21413 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
21415 * attribute.cs: Avoid allocation of ArrayLists in the common case.
21417 2003-04-09 Miguel de Icaza <miguel@ximian.com>
21419 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21420 test for protection before we test for signatures.
21422 (MethodSignature.ToString): implement.
21424 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21425 to the case where we reduced into a LongConstant.
21427 * decl.cs (CheckAccessLevel): If the type is an array, we can not
21428 depend on whether the information is acurrate, because the
21429 Microsoft runtime will always claim that the array type is public,
21430 regardless of the real state.
21432 If the type is a pointer, another problem happens: the type is
21433 reported as non-public in Microsoft.
21435 In both cases we have to call CheckAccessLevel recursively with
21436 the underlying type as the argument to be tested.
21438 2003-04-08 Miguel de Icaza <miguel@ximian.com>
21440 * assign.cs (Assign.Emit): If we are dealing with a compound
21441 assignment expression, we should use the code path that stores the
21442 intermediate result in a temporary value. This fixes #40903.
21444 *expression.cs (Indirection.ToString): Provide ToString method for
21447 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
21449 * class.cs: Null out fields holding references to Block objects so
21450 they can be garbage collected.
21452 * expression.cs (OverloadResolve): Remove unused local.
21454 2003-04-07 Martin Baulig <martin@ximian.com>
21456 * codegen.cs (EmitContext.CurrentFile): New public field.
21457 (EmitContext.Mark): Use the CurrentFile to check whether the
21458 location is in the correct file.
21459 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21461 2003-04-07 Martin Baulig <martin@ximian.com>
21463 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21465 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21466 location. [FIXME: The location argument which gets passed to this
21467 method is sometimes wrong!]
21469 2003-04-07 Nick Drochak <ndrochak@gol.com>
21471 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21473 2003-04-07 Miguel de Icaza <miguel@ximian.com>
21475 * expression.cs (Indirection.EmitAssign): We were using the
21476 temporary, but returning immediately instead of continuing the
21479 2003-04-06 Martin Baulig <martin@ximian.com>
21481 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21482 if it's a nested child, but also deriving from the outer class.
21485 * typemanager.cs (IsNestedChildOf): Make this work if it's a
21486 nested child, but also deriving from the outer class. See
21488 (FilterWithClosure): We may access private members of the outer
21489 class if we're a nested child and deriving from the outer class.
21490 (RealMemberLookup): Only set `closure_private_ok' if the
21491 `original_bf' contained BindingFlags.NonPublic.
21493 2003-04-05 Martin Baulig <martin@ximian.com>
21495 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21497 2003-04-02 Miguel de Icaza <miguel@ximian.com>
21499 * class.cs (Event.Define): Do not allow abstract events to have
21502 2003-04-01 Miguel de Icaza <miguel@ximian.com>
21504 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21505 block in event declarations.
21507 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21508 value type, get its address.
21510 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21511 leaving a class on the stack instead of a boolean value (int
21512 0/1). Change the code so we compare against null, and then the
21513 result against zero.
21515 * class.cs (TypeContainer.GetClassBases): We were checking for the
21516 parent class being sealed too late.
21518 * expression.cs (Binary.Emit): For <= and >= when dealing with
21519 floating point values, use cgt.un and clt.un instead of cgt and
21522 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
21524 * statement.cs: Apply the same optimization as MS: skip the
21525 GetEnumerator returning an IEnumerator, and use the one returning a
21526 CharEnumerator instead. This allows us to avoid the try-finally block
21529 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
21531 * cs-parser.jay: Attributes cannot be applied to
21532 namespaces. Fixes #40473
21534 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21537 (Add*): check if the name is valid using the full name for constants,
21538 fields, properties and events.
21540 2003-03-28 Miguel de Icaza <miguel@ximian.com>
21542 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21543 char constants to be part of the enumeration.
21545 * expression.cs (Conditional.DoResolve): Add support for operator
21546 true. Implements the missing functionality from 14.12
21548 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21549 operator true/false as required by the spec.
21551 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21552 implicit conversion to boolean.
21554 * statement.cs (Statement.ResolveBoolean): A boolean expression is
21555 also one where the type implements `operator true'.
21557 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21558 get an expression that will invoke operator true based on an
21561 (GetConversionOperators): Removed the hack that called op_True
21564 (Expression.ResolveBoolean): Move this from Statement.
21566 2003-03-17 Miguel de Icaza <miguel@ximian.com>
21568 * ecore.cs (FieldExpr): do not allow initialization of initonly
21569 fields on derived classes
21571 2003-03-13 Martin Baulig <martin@ximian.com>
21573 * statement.cs (Block.Emit): Call ig.BeginScope() and
21574 ig.EndScope() when compiling with debugging info; call
21575 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21577 2003-03-08 Miguel de Icaza <miguel@ximian.com>
21579 * expression.cs (Indexers): Do not construct immediately, allow
21580 for new members to be appended as we go. Fixes 38143
21582 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21584 * expression.cs: save/restore context when resolving an unchecked
21587 2003-03-05 Miguel de Icaza <miguel@ximian.com>
21589 * cfold.cs: Catch division by zero in modulus operator during
21592 2003-03-03 Miguel de Icaza <miguel@ximian.com>
21594 * interface.cs (Interface.DefineMembers): Avoid defining members
21597 2003-02-27 Miguel de Icaza <miguel@ximian.com>
21599 * driver.cs: handle the +/- options for -noconfig
21601 * statement.cs (Unckeched.Resolve): Also track the state of
21602 unchecked in the Resolve phase.
21604 2003-02-27 Martin Baulig <martin@ximian.com>
21606 * ecore.cs (Expression.MemberLookup): Don't create a
21607 MethodGroupExpr for something which is not a method. Fixes #38291.
21609 2003-02-25 Miguel de Icaza <miguel@ximian.com>
21611 * class.cs (MemberBase.CheckParameters): Also check that the type
21612 is unmanaged if it is a pointer.
21614 * expression.cs (SizeOf.Resolve): Add location information.
21616 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21617 a managed type is declared.
21619 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21620 parameter modifiers as well. Fixes bug 38606
21622 * class.cs: Very sad. Am backing out the speed up changes
21623 introduced by the ArrayList -> Array in the TypeContainer, as they
21624 were not actually that much faster, and introduced a bug (no error
21625 reports on duplicated methods).
21627 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21628 source first, this will guarantee that we have a valid expression
21629 before calling in lower levels functions that will require a
21630 resolved object. Then use this original_source in the
21631 target.ResolveLValue instead of the original source that was
21634 Another change. Use target.Resolve instead of LValueResolve.
21635 Although we are resolving for LValues, we will let the Assign code
21636 take care of that (it will be called again from Resolve). This
21637 basically allows code like this:
21639 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21640 class Y { void A (X x) { x [0] += o; }
21642 The problem was that the indexer was trying to resolve for
21643 set_Item (idx, object o) and never finding one. The real set_Item
21644 was set_Item (idx, X). By delaying the process we get the right
21649 2003-02-23 Martin Baulig <martin@ximian.com>
21651 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21652 while calling DoEmit ().
21654 * codegen.cs (EmitContext.Mark): Don't mark locations in other
21655 source files; if you use the #line directive inside a method, the
21656 compiler stops emitting line numbers for the debugger until it
21657 reaches the end of the method or another #line directive which
21658 restores the original file.
21660 2003-02-23 Martin Baulig <martin@ximian.com>
21662 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21664 2003-02-23 Martin Baulig <martin@ximian.com>
21666 * statement.cs (Block.AddChildVariableNames): We need to call this
21667 recursively, not just for our immediate children.
21669 2003-02-23 Martin Baulig <martin@ximian.com>
21671 * class.cs (Event.Define): Always make the field private, like csc does.
21673 * typemanager.cs (TypeManager.RealMemberLookup): Make events
21674 actually work, fixes bug #37521.
21676 2003-02-23 Miguel de Icaza <miguel@ximian.com>
21678 * delegate.cs: When creating the various temporary "Parameters"
21679 classes, make sure that we call the ComputeAndDefineParameterTypes
21680 on those new parameters (just like we do with the formal ones), to
21681 allow them to be resolved in the context of the DeclSpace.
21683 This fixes the bug that Dick observed in Bugzilla #38530.
21685 2003-02-22 Miguel de Icaza <miguel@ximian.com>
21687 * expression.cs (ResolveMemberAccess): When resolving a constant,
21688 do not attempt to pull a constant if the value was not able to
21689 generate a valid constant.
21691 * const.cs (LookupConstantValue): Do not report more errors than required.
21693 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21695 * expression.cs: fixes bug #38328.
21697 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21699 * class.cs: Changed all the various members that can be part of a
21700 class from being an ArrayList to be an Array of the right type.
21701 During the DefineType type_list, interface_list, delegate_list and
21702 enum_list are turned into types, interfaces, delegates and enums
21705 And during the member population, indexer_list, event_list,
21706 constant_list, field_list, instance_constructor_list, method_list,
21707 operator_list and property_list are turned into their real arrays.
21709 Although we could probably perform this operation earlier, for
21710 good error reporting we need to keep the lists and remove the
21711 lists for longer than required.
21713 This optimization was triggered by Paolo profiling the compiler
21714 speed on the output of `gen-sample-program.pl' perl script.
21716 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21717 not crash in methods like MemberLookupFailed that use this field.
21719 This problem arises when the compiler fails to resolve a type
21720 during interface type definition for example.
21722 2003-02-18 Miguel de Icaza <miguel@ximian.com>
21724 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21725 inherit from System.Object, so we have to stop at null, not only
21726 when reaching System.Object.
21728 2003-02-17 Miguel de Icaza <miguel@ximian.com>
21730 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21731 DeclaredOnly because the parent indexer might have had a different
21732 name, but did not loop until the top of the hierarchy was reached.
21734 The problem this one fixes is 35492: when a class implemented an
21735 indexer from an interface, we were getting the interface method
21736 (which was abstract) and we were flagging an error (can not invoke
21739 This also keeps bug 33089 functioning, and test-148 functioning.
21741 * typemanager.cs (IsSpecialMethod): The correct way of figuring
21742 out if a method is special is to see if it is declared in a
21743 property or event, or whether it is one of the predefined operator
21744 names. This should fix correctly #36804.
21746 2003-02-15 Miguel de Icaza <miguel@ximian.com>
21748 The goal here is to remove the dependency on EmptyCast.Peel ().
21749 Killing it completely.
21751 The problem is that currently in a number of places where
21752 constants are expected, we have to "probe" for an EmptyCast, and
21753 Peel, which is not the correct thing to do, as this will be
21754 repetitive and will likely lead to errors.
21756 The idea is to remove any EmptyCasts that are used in casts that
21757 can be reduced to constants, so we only have to cope with
21760 This bug hunt was triggered by Bug 37363 and the desire to remove
21761 the duplicate pattern where we were "peeling" emptycasts to check
21762 whether they were constants. Now constants will always be
21765 * ecore.cs: Use an enumconstant here instead of wrapping with
21768 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21769 throwing me off. By handling this we can get rid of a few hacks.
21771 * statement.cs (Switch): Removed Peel() code.
21773 2003-02-14 Miguel de Icaza <miguel@ximian.com>
21775 * class.cs: Location information for error 508
21777 * expression.cs (New.DoResolve): Add a guard against double
21778 resolution of an expression.
21780 The New DoResolve might be called twice when initializing field
21781 expressions (see EmitFieldInitializers, the call to
21782 GetInitializerExpression will perform a resolve on the expression,
21783 and later the assign will trigger another resolution
21785 This leads to bugs (#37014)
21787 * delegate.cs: The signature for EndInvoke should contain any ref
21788 or out parameters as well. We were not doing this in the past.
21790 * class.cs (Field.Define): Do not overwrite the type definition
21791 inside the `volatile' group. Turns out that volatile enumerations
21792 were changing the type here to perform a validity test, which
21795 2003-02-12 Miguel de Icaza <miguel@ximian.com>
21797 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21798 and structs, we do not want to load the instance variable
21800 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21801 enum_type has to be handled like an object reference (implicit
21802 conversions exists from this to object), but the regular IsClass
21803 and IsValueType tests will never return true for this one.
21805 Also we use TypeManager.IsValueType instead of type.IsValueType,
21806 just for consistency with the rest of the code (this is only
21807 needed if we ever use the construct exposed by test-180.cs inside
21808 corlib, which we dont today).
21810 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
21812 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21815 2003-02-09 Martin Baulig <martin@ximian.com>
21817 * namespace.cs (Namespace..ctor): Added SourceFile argument.
21818 (Namespace.DefineNamespaces): New static public method; this is
21819 called when we're compiling with debugging to add all namespaces
21820 to the symbol file.
21822 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21823 pass it to the Namespace's .ctor.
21825 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21826 and MethodBase arguments; pass the namespace ID to the symwriter;
21827 pass the MethodBase instead of the token to the symwriter.
21828 (SymbolWriter.DefineNamespace): New method to add a namespace to
21831 2003-02-09 Martin Baulig <martin@ximian.com>
21833 * symbolwriter.cs: New file. This is a wrapper around
21834 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
21835 methods here in near future.
21837 2003-02-09 Martin Baulig <martin@ximian.com>
21839 * codegen.cs (EmitContext.Mark): Just pass the arguments to
21840 ILGenerator.MarkSequencePoint() which are actually used by the
21843 2003-02-09 Martin Baulig <martin@ximian.com>
21845 * location.cs (SourceFile): New public sealed class. This
21846 contains the name and an index which is used in the location's token.
21847 (Location): Reserve an appropriate number of bits in the token for
21848 the source file instead of walking over that list, this gives us a
21849 really huge performance improvement when compiling with debugging.
21851 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21852 `SourceFile' argument instead of a string.
21853 (Driver.ProcessFile): Add all the files via Location.AddFile(),
21854 but don't parse/tokenize here, we need to generate the list of all
21855 source files before we do that.
21856 (Driver.ProcessFiles): New static function. Parses/tokenizes all
21859 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21860 instead of a string.
21862 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21865 2003-02-09 Martin Baulig <martin@ximian.com>
21867 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21868 filename on `#line default'.
21870 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21872 * statement.cs: don't clear the pinned var when the fixed statement
21873 returns from the method (fixes bug#37752).
21875 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21877 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
21880 2003-02-07 Martin Baulig <martin@ximian.com>
21882 * driver.cs: Removed the `--debug-args' command line argument.
21884 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21885 automatically by the AsssemblyBuilder.
21886 (CodeGen.InitializeSymbolWriter): We don't need to call any
21887 initialization function on the symbol writer anymore. This method
21888 doesn't take any arguments.
21890 2003-02-03 Miguel de Icaza <miguel@ximian.com>
21892 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21893 from referenced assemblies as well.
21895 2003-02-02 Martin Baulig <martin@ximian.com>
21897 * class.cs (MethodData.Emit): Generate debugging info for external methods.
21899 2003-02-02 Martin Baulig <martin@ximian.com>
21901 * class.cs (Constructor.Emit): Open the symbol writer before
21902 emitting the constructor initializer.
21903 (ConstructorInitializer.Emit): Call ec.Mark() to allow
21904 single-stepping through constructor initializers.
21906 2003-01-30 Miguel de Icaza <miguel@ximian.com>
21908 * class.cs: Handle error 549: do not allow virtual methods in
21911 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21913 * decl.cs: Check access levels when resolving types
21915 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21917 * statement.cs: Add parameters and locals set in catch blocks that might
21918 return to set vector
21920 2003-01-29 Miguel de Icaza <miguel@ximian.com>
21922 * class.cs (Operator): Set the SpecialName flags for operators.
21924 * expression.cs (Invocation.DoResolve): Only block calls to
21925 accessors and operators on SpecialName methods.
21927 (Cast.TryReduce): Handle conversions from char constants.
21930 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21932 * statement.cs: small memory and time optimization in FlowBranching.
21934 2003-01-28 Pedro Mart <yoros@wanadoo.es>
21936 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21937 problem that the last fix but in the other sid (Set).
21939 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21940 access when there is no indexer in the hierarchy.
21942 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21944 * class.cs: Combine some if statements.
21946 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21948 * driver.cs: fixed bug #37187.
21950 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
21952 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21953 any indexer, it's needed to build a list with all the indexers in the
21954 hierarchy (AllGetters), else we have problems. Fixes #35653.
21956 2003-01-23 Miguel de Icaza <miguel@ximian.com>
21958 * class.cs (MethodData.Define): It is wrong for an interface
21959 implementation to be static in both cases: explicit and implicit.
21960 We were only handling this in one case.
21962 Improve the if situation there to not have negations.
21964 * class.cs (Field.Define): Turns out that we do not need to check
21965 the unsafe bit on field definition, only on usage. Remove the test.
21967 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21969 * driver.cs: use assembly.Location instead of Codebase (the latest
21970 patch made mcs fail when using MS assemblies).
21972 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
21974 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21975 get the path to *corlib.dll.
21977 2003-01-21 Nick Drochak <ndrochak@gol.com>
21981 * typemanager.cs: Remove compiler warnings
21983 2003-01-20 Duncan Mak <duncan@ximian.com>
21985 * AssemblyInfo.cs: Bump the version number to 0.19.
21987 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21989 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21991 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21993 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21995 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21997 * cs-parser.jay: Small fix: we were not comparing the constructor
21998 name correctly. Thanks to Zoltan for the initial pointer.
22000 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
22002 * cs-tokenizer.cs: Set file name when specified with #line
22004 2003-01-15 Miguel de Icaza <miguel@ximian.com>
22006 * cs-parser.jay: Only perform the constructor checks here if we
22007 are named like the class; This will help provider a better
22008 error. The constructor path is taken when a type definition is
22009 not found, but most likely the user forgot to add the type, so
22010 report that rather than the constructor error.
22012 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
22014 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
22017 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
22019 * cs-parser.jay: Add cleanup call.
22021 2003-01-13 Duncan Mak <duncan@ximian.com>
22023 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
22024 consistent with other methods.
22026 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
22028 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
22030 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
22032 * attribute.cs: only set GuidAttr to true when we have a
22035 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22039 * typemanager.cs: fixes to allow mcs compile corlib with the new
22040 Type.IsSubclassOf fix.
22042 2003-01-08 Miguel de Icaza <miguel@ximian.com>
22044 * expression.cs (LocalVariableReference.DoResolve): Classify a
22045 constant as a value, not as a variable. Also, set the type for
22048 * cs-parser.jay (fixed_statement): take a type instead of a
22049 pointer_type, so we can produce a better error message later.
22051 * statement.cs (Fixed.Resolve): Flag types that are not pointers
22054 (For.DoEmit): Make inifinite loops have a
22055 non-conditional branch back.
22057 (Fixed.DoEmit): First populate the pinned variables, then emit the
22058 statement, then clear the variables. Before I was emitting the
22059 code once for each fixed piece.
22062 2003-01-08 Martin Baulig <martin@ximian.com>
22064 * statement.cs (FlowBranching.MergeChild): A break in a
22065 SWITCH_SECTION does not leave a loop. Fixes #36155.
22067 2003-01-08 Martin Baulig <martin@ximian.com>
22069 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
22070 lives in the same number space than `param_map'. Fixes #36154.
22072 2003-01-07 Miguel de Icaza <miguel@ximian.com>
22074 * cs-parser.jay (constructor_declaration): Set the
22075 Constructor.ModFlags before probing for it. This makes the
22076 compiler report 514, 515 and 132 (the code was there, but got
22079 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
22080 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
22081 (GotoCase.Resolve): Set `Returns' to ALWAYS.
22083 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
22085 * enum.cs: create the enum static fields using the enum type.
22087 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
22089 * class.cs: don't try to create the ParamBuilder for the return
22090 type if it's not needed (and handle it breaking for the ms runtime
22093 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
22095 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
22097 2002-12-29 Miguel de Icaza <miguel@ximian.com>
22099 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
22100 the command. This showed up while compiling the JANET source
22101 code, which used \r as its only newline separator.
22103 2002-12-28 Miguel de Icaza <miguel@ximian.com>
22105 * class.cs (Method.Define): If we are an operator (because it
22106 reuses our code), then set the SpecialName and HideBySig. #36128
22108 2002-12-22 Miguel de Icaza <miguel@ximian.com>
22110 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
22111 exception, report error 120 `object reference required'.
22113 * driver.cs: Add --pause option, used during to measure the size
22114 of the process as it goes with --timestamp.
22116 * expression.cs (Invocation.DoResolve): Do not allow methods with
22117 SpecialName to be invoked.
22119 2002-12-21 Miguel de Icaza <miguel@ximian.com>
22121 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
22122 number before adding it.
22124 2002-12-21 Ravi Pratap <ravi@ximian.com>
22126 * ecore.cs (StandardImplicitConversion): When in an unsafe
22127 context, we allow conversion between void * to any other pointer
22128 type. This fixes bug #35973.
22130 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
22132 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
22133 is not thrown when extensionless outputs are used
22135 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22137 * rootcontext.cs: fixed compilation of corlib.
22139 2002-12-19 Miguel de Icaza <miguel@ximian.com>
22141 * attribute.cs (Attributes.Contains): Add new method.
22143 * class.cs (MethodCore.LabelParameters): if the parameter is an
22144 `out' parameter, check that no attribute `[In]' has been passed.
22146 * enum.cs: Handle the `value__' name in an enumeration.
22148 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
22150 * decl.cs: Added special case to allow overrides on "protected
22153 2002-12-18 Ravi Pratap <ravi@ximian.com>
22155 * attribute.cs (Attributes.AddAttributeSection): Rename to this
22156 since it makes much more sense.
22158 (Attributes.ctor): Don't require a Location parameter.
22160 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
22162 * attribute.cs (ApplyAttributes): Remove extra Location parameters
22163 since we already have that information per attribute.
22165 * everywhere : make appropriate changes.
22167 * class.cs (LabelParameters): Write the code which actually
22168 applies attributes to the return type. We can't do this on the MS
22169 .NET runtime so we flag a warning in the case an exception is
22172 2002-12-18 Miguel de Icaza <miguel@ximian.com>
22174 * const.cs: Handle implicit null conversions here too.
22176 2002-12-17 Ravi Pratap <ravi@ximian.com>
22178 * class.cs (MethodCore.LabelParameters): Remove the extra
22179 Type [] parameter since it is completely unnecessary. Instead
22180 pass in the method's attributes so that we can extract
22181 the "return" attribute.
22183 2002-12-17 Miguel de Icaza <miguel@ximian.com>
22185 * cs-parser.jay (parse): Use Report.Error to flag errors instead
22186 of ignoring it and letting the compile continue.
22188 * typemanager.cs (ChangeType): use an extra argument to return an
22189 error condition instead of throwing an exception.
22191 2002-12-15 Miguel de Icaza <miguel@ximian.com>
22193 * expression.cs (Unary.TryReduce): mimic the code for the regular
22194 code path. Perform an implicit cast in the cases where we can
22195 implicitly convert to one of the integral types, and then reduce
22196 based on that constant. This fixes bug #35483.
22198 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22200 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
22202 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22204 * namespace.cs: fixed bug #35489.
22206 2002-12-12 Miguel de Icaza <miguel@ximian.com>
22208 * class.cs: Remove some dead code.
22210 * cs-parser.jay: Estimate the number of methods needed
22211 (RootContext.MethodCount);
22213 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
22214 numbers instead of StringBuilders.
22216 * support.cs (PtrHashtable): Add constructor with initial size;
22217 We can now reduce reallocations of the method table.
22219 2002-12-10 Ravi Pratap <ravi@ximian.com>
22221 * attribute.cs (ApplyAttributes): Keep track of the emitted
22222 attributes on a per-target basis. This fixes bug #35413.
22224 2002-12-10 Miguel de Icaza <miguel@ximian.com>
22226 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
22227 default to the Windows 1252 encoding.
22229 (UnixParseOption): Support version, thanks to Alp for the missing
22232 * AssemblyInfo.cs: Add nice assembly information.
22234 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
22237 * cs-parser.jay: Allow a trailing comma before the close bracked
22238 in the attribute_section production.
22240 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
22241 address of the instance was being taken, I will take this out,
22242 because we take the address of the object immediately here.
22244 2002-12-09 Ravi Pratap <ravi@ximian.com>
22246 * typemanager.cs (AreMultipleAllowed): Take care of the most
22247 obvious case where attribute type is not in the current assembly -
22250 2002-12-08 Miguel de Icaza <miguel@ximian.com>
22252 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
22253 definitions, instead of doing that afterwards.
22255 Also we use a nice little hack, depending on the constructor, we
22256 know if we are a "composed" name or a simple name. Hence, we
22257 avoid the IndexOf test, and we avoid
22259 * codegen.cs: Add code to assist in a bug reporter to track down
22260 the source of a compiler crash.
22262 2002-12-07 Ravi Pratap <ravi@ximian.com>
22264 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
22265 types have been emitted for a given element and flag an error
22266 if something which does not have AllowMultiple set is used more
22269 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
22270 attribute types and their corresponding AllowMultiple properties
22272 (AreMultipleAllowed): Check the property for a given type.
22274 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
22275 property in the case we have a TypeContainer.
22277 (Attributes.AddAttribute): Detect duplicates and just skip on
22278 adding them. This trivial fix catches a pretty gross error in our
22279 attribute emission - global attributes were being emitted twice!
22281 Bugzilla bug #33187 is now fixed.
22283 2002-12-06 Miguel de Icaza <miguel@ximian.com>
22285 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
22286 instead of pp_and).
22288 * expression.cs (Binary.ResolveOperator): I can only use the
22289 Concat (string, string, string) and Concat (string, string,
22290 string, string) if the child is actually a concatenation of
22293 2002-12-04 Miguel de Icaza <miguel@ximian.com>
22295 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
22296 context where we need a 2-character lookahead.
22298 * pending.cs (PendingImplementation): Rework so we can keep track
22299 of interface types all the time, and flag those which were
22300 implemented by parents as optional.
22302 2002-12-03 Miguel de Icaza <miguel@ximian.com>
22304 * expression.cs (Binary.ResolveOperator): Use
22305 String.Concat(string,string,string) or
22306 String.Concat(string,string,string,string) when possible.
22308 * typemanager: More helper methods.
22311 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
22313 * pending.cs: remove the bogus return from GetMissingInterfaces()
22314 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
22316 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22318 * namespace.cs: avoid duplicated 'using xxx' being added to
22319 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
22320 when we get more than one 'using' statement for the same namespace.
22321 Report a CS0105 warning for it.
22323 2002-11-30 Miguel de Icaza <miguel@ximian.com>
22325 * cs-tokenizer.cs (consume_identifier): use read directly, instead
22326 of calling getChar/putback, uses internal knowledge of it.
22328 (xtoken): Reorder tokenizer so most common patterns are checked
22329 first. This reduces the compilation time in another 5% (from 8.11s
22330 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
22332 The parsing time is 22% of the compilation in mcs, and from that
22333 64% is spent on the tokenization process.
22335 I tried using a binary search for keywords, but this is slower
22336 than the hashtable. Another option would be to do a couple of
22339 * Not use a StringBuilder, instead use an array of chars,
22340 with a set value. Notice that this way we could catch
22341 the 645 error without having to do it *afterwards*.
22343 * We could write a hand-parser to avoid the hashtable
22344 compares altogether.
22346 The identifier consumption process takes 37% of the tokenization
22347 time. Another 15% is spent on is_number. 56% of the time spent
22348 on is_number is spent on Int64.Parse:
22350 * We could probably choose based on the string length to
22351 use Int32.Parse or Int64.Parse and avoid all the 64-bit
22354 Another 3% is spend on wrapping `xtoken' in the `token' function.
22356 Handle 0xa0 as whitespace (#34752)
22358 2002-11-26 Miguel de Icaza <miguel@ximian.com>
22360 * typemanager.cs (IsCLRType): New routine to tell whether a type
22361 is one of the builtin types.
22363 Maybe it needs to use TypeCodes to be faster. Maybe we could use
22364 typecode in more places instead of doing pointer comparissions.
22365 We could leverage some knowledge about the way the typecodes are
22368 New code to cache namespaces in assemblies, it is currently not
22369 invoked, to be used soon.
22371 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
22373 * expression.cs (Binary.ResolveOperator): specially handle
22374 strings, and do not perform user-defined operator overloading for
22377 2002-11-24 Miguel de Icaza <miguel@ximian.com>
22379 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
22380 internalcall as it is a pretty simple operation; Avoid whenever
22381 possible to call Char.IsLetter.
22383 (consume_identifier): Cut by half the number of
22384 hashtable calls by merging the is_keyword and GetKeyword behavior.
22386 Do not short-circuit, because if we do, we
22387 report errors (ie, #if false && true would produce an invalid
22391 2002-11-24 Martin Baulig <martin@ximian.com>
22393 * expression.cs (Cast.TryReduce): If we're in checked syntax,
22394 check constant ranges and report a CS0221. Fixes #33186.
22396 2002-11-24 Martin Baulig <martin@ximian.com>
22398 * cs-parser.jay: Make this work for uninitialized variable
22399 declarations in the `for' initializer. Fixes #32416.
22401 2002-11-24 Martin Baulig <martin@ximian.com>
22403 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22404 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
22406 2002-11-24 Martin Baulig <martin@ximian.com>
22408 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22409 argument; if true, we also check for user-defined conversions.
22410 This is only needed if both arguments are of a user-defined type.
22411 Fixes #30443, added test-175.cs.
22412 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22414 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22416 2002-11-24 Martin Baulig <martin@ximian.com>
22418 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22419 function to get the store opcode.
22420 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22421 only emit the Ldelema if the store opcode is Stobj. You must run
22422 both test-34 and test-167 to test this. Fixes #34529.
22424 2002-11-23 Martin Baulig <martin@ximian.com>
22426 * ecore.cs (Expression.MemberLookup): Added additional
22427 `qualifier_type' argument which is used when we're being called
22428 from MemberAccess.DoResolve() and null if we're called from a
22430 (Expression.MemberLookupFailed): New method to report errors; this
22431 does the CS1540 check and reports the correct error message.
22433 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22434 argument for the CS1540 check and redone the way how we're dealing
22435 with private members. See the comment in the source code for details.
22436 (FilterWithClosure): Reverted this back to revision 1.197; renamed
22437 `closure_start_type' to `closure_qualifier_type' and check whether
22438 it's not null. It was not this filter being broken, it was just
22439 being called with the wrong arguments.
22441 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22442 and pass it the correct `qualifier_type'; this also does the error
22445 2002-11-22 Miguel de Icaza <miguel@ximian.com>
22447 * expression.cs (Invocation.EmitParams): If the we are dealing
22448 with a non-built-in value type, load its address as well.
22450 (ArrayCreation): Use a a pretty constant instead
22451 of the hardcoded value 2. Use 6 instead of 2 for the number of
22452 static initializers.
22454 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22455 because they are not really value types, just glorified integers.
22457 * driver.cs: Do not append .exe, the CSC compiler does not do it.
22459 * ecore.cs: Remove redundant code for enumerations, make them use
22460 the same code path as everything else, fixes the casting issue
22461 with enumerations in Windows.Forms.
22463 * attribute.cs: Do only cast to string if it is a string, the
22464 validation happens later.
22466 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22467 people upgrade their corlibs.
22469 * ecore.cs: Oops, enumerations were not following the entire code path
22471 2002-11-21 Miguel de Icaza <miguel@ximian.com>
22473 * typemanager.cs (FilterWithClosure): Commented out the test for
22474 1540 in typemanager.cs, as it has problems when accessing
22475 protected methods from a parent class (see test-174.cs).
22477 * attribute.cs (Attribute.ValidateGuid): new method.
22478 (Attribute.Resolve): Use above.
22480 2002-11-19 Miguel de Icaza <miguel@ximian.com>
22482 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22484 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22485 handling for enumerations, as we only needed the TypeContainer
22486 functionality to begin with (this is required for the fix below to
22487 work for enums that reference constants in a container class for
22490 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22492 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22493 a valid TypeBuilder to perform lookups on.o
22495 * class.cs (InheritableMemberSignatureCompare): Use true in the
22496 call to GetGetMethod and GetSetMethod, because we are comparing
22497 the signature, and we need to get the methods *even* if they are
22500 (PropertyBase.CheckBase): ditto.
22502 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22503 GotoCase.Resolve): Use Peel on EmpytCasts.
22505 * ecore.cs (EmptyCast): drop child, add Peel method.
22507 2002-11-17 Martin Baulig <martin@ximian.com>
22509 * ecore.cs (EmptyCast.Child): New public property.
22511 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22512 label resolved to an EmptyCast. Fixes #34162.
22513 (GotoCase.Resolve): Likewise.
22514 (Block.EmitMeta): Likewise.
22516 2002-11-17 Martin Baulig <martin@ximian.com>
22518 * expression.cs (Invocation.BetterConversion): Prefer int over
22519 uint; short over ushort; long over ulong for integer literals.
22520 Use ImplicitConversionExists instead of StandardConversionExists
22521 since we also need to check for user-defined implicit conversions.
22522 Fixes #34165. Added test-173.cs.
22524 2002-11-16 Martin Baulig <martin@ximian.com>
22526 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22527 with the `true' and `false' literals. Fixes #33151.
22529 2002-11-16 Martin Baulig <martin@ximian.com>
22531 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22532 October 22nd; don't do the cs1540 check for static members.
22534 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22535 now using our own filter here and doing the cs1540 check again.
22537 2002-11-16 Martin Baulig <martin@ximian.com>
22539 * support.cs (InternalParameters): Don't crash if we don't have
22540 any fixed parameters. Fixes #33532.
22542 2002-11-16 Martin Baulig <martin@ximian.com>
22544 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22545 when looking up static methods to make this work on Windows.
22548 2002-11-16 Martin Baulig <martin@ximian.com>
22550 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22551 a setter rather than using PropertyInfo.CanWrite.
22553 2002-11-15 Nick Drochak <ndrochak@gol.com>
22555 * class.cs: Allow acces to block member by subclasses. Fixes build
22558 2002-11-14 Martin Baulig <martin@ximian.com>
22560 * class.cs (Constructor.Emit): Added the extern/block check.
22563 2002-11-14 Martin Baulig <martin@ximian.com>
22565 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22566 iteration while looking for indexers, this is needed because the
22567 indexer may have a different name in our base classes. Fixed the
22568 error reporting (no indexers at all, not get accessor, no
22569 overloaded match). Fixes bug #33089.
22570 (IndexerAccess.DoResolveLValue): Likewise.
22572 2002-11-14 Martin Baulig <martin@ximian.com>
22574 * class.cs (PropertyBase.CheckBase): Make this work for multiple
22575 indexers. Fixes the first part of bug #33089.
22576 (MethodSignature.InheritableMemberSignatureCompare): Added support
22579 2002-11-13 Ravi Pratap <ravi@ximian.com>
22581 * attribute.cs (Attribute.Resolve): Catch the
22582 NullReferenceException and report it since it isn't supposed to
22585 2002-11-12 Miguel de Icaza <miguel@ximian.com>
22587 * expression.cs (Binary.EmitBranchable): Also handle the cases for
22588 LogicalOr and LogicalAnd that can benefit from recursively
22589 handling EmitBranchable. The code now should be nice for Paolo.
22591 2002-11-08 Miguel de Icaza <miguel@ximian.com>
22593 * typemanager.cs (LookupType): Added a negative-hit hashtable for
22594 the Type lookups, as we perform quite a number of lookups on
22595 non-Types. This can be removed once we can deterministically tell
22596 whether we have a type or a namespace in advance.
22598 But this might require special hacks from our corlib.
22602 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22603 and double which avoids a conversion from an integer to a double.
22605 * expression.cs: tiny optimization, avoid calling IsConstant,
22606 because it effectively performs the lookup twice.
22608 2002-11-06 Miguel de Icaza <miguel@ximian.com>
22610 But a bogus return here to keep the semantics of the old code
22611 until the Mono runtime is fixed.
22613 * pending.cs (GetMissingInterfaces): New method used to remove all
22614 the interfaces that are already implemented by our parent
22615 classes from the list of pending methods.
22617 * interface.cs: Add checks for calls after ResolveTypeExpr.
22619 2002-11-05 Miguel de Icaza <miguel@ximian.com>
22621 * class.cs (Class.Emit): Report warning 67: event not used if the
22622 warning level is beyond 3.
22624 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22625 being a NullLiteral.
22627 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22630 * class.cs (TypeContainer.GetClassBases): Cover a missing code
22631 path that might fail if a type can not be resolved.
22633 * expression.cs (Binary.Emit): Emit unsigned versions of the
22636 * driver.cs: use error 5.
22638 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22640 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22642 2002-11-01 Miguel de Icaza <miguel@ximian.com>
22644 * cs-parser.jay (switch_section): A beautiful patch from Martin
22645 Baulig that fixed 33094.
22647 2002-10-31 Miguel de Icaza <miguel@ximian.com>
22649 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22650 Check whether the base is abstract and report an error if so.
22652 * expression.cs (IndexerAccess.DoResolveLValue,
22653 IndexerAccess.DoResolve): ditto.
22655 (Invocation.DoResolve): ditto.
22657 (Invocation.FullMethodDesc): Improve the report string.
22659 * statement.cs (Block): Eliminate IsVariableDefined as it is
22660 basically just a wrapper for GetVariableInfo.
22662 * ecore.cs (SimpleName): Use new
22664 * support.cs (ReflectionParamter.ParameterType): We unwrap the
22665 type, as we return the actual parameter ref/unref state on a
22668 2002-10-30 Miguel de Icaza <miguel@ximian.com>
22670 * support.cs: Return proper flags REF/OUT fixing the previous
22673 * expression.cs: Reverted last patch, that was wrong. Is_ref is
22674 not used to mean `ref' but `ref or out' in ParameterReference
22676 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22677 full type signature instead of calling TypeManger.CSharpName
22680 * support.cs (InternalParameters.ParameterDesc): Do not compare
22681 directly to the modflags, because REF/OUT will actually be bitsets
22684 * delegate.cs (VerifyMethod): Check also the modifiers.
22686 * cs-tokenizer.cs: Fix bug where floating point values with an
22687 exponent where a sign was missing was ignored.
22689 * driver.cs: Allow multiple assemblies to be specified in a single
22692 2002-10-28 Miguel de Icaza <miguel@ximian.com>
22694 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
22695 because identifiers after a parenthesis would end up in this kind
22696 of production, and we needed to desamiguate it for having casts
22699 (UserDefinedType *) xxx
22701 2002-10-24 Miguel de Icaza <miguel@ximian.com>
22703 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22704 we should set on the Bindingflags.NonPublic, but not turn on
22705 private_ok. private_ok controls whether a Private member is
22706 returned (this is chekced on the filter routine), while the
22707 BindingFlags.NonPublic just controls whether private/protected
22708 will be allowed. This fixes the problem part of the problem of
22709 private properties being allowed to be used in derived classes.
22711 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22712 so we can call the children DoResolveLValue method (this will
22713 properly signal errors on lvalue assignments to base properties)
22715 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22716 getter are null, and we have a property info, we know that this
22717 happened because the lookup failed, so we report an error 122 for
22718 protection level violation.
22720 We also silently return if setter and getter are null in the
22721 resolve functions, this condition only happens if we have flagged
22722 the error before. This is the other half of the problem.
22724 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22725 not have accessibility information, that is why we were returning
22726 true in the filter function in typemanager.cs.
22728 To properly report 122 (property is inaccessible because of its
22729 protection level) correctly, we report this error in ResolveAccess
22730 by failing if both the setter and the getter are lacking (ie, the
22733 DoResolve and DoLResolve have been modified to check for both
22734 setter/getter being null and returning silently, the reason being
22735 that I did not want to put the knowledge about this error in upper
22738 int old = Report.Errors;
22739 x = new PropertyExpr (...);
22740 if (old != Report.Errors)
22745 So the property expr is returned, but it is invalid, so the error
22746 will be flagged during the resolve process.
22748 * class.cs: Remove InheritablePropertySignatureCompare from the
22749 class, as we no longer depend on the property signature to compute
22750 whether it is possible to implement a method or not.
22752 The reason is that calling PropertyInfo.GetGetMethod will return
22753 null (in .NET, in Mono it works, and we should change this), in
22754 cases where the Get Method does not exist in that particular
22759 class X { public virtual int A { get { return 1; } } }
22761 class Z : Y { public override int A { get { return 2; } } }
22763 Would fail in Z because the parent (Y) would not have the property
22764 defined. So we avoid this completely now (because the alternative
22765 fix was ugly and slow), and we now depend exclusively on the
22768 (PropertyBase.CheckBase): Use a method-base mechanism to find our
22769 reference method, instead of using the property.
22771 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22772 routines are gone now.
22774 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22775 names, they were incorrectly named.
22777 * cs-tokenizer.cs: Return are more gentle token on failure.
22779 * pending.cs (PendingImplementation.InterfaceMethod): This routine
22780 had an out-of-sync index variable, which caused it to remove from
22781 the list of pending methods the wrong method sometimes.
22783 2002-10-22 Miguel de Icaza <miguel@ximian.com>
22785 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22786 CanWrite, because those refer to this particular instance of the
22787 property, and do not take into account the fact that we can
22788 override single members of a property.
22790 Constructor requires an EmitContext. The resolution process does
22791 not happen here, but we need to compute the accessors before,
22792 because the resolution does not always happen for properties.
22794 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22795 subclass, before we did not update this flag, but we did update
22798 (GetAccessors): Drop this routine, as it did not work in the
22799 presence of partially overwritten set/get methods.
22801 Notice that this broke the cs1540 detection, but that will require
22804 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22808 * driver.cs: issue a warning instead of an error if we don't support
22809 debugging for the platform. Also ignore a couple of errors that may
22810 arise when trying to write the symbols. Undo my previous patch.
22812 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22814 * driver.cs: ignore /debug switch except for Unix platforms.
22816 2002-10-23 Nick Drochak <ndrochak@gol.com>
22818 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22820 2002-10-21 Miguel de Icaza <miguel@ximian.com>
22822 * driver.cs: Do not make mcs-debug conditional, so we do not break
22823 builds that use it.
22825 * statement.cs (UsageVector.MergeChildren): I would like Martin to
22826 review this patch. But basically after all the children variables
22827 have been merged, the value of "Breaks" was not being set to
22828 new_breaks for Switch blocks. I think that it should be set after
22829 it has executed. Currently I set this to the value of new_breaks,
22830 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22831 conservative, but I do not understand this code very well.
22833 I did not break anything in the build, so that is good ;-)
22835 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22837 2002-10-20 Mark Crichton <crichton@gimp.org>
22839 * cfold.cs: Fixed compile blocker. Really fixed it this time.
22841 2002-10-20 Nick Drochak <ndrochak@gol.com>
22843 * cfold.cs: Fixed compile blocker.
22845 2002-10-20 Miguel de Icaza <miguel@ximian.com>
22847 * driver.cs: I was chekcing the key, not the file.
22849 2002-10-19 Ravi Pratap <ravi@ximian.com>
22851 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22852 message that we were generating - we just need to silently return
22855 2002-10-19 Miguel de Icaza <miguel@ximian.com>
22857 * class.cs (Event.Define): Change my previous commit, as this
22858 breaks the debugger. This is a temporary hack, as it seems like
22859 the compiler is generating events incorrectly to begin with.
22861 * expression.cs (Binary.ResolveOperator): Added support for
22862 "U operator - (E x, E y)"
22864 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22867 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22868 init-only variables, but this path did not take into account that
22869 there might be also instance readonly variables. Correct this
22872 This fixes bug 32253
22874 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22877 * driver.cs: Change the extension for modules to `netmodule'
22879 * cs-parser.jay: Improved slightly the location tracking for
22880 the debugger symbols.
22882 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22883 modifiers that were specified instead of the hardcoded value
22884 (FamAndAssem). This was basically ignoring the static modifier,
22885 and others. Fixes 32429.
22887 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22888 fixed a bug in the process (32476)
22890 * expression.cs (ArrayAccess.EmitAssign): Patch from
22891 hwang_rob@yahoo.ca that fixes bug 31834.3
22893 2002-10-18 Miguel de Icaza <miguel@ximian.com>
22895 * driver.cs: Make the module extension .netmodule.
22897 2002-10-16 Miguel de Icaza <miguel@ximian.com>
22899 * driver.cs: Report an error if the resource file is not found
22900 instead of crashing.
22902 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22903 false, like Emit does.
22905 2002-10-16 Nick Drochak <ndrochak@gol.com>
22907 * typemanager.cs: Remove unused private member. Also reported mcs
22908 bug to report this as a warning like csc.
22910 2002-10-15 Martin Baulig <martin@gnome.org>
22912 * statement.cs (Statement.Emit): Made this a virtual method; emits
22913 the line number info and calls DoEmit().
22914 (Statement.DoEmit): New protected abstract method, formerly knows
22915 as Statement.Emit().
22917 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22919 2002-10-11 Miguel de Icaza <miguel@ximian.com>
22921 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22922 have fixed a remaining problem: not every AddXXXX was adding a
22923 fully qualified name.
22925 Now everyone registers a fully qualified name in the DeclSpace as
22926 being defined instead of the partial name.
22928 Downsides: we are slower than we need to be due to the excess
22929 copies and the names being registered this way.
22931 The reason for this is that we currently depend (on the corlib
22932 bootstrap for instance) that types are fully qualified, because
22933 we dump all the types in the namespace, and we should really have
22934 types inserted into the proper namespace, so we can only store the
22935 basenames in the defined_names array.
22937 2002-10-10 Martin Baulig <martin@gnome.org>
22939 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22940 from bug #31834, see the bug report for a testcase which is
22943 2002-10-10 Martin Baulig <martin@gnome.org>
22945 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22946 flow analysis code for this.
22948 * statement.cs (Do, While, For): Tell the flow analysis code about
22950 (FlowBranching.UsageVector): Added support for infinite loops.
22951 (Block.Resolve): Moved the dead code elimination here and use flow
22954 2002-10-09 Miguel de Icaza <miguel@ximian.com>
22956 * class.cs (Field.Define): Catch cycles on struct type
22959 * typemanager.cs (IsUnmanagedtype): Do not recursively check
22960 fields if the fields are static. We only need to check instance
22963 * expression.cs (As.DoResolve): Test for reference type.
22965 * statement.cs (Using.ResolveExpression): Use
22966 ConvertImplicitRequired, not ConvertImplicit which reports an
22968 (Using.ResolveLocalVariableDecls): ditto.
22970 * expression.cs (Binary.ResolveOperator): Report errors in a few
22971 places where we had to.
22973 * typemanager.cs (IsUnmanagedtype): Finish implementation.
22975 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22977 * expression.cs: Use StoreFromPtr instead of extracting the type
22978 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22980 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22981 an enumeration value to a System.Enum, but System.Enum is not a
22982 value type, but an class type, so we need to box.
22984 (Expression.ConvertExplicit): One codepath could return
22985 errors but not flag them. Fix this. Fixes #31853
22987 * parameter.cs (Resolve): Do not allow void as a parameter type.
22989 2002-10-06 Martin Baulig <martin@gnome.org>
22991 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22992 if it's a class type and not a struct. Fixes #31815.
22994 2002-10-06 Martin Baulig <martin@gnome.org>
22996 * statement.cs: Reworked the flow analysis code a bit to make it
22997 usable for dead code elimination.
22999 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23001 * cs-parser.jay: allow empty source files. Fixes bug #31781.
23003 2002-10-04 Miguel de Icaza <miguel@ximian.com>
23005 * expression.cs (ComposedCast.DoResolveType): A quick workaround
23006 to fix the test 165, will investigate deeper.
23008 2002-10-04 Martin Baulig <martin@gnome.org>
23010 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
23011 finally blocks actually work.
23012 (Try.Resolve): We don't need to create a sibling for `finally' if
23013 there is no finally block.
23015 2002-10-04 Martin Baulig <martin@gnome.org>
23017 * class.cs (Constructor.Define): The default accessibility for a
23018 non-default constructor is private, not public.
23020 2002-10-04 Miguel de Icaza <miguel@ximian.com>
23022 * class.cs (Constructor): Make AllowedModifiers public, add
23025 * cs-parser.jay: Perform the modifiers test here, as the
23026 constructor for the Constructor class usually receives a zero
23027 because of the way we create it (first we create, later we
23028 customize, and we were never checking the modifiers).
23030 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
23031 is a version of LookupTypeReflection that includes the type-name
23032 cache. This can be used as a fast path for functions that know
23033 the fully qualified name and are only calling into *.GetType() to
23034 obtain a composed type.
23036 This is also used by TypeManager.LookupType during its type
23039 (LookupType): We now also track the real type name, as sometimes
23040 we can get a quey for the real type name from things like
23041 ComposedCast. This fixes bug 31422.
23043 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
23044 complete type fullname, it does not have to go through the type
23045 resolution system to obtain the composed version of the type (for
23046 obtaining arrays or pointers).
23048 (Conditional.Emit): Use the EmitBoolExpression to
23049 generate nicer code, as requested by Paolo.
23051 (ArrayCreation.CheckIndices): Use the patch from
23052 hwang_rob@yahoo.ca to validate the array initializers.
23054 2002-10-03 Miguel de Icaza <miguel@ximian.com>
23056 * class.cs (ConstructorInitializer.Emit): simplify code by using
23057 Invocation.EmitCall, and at the same time, fix the bugs in calling
23058 parent constructors that took variable arguments.
23060 * ecore.cs (Expression.ConvertNumericExplicit,
23061 Expression.ImplicitNumericConversion): Remove the code that
23062 manually wrapped decimal (InternalTypeConstructor call is now gone
23065 * expression.cs (Cast.TryReduce): Also handle decimal types when
23066 trying to perform a constant fold on the type.
23068 * typemanager.cs (IsUnmanagedtype): Partially implemented.
23070 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
23071 that only turned off an error report, and did nothing else.
23073 2002-10-02 Miguel de Icaza <miguel@ximian.com>
23075 * driver.cs: Handle and ignore /fullpaths
23077 2002-10-01 Miguel de Icaza <miguel@ximian.com>
23079 * expression.cs (Binary.ResolveOperator): Catch the case where
23080 DoNumericPromotions returns true,
23082 (Binary.DoNumericPromotions): Simplify the code, and the tests.
23084 2002-09-27 Miguel de Icaza <miguel@ximian.com>
23086 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
23089 2002-09-26 Miguel de Icaza <miguel@ximian.com>
23091 * ecore.cs (ConvertNumericExplicit): It is not enough that the
23092 conversion exists, but it is also required that the conversion be
23093 performed. This manifested in "(Type64Enum) 2".
23095 * class.cs (TypeManager.AddMethod): The fix is not to change
23096 AddEnum, because that one was using a fully qualified name (every
23097 DeclSpace derivative does), but to change the AddMethod routine
23098 that was using an un-namespaced name. This now correctly reports
23099 the duplicated name.
23101 Revert patch until I can properly fix it. The issue
23102 is that we have a shared Type space across all namespaces
23103 currently, which is wrong.
23105 Options include making the Namespace a DeclSpace, and merge
23106 current_namespace/current_container in the parser.
23108 2002-09-25 Miguel de Icaza <miguel@ximian.com>
23110 * cs-parser.jay: Improve error reporting when we get a different
23111 kind of expression in local_variable_type and
23112 local_variable_pointer_type.
23114 Propagate this to avoid missleading errors being reported.
23116 * ecore.cs (ImplicitReferenceConversion): treat
23117 TypeManager.value_type as a target just like object_type. As
23122 Is valid, and needs to result in the int 1 being boxed before it
23123 is assigned to the value type v.
23125 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
23126 to validate the enumeration name.
23128 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
23129 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
23130 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
23132 * ecore.cs (TryImplicitIntConversion): When doing an
23133 implicit-enumeration-conversion, check if the type is 64-bits and
23134 perform a conversion before passing to EnumConstant.
23136 2002-09-23 Miguel de Icaza <miguel@ximian.com>
23138 * decl.cs (Error_AmbiguousTypeReference); New routine used to
23139 report ambiguous type references. Unlike the MS version, we
23140 report what the ambiguity is. Innovation at work ;-)
23142 (DeclSpace.FindType): Require a location argument to
23143 display when we display an ambiguous error.
23145 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
23147 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
23149 * expression.cs (EmitDynamicInitializers): Apply patch from
23150 hwang_rob@yahoo.ca that fixes the order in which we emit our
23153 2002-09-21 Martin Baulig <martin@gnome.org>
23155 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
23156 delegate takes no arguments.
23158 2002-09-20 Miguel de Icaza <miguel@ximian.com>
23160 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
23163 * expression.cs: Extract the underlying type.
23165 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
23167 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
23169 2002-09-19 Miguel de Icaza <miguel@ximian.com>
23171 * class.cs (TypeContainer.DefineType): We can not use the nice
23172 PackingSize with the size set to 1 DefineType method, because it
23173 will not allow us to define the interfaces that the struct
23176 This completes the fixing of bug 27287
23178 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
23179 means also structs. This fixes part of the problem.
23180 (Expresion.ImplicitReferenceConversionExists): ditto.
23182 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
23183 error if there were no errors reported during the type lookup
23184 process, to avoid duplicates or redundant errors. Without this
23185 you would get an ambiguous errors plus a type not found. We have
23186 beaten the user enough with the first error.
23188 (DeclSparce.FindType): Emit a warning if we have an ambiguous
23191 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
23192 during the resolution process, stop the lookup, this avoids
23193 repeated error reports (same error twice).
23195 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
23197 * typemanager.cs (LookupType): Redo the type lookup code to match
23198 the needs of System.Reflection.
23200 The issue is that System.Reflection requires references to nested
23201 types to begin with a "+" sign instead of a dot. So toplevel
23202 types look like: "NameSpace.TopLevelClass", and nested ones look
23203 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
23206 2002-09-19 Martin Baulig <martin@gnome.org>
23208 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
23209 says that a method always returns or always throws an exception,
23210 don't report the CS0161.
23212 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
23213 set `Returns = new_returns'.
23215 2002-09-19 Martin Baulig <martin@gnome.org>
23217 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
23218 to an enum constant, check for a CS0176.
23220 2002-09-18 Miguel de Icaza <miguel@ximian.com>
23222 * class.cs (TypeContainer.CheckPairedOperators): Now we check
23223 for operators that must be in pairs and report errors.
23225 * ecore.cs (SimpleName.DoResolveType): During the initial type
23226 resolution process, when we define types recursively, we must
23227 check first for types in our current scope before we perform
23228 lookups in the enclosing scopes.
23230 * expression.cs (MakeByteBlob): Handle Decimal blobs.
23232 (Invocation.VerifyArgumentsCompat): Call
23233 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
23234 I thought we were supposed to always call this, but there are a
23235 few places in the code where we dont do it.
23237 2002-09-17 Miguel de Icaza <miguel@ximian.com>
23239 * driver.cs: Add support in -linkres and -resource to specify the
23240 name of the identifier.
23242 2002-09-16 Miguel de Icaza <miguel@ximian.com>
23244 * ecore.cs (StandardConversionExists): Sync with the conversion
23245 code: allow anything-* to void* conversions.
23247 (FindMostSpecificSource): Use an Expression argument
23248 instead of a Type, because we might be handed over a Literal which
23249 gets a few more implicit conversions that plain types do not. So
23250 this information was being lost.
23252 Also, we drop the temporary type-holder expression when not
23255 2002-09-17 Martin Baulig <martin@gnome.org>
23257 * class.cs (PropertyBase.CheckBase): Don't check the base class if
23258 this is an explicit interface implementation.
23260 2002-09-17 Martin Baulig <martin@gnome.org>
23262 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
23263 different `IndexerName' attributes.
23265 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
23266 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
23267 virtual CommonResolve().
23269 2002-09-16 Miguel de Icaza <miguel@ximian.com>
23271 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
23272 and convert that to the UnderlyingType.
23274 * statement.cs (Foreach.Resolve): Indexers are just like variables
23275 or PropertyAccesses.
23277 * cs-tokenizer.cs (consume_string): Track line numbers and columns
23278 inside quoted strings, we were not doing this before.
23280 2002-09-16 Martin Baulig <martin@gnome.org>
23282 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
23283 resolve it. This is needed for the definite assignment check of the
23284 instance expression, fixes bug #29846.
23285 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
23287 2002-09-16 Nick Drochak <ndrochak@gol.com>
23289 * parameter.cs: Fix compile error. Cannot reference static member
23290 from an instance object. Is this an mcs bug?
23292 2002-09-14 Martin Baulig <martin@gnome.org>
23294 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
23295 multiple times. Fixes bug #30295, added test-166.cs.
23297 2002-09-14 Martin Baulig <martin@gnome.org>
23299 * statement.cs (Block.Emit): Don't emit unreachable code.
23300 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
23301 `break' statements.
23302 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
23304 2002-09-14 Martin Baulig <martin@gnome.org>
23306 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
23309 2002-09-14 Martin Baulig <martin@gnome.org>
23311 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
23312 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
23313 be false on the ms runtime.
23315 2002-09-13 Martin Baulig <martin@gnome.org>
23317 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
23318 the CS0038 error message.
23320 2002-09-12 Miguel de Icaza <miguel@ximian.com>
23322 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
23323 constant inside, return it.
23325 2002-09-12 Martin Baulig <martin@gnome.org>
23327 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
23328 implicit conversion can be done between enum types.
23330 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
23331 check whether an implicit conversion to the current enum's UnderlyingType
23332 exists and report an error if not.
23334 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
23335 without debugging support.
23337 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
23338 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
23340 2002-09-12 Martin Baulig <martin@gnome.org>
23342 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
23344 * ecore.cs (IMemberExpr.DeclaringType): New property.
23345 (SimpleName.SimpleNameResolve): Check whether we're accessing a
23346 nonstatic member of an outer type (CS0038).
23348 2002-09-11 Miguel de Icaza <miguel@ximian.com>
23350 * driver.cs: Activate the using-error detector at warning level
23351 4 (at least for MS-compatible APIs).
23353 * namespace.cs (VerifyUsing): Small buglett fix.
23355 * pending.cs (PendingImplementation): pass the container pointer.
23357 * interface.cs (GetMethods): Allow for recursive definition. Long
23358 term, I would like to move every type to support recursive
23359 definitions, not the current ordering mechanism that we have right
23362 The situation is this: Attributes are handled before interfaces,
23363 so we can apply attributes to interfaces. But some attributes
23364 implement interfaces, we will now handle the simple cases
23365 (recursive definitions will just get an error).
23367 * parameter.cs: Only invalidate types at the end if we fail to
23370 2002-09-09 Martin Baulig <martin@gnome.org>
23372 * ecore.cs (PropertyExpr.Emit): Also check for
23373 TypeManager.system_int_array_get_length so this'll also work when
23374 compiling corlib. Fixes #30003.
23376 2002-09-09 Martin Baulig <martin@gnome.org>
23378 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
23379 and throw an exception if we can't get the type's size. Fixed #30040,
23382 2002-09-09 Martin Baulig <martin@gnome.org>
23384 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
23386 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
23387 context. Fixes bug #30027.
23389 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
23390 virtual functions. Fixes bug #30043, added test-164.cs.
23392 2002-09-08 Ravi Pratap <ravi@ximian.com>
23394 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
23396 2002-09-08 Nick Drochak <ndrochak@gol.com>
23398 * driver.cs: Use an object to get the windows codepage since it's not a
23401 2002-09-08 Miguel de Icaza <miguel@ximian.com>
23403 * statement.cs (For.Emit): for infinite loops (test == null)
23404 return whether there is a break inside, not always "true".
23406 * namespace.cs (UsingEntry): New struct to hold the name of the
23407 using definition, the location where it is defined, and whether it
23408 has been used in a successful type lookup.
23410 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23415 2002-09-06 Ravi Pratap <ravi@ximian.com>
23417 * attribute.cs : Fix incorrect code which relied on catching
23418 a NullReferenceException to detect a null being passed in
23419 where an object was expected.
23421 2002-09-06 Miguel de Icaza <miguel@ximian.com>
23423 * statement.cs (Try): flag the catch variable as assigned
23425 * expression.cs (Cast): Simplified by using ResolveType instead of
23426 manually resolving.
23428 * statement.cs (Catch): Fix bug by using ResolveType.
23430 2002-09-06 Ravi Pratap <ravi@ximian.com>
23432 * expression.cs (BetterConversion): Special case for when we have
23433 a NullLiteral as the argument and we have to choose between string
23434 and object types - we choose string the way csc does.
23436 * attribute.cs (Attribute.Resolve): Catch the
23437 NullReferenceException and report error #182 since the Mono
23438 runtime no more has the bug and having this exception raised means
23439 we tried to select a constructor which takes an object and is
23442 2002-09-05 Ravi Pratap <ravi@ximian.com>
23444 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23445 message (1502, 1503) when we can't locate a method after overload
23446 resolution. This is much more informative and closes the bug
23449 * interface.cs (PopulateMethod): Return if there are no argument
23450 types. Fixes a NullReferenceException bug.
23452 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23453 expressions too. Previously we were checking only in one place for
23454 positional arguments leaving out named arguments.
23456 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23457 type to the enum type is not allowed. Remove code corresponding to
23460 (ConvertNumericExplicit): Allow explicit conversions from
23461 the underlying type to enum type. This precisely follows the spec
23462 and closes a bug filed by Gonzalo.
23464 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23467 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23469 2002-09-03 Miguel de Icaza <miguel@ximian.com>
23471 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23472 it was important that we stored the right value after the
23473 reduction in `converted'.
23475 2002-09-04 Martin Baulig <martin@gnome.org>
23477 * location.cs (Location.SymbolDocument): Use full pathnames for the
23480 2002-08-30 Miguel de Icaza <miguel@ximian.com>
23482 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23483 of the expression resolve mechanism, because that will catch the
23484 SimpleName error failures.
23486 (Conditional): If we can not resolve the
23487 expression, return, do not crash.
23489 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23492 (location): display token name instead of its number.
23494 2002-08-28 Martin Baulig <martin@gnome.org>
23496 * expression.cs (Binary.ResolveOperator): Don't silently return
23497 but return an error if an operator cannot be applied between two
23500 2002-08-28 Martin Baulig <martin@gnome.org>
23502 * class.cs (Constructor.Define): Set the permission attributes
23503 correctly instead of making all constructors public.
23505 2002-08-28 Martin Baulig <martin@gnome.org>
23507 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23508 for private members before reporting a CS0103; if we find anything,
23511 2002-08-28 Martin Baulig <martin@gnome.org>
23513 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23514 to check whether `closure_start_type == closure_invocation_type',
23515 we also need to check whether `m.DeclaringType == closure_invocation_type'
23516 before bypassing the permission checks. We might be accessing
23517 protected/private members from the base class.
23518 (TypeManager.RealMemberLookup): Only set private_ok if private
23519 members were requested via BindingFlags.NonPublic.
23521 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23523 * expression.cs (MemberAccess.ResolveMemberAccess): Set
23524 MethodGroupExpr.IsExplicitImpl if appropriate.
23525 (Invocation.DoResolve): Don't report the CS0120 for explicit
23526 interface implementations.
23528 2002-08-27 Martin Baulig <martin@gnome.org>
23530 * expression.cs (Invocation.DoResolve): If this is a static
23531 method and we don't have an InstanceExpression, we must report
23534 2002-08-25 Martin Baulig <martin@gnome.org>
23536 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23537 `==' between a valuetype and an object.
23539 2002-08-25 Miguel de Icaza <miguel@ximian.com>
23541 * ecore.cs (TypeExpr): Provide a ToString method.
23543 2002-08-24 Martin Baulig <martin@gnome.org>
23545 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23546 now called proggie.dbg and it's a binary file.
23548 2002-08-23 Martin Baulig <martin@gnome.org>
23550 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23552 2002-08-23 Martin Baulig <martin@gnome.org>
23554 * struct.cs (MyStructInfo.ctor): Make this work with empty
23555 structs; it's not allowed to use foreach() on null.
23557 2002-08-23 Martin Baulig <martin@gnome.org>
23559 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23560 writer the full pathname of the generated assembly.
23562 2002-08-23 Martin Baulig <martin@gnome.org>
23564 * statements.cs (FlowBranching.UsageVector.MergeChildren):
23565 A `finally' block never returns or breaks; improved handling of
23568 2002-08-23 Martin Baulig <martin@gnome.org>
23570 * statement.cs (Throw.Resolve): Allow `throw null'.
23572 2002-08-23 Martin Baulig <martin@gnome.org>
23574 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23575 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23576 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
23577 MemberLookup would return a wrong event if this is an explicit
23578 interface implementation and the class has an event with the same
23581 2002-08-23 Martin Baulig <martin@gnome.org>
23583 * statement.cs (Block.AddChildVariableNames): New public method.
23584 (Block.AddChildVariableName): Likewise.
23585 (Block.IsVariableNameUsedInChildBlock): Likewise.
23586 (Block.AddVariable): Check whether a variable name has already
23587 been used in a child block.
23589 * cs-parser.jay (declare_local_variables): Mark all variable names
23590 from the current block as being used in a child block in the
23593 2002-08-23 Martin Baulig <martin@gnome.org>
23595 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23596 find the symbol writer.
23598 * driver.cs: csc also allows the arguments to /define being
23599 separated by commas, not only by semicolons.
23601 2002-08-23 Martin Baulig <martin@gnome.org>
23603 * interface.cs (Interface.GetMembers): Added static check for events.
23605 2002-08-15 Martin Baulig <martin@gnome.org>
23607 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23608 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23610 * ecore.cs (Expression.MemberLookup): Added documentation and explained
23611 why the MethodData.EmitDestructor() change was necessary.
23613 2002-08-20 Martin Baulig <martin@gnome.org>
23615 * class.cs (TypeContainer.FindMembers): Added static check for events.
23617 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23619 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23620 use Type.GetEvents(), not Type.FindMembers().
23622 2002-08-20 Martin Baulig <martin@gnome.org>
23624 * decl.cs (MemberCache): Added a special method cache which will
23625 be used for method-only searched. This ensures that a method
23626 search will return a MethodInfo with the correct ReflectedType for
23629 2002-08-20 Martin Baulig <martin@gnome.org>
23631 * decl.cs (DeclSpace.FindMembers): Made this public.
23633 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23635 * delegate.cs: fixed build on windows.
23636 [FIXME: Filed as bug #29150: MCS must report these errors.]
23638 2002-08-19 Ravi Pratap <ravi@ximian.com>
23640 * ecore.cs (StandardConversionExists): Return a false
23641 if we are trying to convert the void type to anything else
23642 since that is not allowed.
23644 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23645 we flag error 70 in the event an event is trying to be accessed
23646 directly from outside the declaring type.
23648 2002-08-20 Martin Baulig <martin@gnome.org>
23650 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23651 MemberCache from typemanager.cs to decl.cs.
23653 2002-08-19 Martin Baulig <martin@gnome.org>
23655 * class.cs (TypeContainer): Implement IMemberContainer.
23656 (TypeContainer.DefineMembers): Create the MemberCache.
23657 (TypeContainer.FindMembers): Do better BindingFlags checking; only
23658 return public members if BindingFlags.Public was given, check
23659 whether members are static.
23661 2002-08-16 Martin Baulig <martin@gnome.org>
23663 * decl.cs (DeclSpace.Define): Splitted this in Define and
23664 DefineMembers. DefineMembers is called first and initializes the
23667 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
23668 DefineMembers() on all our DeclSpaces.
23670 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23671 but call DefineMembers() on all nested interfaces. We call their
23672 Define() in our new Define() function.
23674 * interface.cs (Interface): Implement IMemberContainer.
23675 (Interface.Define): Moved all code except the attribute stuf to
23677 (Interface.DefineMembers): Initialize the member cache.
23679 * typemanager.cs (IMemberFinder): Removed this interface, we don't
23680 need this anymore since we can use MemberCache.FindMembers directly.
23682 2002-08-19 Martin Baulig <martin@gnome.org>
23684 * typemanager.cs (MemberCache): When creating the cache for an
23685 interface type, add all inherited members.
23686 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23687 to `out bool used_cache' and documented it.
23688 (TypeManager.MemberLookup): If we already used the cache in the first
23689 iteration, we don't need to do the interfaces check.
23691 2002-08-19 Martin Baulig <martin@gnome.org>
23693 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
23694 here from IMemberFinder and don't implement this interface anymore.
23695 (DeclSpace.MemberCache): Moved here from IMemberFinder.
23697 * typemanager.cs (IMemberFinder): This interface is now only used by
23698 classes which actually support the member cache.
23699 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23700 since we only put DeclSpaces into this Hashtable.
23701 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23702 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23704 2002-08-16 Martin Baulig <martin@gnome.org>
23706 * typemanager.cs (ICachingMemberFinder): Removed.
23707 (IMemberFinder.MemberCache): New property.
23708 (TypeManager.FindMembers): Merged this with RealFindMembers().
23709 This function will never be called from TypeManager.MemberLookup()
23710 so we can't use the cache here, just the IMemberFinder.
23711 (TypeManager.MemberLookup_FindMembers): Check whether the
23712 IMemberFinder has a MemberCache and call the cache's FindMembers
23714 (MemberCache): Rewrote larger parts of this yet another time and
23715 cleaned it up a bit.
23717 2002-08-15 Miguel de Icaza <miguel@ximian.com>
23719 * driver.cs (LoadArgs): Support quoting.
23721 (Usage): Show the CSC-like command line arguments.
23723 Improved a few error messages.
23725 2002-08-15 Martin Baulig <martin@gnome.org>
23727 * typemanager.cs (IMemberContainer.Type): New property.
23728 (IMemberContainer.IsInterface): New property.
23730 The following changes are conditional to BROKEN_RUNTIME, which is
23731 defined at the top of the file.
23733 * typemanager.cs (MemberCache.MemberCache): Don't add the base
23734 class'es members, but add all members from TypeHandle.ObjectType
23735 if we're an interface.
23736 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23737 is the current type.
23738 (MemberCache.CacheEntry.Container): Removed this field.
23739 (TypeHandle.GetMembers): Include inherited members.
23741 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23743 * typemanager.cs: fixed compilation and added a comment on a field that
23746 2002-08-15 Martin Baulig <martin@gnome.org>
23748 * class.cs (ConstructorInitializer.Resolve): In the
23749 Expression.MemberLookup call, use the queried_type as
23752 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23753 declared' attribute, it's always true.
23754 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23755 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23756 temporary wrapper for FindMembers which tells MemberLookup whether
23757 members from the base classes are included in the return value.
23758 This will go away soon.
23759 (TypeManager.MemberLookup): Use this temporary hack here; once the
23760 new MemberCache is completed, we don't need to do the DeclaredOnly
23761 looping here anymore since the MemberCache will take care of this.
23762 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23763 (MemberCache): When creating the MemberCache for a class, get
23764 members from the current class and all its base classes.
23765 (MemberCache.CacheEntry.Container): New field. This is a
23766 temporary hack until the Mono runtime is fixed to distinguish
23767 between ReflectedType and DeclaringType. It allows us to use MCS
23768 with both the MS runtime and the unfixed Mono runtime without
23769 problems and without accecting performance.
23770 (MemberCache.SearchMembers): The DeclaredOnly looping from
23771 TypeManager.MemberLookup is now done here.
23773 2002-08-14 Martin Baulig <martin@gnome.org>
23775 * statement.cs (MyStructInfo.MyStructInfo): Don't call
23776 Type.GetFields on dynamic types but get the fields from the
23777 corresponding TypeContainer.
23778 (MyStructInfo.GetStructInfo): Added check for enum types.
23780 * typemanager.cs (MemberList.IsSynchronized): Implemented.
23781 (MemberList.SyncRoot): Implemented.
23782 (TypeManager.FilterWithClosure): No need to check permissions if
23783 closure_start_type == closure_invocation_type, don't crash if
23784 closure_invocation_type is null.
23786 2002-08-13 Martin Baulig <martin@gnome.org>
23788 Rewrote TypeContainer.FindMembers to use a member cache. This
23789 gives us a speed increase of about 35% for the self-hosting MCS
23790 build and of about 15-20% for the class libs (both on GNU/Linux).
23792 * report.cs (Timer): New class to get enhanced profiling. This
23793 whole class is "TIMER" conditional since it remarkably slows down
23796 * class.cs (MemberList): New class. This is an IList wrapper
23797 which we're now using instead of passing MemberInfo[]'s around to
23798 avoid copying this array unnecessarily.
23799 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23800 (ICachingMemberFinder, IMemberContainer): New interface.
23801 (TypeManager.FilterWithClosure): If `criteria' is null, the name
23802 has already been checked, otherwise use it for the name comparision.
23803 (TypeManager.FindMembers): Renamed to RealMemberFinder and
23804 provided wrapper which tries to use ICachingMemberFinder.FindMembers
23805 if possible. Returns a MemberList, not a MemberInfo [].
23806 (TypeHandle): New class, implements IMemberContainer. We create
23807 one instance of this class per type, it contains a MemberCache
23808 which is used to do the member lookups.
23809 (MemberCache): New class. Each instance of this class contains
23810 all members of a type and a name-based hash table.
23811 (MemberCache.FindMembers): This is our new member lookup
23812 function. First, it looks up all members of the requested name in
23813 the hash table. Then, it walks this list and sorts out all
23814 applicable members and returns them.
23816 2002-08-13 Martin Baulig <martin@gnome.org>
23818 In addition to a nice code cleanup, this gives us a performance
23819 increase of about 1.4% on GNU/Linux - not much, but it's already
23820 half a second for the self-hosting MCS compilation.
23822 * typemanager.cs (IMemberFinder): New interface. It is used by
23823 TypeManager.FindMembers to call FindMembers on a TypeContainer,
23824 Enum, Delegate or Interface.
23825 (TypeManager.finder_to_member_finder): New PtrHashtable.
23826 (TypeManager.finder_to_container): Removed.
23827 (TypeManager.finder_to_delegate): Removed.
23828 (TypeManager.finder_to_interface): Removed.
23829 (TypeManager.finder_to_enum): Removed.
23831 * interface.cs (Interface): Implement IMemberFinder.
23833 * delegate.cs (Delegate): Implement IMemberFinder.
23835 * enum.cs (Enum): Implement IMemberFinder.
23837 * class.cs (TypeContainer): Implement IMemberFinder.
23839 2002-08-12 Martin Baulig <martin@gnome.org>
23841 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23843 2002-08-12 Martin Baulig <martin@gnome.org>
23845 * ecore.cs (ITypeExpression): New interface for expressions which
23847 (TypeExpression): Renamed to TypeLookupExpression.
23848 (Expression.DoResolve): If we're doing a types-only lookup, the
23849 expression must implement the ITypeExpression interface and we
23850 call DoResolveType() on it.
23851 (SimpleName): Implement the new ITypeExpression interface.
23852 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23853 hack, the situation that we're only looking up types can't happen
23854 anymore when this method is called. Moved the type lookup code to
23855 DoResolveType() and call it.
23856 (SimpleName.DoResolveType): This ITypeExpression interface method
23857 is now doing the types-only lookup.
23858 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23859 (ResolveFlags): Added MaskExprClass.
23861 * expression.cs (MemberAccess): Implement the ITypeExpression
23863 (MemberAccess.DoResolve): Added support for a types-only lookup
23864 when we're called via ITypeExpression.DoResolveType().
23865 (ComposedCast): Implement the ITypeExpression interface.
23867 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
23868 Expression.Resolve() with ResolveFlags.Type instead.
23870 2002-08-12 Martin Baulig <martin@gnome.org>
23872 * interface.cs (Interface.Define): Apply attributes.
23874 * attribute.cs (Attribute.ApplyAttributes): Added support for
23875 interface attributes.
23877 2002-08-11 Martin Baulig <martin@gnome.org>
23879 * statement.cs (Block.Emit): Only check the "this" variable if we
23880 do not always throw an exception.
23882 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23883 whether the property has a set accessor.
23885 2002-08-11 Martin Baulig <martin@gnome.org>
23887 Added control flow analysis support for structs.
23889 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23890 with control flow analysis turned off.
23891 (IVariable): New interface.
23892 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23893 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23894 (FieldExpr.DoResolve): Resolve the instance expression with flow
23895 analysis turned off and do the definite assignment check after the
23896 resolving when we know what the expression will resolve to.
23898 * expression.cs (LocalVariableReference, ParameterReference):
23899 Implement the new IVariable interface, only call the flow analysis
23900 code if ec.DoFlowAnalysis is true.
23901 (This): Added constructor which takes a Block argument. Implement
23902 the new IVariable interface.
23903 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23904 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23905 This does the definite assignment checks for struct members.
23907 * class.cs (Constructor.Emit): If this is a non-static `struct'
23908 constructor which doesn't have any initializer, call
23909 Block.AddThisVariable() to tell the flow analysis code that all
23910 struct elements must be initialized before control returns from
23913 * statement.cs (MyStructInfo): New public class.
23914 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23915 argument to this indexer. If non-zero, check an individual struct
23916 member, not the whole struct.
23917 (FlowBranching.CheckOutParameters): Check struct members.
23918 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23919 overloaded versions of these methods which take an additional
23920 `int field_idx' argument to check struct members.
23921 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23922 overloaded versions of these methods which take an additional
23923 `string field_name' argument to check struct member.s
23924 (VariableInfo): Implement the IVariable interface.
23925 (VariableInfo.StructInfo): New public property. Returns the
23926 MyStructInfo instance of the variable if it's a struct or null.
23927 (Block.AddThisVariable): New public method. This is called from
23928 Constructor.Emit() for non-static `struct' constructor which do
23929 not have any initializer. It creates a special variable for the
23930 "this" instance variable which will be checked by the flow
23931 analysis code to ensure that all of the struct's fields are
23932 initialized before control returns from the constructor.
23933 (UsageVector): Added support for struct members. If a
23934 variable/parameter is a struct with N members, we reserve a slot
23935 in the usage vector for each member. A struct is considered fully
23936 initialized if either the struct itself (slot 0) or all its
23937 members are initialized.
23939 2002-08-08 Martin Baulig <martin@gnome.org>
23941 * driver.cs (Driver.MainDriver): Only report an error CS5001
23942 if there were no compilation errors.
23944 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23945 `UnsafeContext' property to determine whether the parent is in
23946 unsafe context rather than checking the parent's ModFlags:
23947 classes nested in an unsafe class are unsafe as well.
23949 2002-08-08 Martin Baulig <martin@gnome.org>
23951 * statement.cs (UsageVector.MergeChildren): Distinguish between
23952 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23953 we return. Added test17() and test18() to test-154.cs.
23955 2002-08-08 Martin Baulig <martin@gnome.org>
23957 * typemanager.cs (TypeManager.FilterWithClosure): If we have
23958 Family access, make sure the invoking type isn't a subclass of the
23959 queried type (that'd be a CS1540).
23961 * ecore.cs (Expression.MemberLookup): Added overloaded version of
23962 this method which takes an additional `Type invocation_type'.
23964 * expression.cs (BaseAccess.DoResolve): Use the base type as
23965 invocation and query type.
23966 (MemberAccess.DoResolve): If the lookup failed and we're about to
23967 report a CS0122, try a lookup with the ec.ContainerType - if this
23968 succeeds, we must report a CS1540.
23970 2002-08-08 Martin Baulig <martin@gnome.org>
23972 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23973 (MethodGroupExpr): Implement the IMemberExpr interface.
23975 * expression (MemberAccess.ResolveMemberAccess): No need to have
23976 any special code for MethodGroupExprs anymore, they're now
23979 2002-08-08 Martin Baulig <martin@gnome.org>
23981 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23982 Family, FamANDAssem and FamORAssem permissions.
23983 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23985 2002-08-08 Martin Baulig <martin@gnome.org>
23987 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23988 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23991 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23993 * driver.cs: implemented /resource option to embed managed resources.
23995 2002-08-07 Martin Baulig <martin@gnome.org>
23997 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23998 (FieldBase.HasFieldInitializer): New public property.
23999 (FieldBase.GetInitializerExpression): New public method. Resolves and
24000 returns the field initializer and makes sure it is only resolved once.
24001 (TypeContainer.EmitFieldInitializers): Call
24002 FieldBase.GetInitializerExpression to get the initializer, this ensures
24003 that it isn't resolved multiple times.
24005 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
24006 the resolving process (SimpleName/MemberLookup) that we're currently
24007 emitting a field initializer (which must not access any instance members,
24008 this is an error CS0236).
24010 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
24011 argument, if the `IsFieldInitializer' flag is set, we must report and
24012 error CS0236 and not an error CS0120.
24014 2002-08-07 Martin Baulig <martin@gnome.org>
24016 * ecore.cs (IMemberExpr): New public interface.
24017 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
24018 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
24019 if the expression is an IMemberExpr.
24021 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
24022 to be null, implicitly default to `this' if we're non-static in
24023 this case. Simplified the code a lot by using the new IMemberExpr
24024 interface. Also fixed bug #28176 here.
24026 2002-08-06 Martin Baulig <martin@gnome.org>
24028 * cs-parser.jay (SimpleLookup): Removed. We need to create
24029 ParameterReferences during semantic analysis so that we can do a
24030 type-only search when resolving Cast, TypeOf and SizeOf.
24031 (block): Pass the `current_local_parameters' to the Block's
24034 * class.cs (ConstructorInitializer): Added `Parameters parameters'
24035 argument to the constructor.
24036 (ConstructorInitializer.Resolve): Create a temporary implicit
24037 block with the parameters.
24039 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
24040 references here if we aren't doing a type-only search.
24042 * statement.cs (Block): Added constructor which takes a
24043 `Parameters parameters' argument.
24044 (Block.Parameters): New public property.
24046 * support.cs (InternalParameters.Parameters): Renamed `parameters'
24047 to `Parameters' and made it public readonly.
24049 2002-08-06 Martin Baulig <martin@gnome.org>
24051 * ecore.cs (Expression.Warning): Made this public as well.
24053 * report.cs (Report.Debug): Print the contents of collections.
24055 2002-08-06 Martin Baulig <martin@gnome.org>
24057 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
24058 used to tell Resolve() which kinds of expressions it may return.
24059 (Expression.Resolve): Added overloaded version of this method which
24060 takes a `ResolveFlags flags' argument. This can be used to tell
24061 Resolve() which kinds of expressions it may return. Reports a
24063 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
24064 ResolveFlags.SimpleName.
24065 (Expression.Error118): Added overloaded version of this method which
24066 takes a `ResolveFlags flags' argument. It uses the flags to determine
24067 which kinds of expressions are allowed.
24069 * expression.cs (Argument.ResolveMethodGroup): New public method.
24070 Resolves an argument, but allows a MethodGroup to be returned.
24071 This is used when invoking a delegate.
24073 * TODO: Updated a bit.
24075 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24077 Fixed compilation with csc.
24079 * ecore.cs: Expression.Error made public. Is this correct? Should
24080 Warning be made public too?
24082 * expression.cs: use ea.Location instead of ea.loc.
24083 [FIXME: Filed as bug #28607: MCS must report these errors.]
24085 2002-08-06 Martin Baulig <martin@gnome.org>
24087 * ecore.cs (Expression.loc): Moved the location here instead of
24088 duplicating it in all derived classes.
24089 (Expression.Location): New public property.
24090 (Expression.Error, Expression.Warning): Made them non-static and
24091 removed the location argument.
24092 (Expression.Warning): Added overloaded version which takes an
24093 `int level' argument.
24094 (Expression.Error118): Make this non-static and removed the
24095 expression and location arguments.
24096 (TypeExpr): Added location argument to the constructor.
24098 * expression.cs (StaticCallExpr): Added location argument to
24100 (Indirection, PointerArithmetic): Likewise.
24101 (CheckedExpr, UnCheckedExpr): Likewise.
24102 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
24103 (StringPtr): Likewise.
24106 2002-08-05 Martin Baulig <martin@gnome.org>
24108 * expression.cs (BaseAccess.DoResolve): Actually report errors.
24110 * assign.cs (Assign.DoResolve): Check whether the source
24111 expression is a value or variable.
24113 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
24114 while resolving the corresponding blocks.
24116 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
24117 an error, don't silently return null.
24119 * statement.cs (Block.AddVariable): Do the error reporting here
24120 and distinguish between CS0128 and CS0136.
24121 (Block.DoResolve): Report all unused labels (warning CS0164).
24122 (LabeledStatement): Pass the location to the constructor.
24123 (LabeledStatement.HasBeenReferenced): New property.
24124 (LabeledStatement.Resolve): Set it to true here.
24126 * statement.cs (Return.Emit): Return success even after reporting
24127 a type mismatch error (CS0126 or CS0127), this is what csc does and
24128 it avoids confusing the users with any consecutive errors.
24130 2002-08-05 Martin Baulig <martin@gnome.org>
24132 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
24134 * const.cs (Const.LookupConstantValue): Catch circular definitions.
24136 * expression.cs (MemberAccess.DoResolve): Silently return if an
24137 error has already been reported.
24139 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
24140 error has already been reported.
24142 2002-08-05 Martin Baulig <martin@gnome.org>
24144 * statement.cs (UsageVector): Only initialize the `parameters'
24145 vector if we actually have any "out" parameters.
24147 2002-08-05 Martin Baulig <martin@gnome.org>
24149 * expression.cs (Binary.ResolveOperator): When combining delegates,
24150 they must have the same type.
24152 2002-08-05 Martin Baulig <martin@gnome.org>
24154 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
24155 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
24156 work with the ms runtime and we also don't need it: if we're a
24157 PropertyBuilder and not in the `indexer_arguments' hash, then we
24158 are a property and not an indexer.
24160 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
24161 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
24162 since the latter one doesn't work with the ms runtime.
24164 2002-08-03 Martin Baulig <martin@gnome.org>
24166 Fixed bugs #27998 and #22735.
24168 * class.cs (Method.IsOperator): New public field.
24169 (Method.CheckBase): Report CS0111 if there's already a method
24170 with the same parameters in the current class. Report CS0508 when
24171 attempting to change the return type of an inherited method.
24172 (MethodData.Emit): Report CS0179 if a method doesn't have a body
24173 and it's not marked abstract or extern.
24174 (PropertyBase): New abstract base class for Property and Indexer.
24175 (PropertyBase.CheckBase): Moved here from Property and made it work
24177 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
24178 the same so we can reuse it there.
24179 (Property, Indexer): Derive from PropertyBase.
24180 (MethodSignature.inheritable_property_signature_filter): New delegate
24181 to find properties and indexers.
24183 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
24184 argument and improved error reporting.
24186 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
24187 EmptyReadOnlyParameters and made it a property.
24189 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
24190 version of this method which takes a `PropertyInfo indexer'.
24191 (TypeManager.RegisterIndexer): New method.
24193 * class.cs: Added myself as author of this file :-)
24195 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24197 * class.cs: fixed compilation on windoze.
24199 2002-08-03 Martin Baulig <martin@gnome.org>
24201 * interface.cs (Interface.GetInterfaceBases): Check whether all
24202 base interfaces are at least as accessible than the current one.
24204 * class.cs (TypeContainer.GetClassBases): Check whether base types
24205 are at least as accessible than the current type.
24206 (TypeContainer.AsAccessible): Implemented and made non-static.
24207 (MemberBase.CheckParameters): Report errors if the accessibility
24210 * delegate.cs (Delegate.Delegate): The default visibility is
24211 internal for top-level types and private for nested types.
24212 (Delegate.Define): Report errors if the accessibility checks fail.
24214 * enum.cs (Enum.Enum): The default visibility is internal for
24215 top-level types and private for nested types.
24216 (Enum.DefineType): Compute the correct visibility.
24218 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
24219 function which takes a `bool is_toplevel' instead of a TypeContainer.
24221 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
24224 2002-08-02 Martin Baulig <martin@gnome.org>
24226 * expression.cs (LocalVariableReferenc): Added constructor which
24227 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
24228 (LocalVariableReference.IsReadOnly): New property.
24229 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
24230 variable is readonly, use our own readonly flag to do this; you can
24231 use the new constructor to get a writable reference to a read-only
24234 * cs-parser.jay (foreach_statement, using_statement): Get a writable
24235 reference to the local variable.
24237 2002-08-01 Miguel de Icaza <miguel@ximian.com>
24239 * rootcontext.cs (ResolveCore): Also include System.Exception
24241 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
24242 we reach an EmptyStatement.
24244 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
24247 * expression.cs (Binary.ResolveOperator): Check error result in
24250 use brtrue/brfalse directly and avoid compares to null.
24252 2002-08-02 Martin Baulig <martin@gnome.org>
24254 * class.cs (TypeContainer.Define): Define all nested interfaces here.
24255 Fixes bug #28407, added test-155.cs.
24257 2002-08-01 Martin Baulig <martin@gnome.org>
24259 * class.cs (Event.EmitDefaultMethod): Make this work with static
24260 events. Fixes #28311, added verify-3.cs.
24262 2002-08-01 Martin Baulig <martin@gnome.org>
24264 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
24265 `is_disposable' fields.
24266 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
24267 `hm.is_disposable' if we're using the collection pattern.
24268 (Foreach.EmitCollectionForeach): Use the correct type for the
24269 enumerator's local variable, only emit the try/finally block if
24270 necessary (fixes #27713).
24272 2002-08-01 Martin Baulig <martin@gnome.org>
24274 * ecore.cs (Expression.report118): Renamed to Error118 and made
24277 * statement.cs (Throw.Resolve): Check whether the expression is of
24278 the correct type (CS0118) and whether the type derives from
24279 System.Exception (CS0155).
24280 (Catch.Resolve): New method. Do the type lookup here and check
24281 whether it derives from System.Exception (CS0155).
24282 (Catch.CatchType, Catch.IsGeneral): New public properties.
24284 * typemanager.cs (TypeManager.exception_type): Added.
24286 2002-07-31 Miguel de Icaza <miguel@ximian.com>
24288 * driver.cs: Updated About function.
24290 2002-07-31 Martin Baulig <martin@gnome.org>
24292 Implemented Control Flow Analysis.
24294 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
24295 (EmitContext.CurrentBranching): Added.
24296 (EmitContext.StartFlowBranching): Added.
24297 (EmitContext.EndFlowBranching): Added.
24298 (EmitContext.KillFlowBranching): Added.
24299 (EmitContext.IsVariableAssigned): Added.
24300 (EmitContext.SetVariableAssigned): Added.
24301 (EmitContext.IsParameterAssigned): Added.
24302 (EmitContext.SetParameterAssigned): Added.
24303 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
24304 Added control flow analysis stuff here.
24306 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
24307 resolve the expression as lvalue.
24308 (LocalVariableReference.DoResolve): Check whether the variable has
24309 already been assigned.
24310 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
24311 the parameter as assigned here.
24312 (ParameterReference.DoResolve): Check whether the parameter has already
24314 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
24315 expression as lvalue.
24317 * statement.cs (FlowBranching): New class for the flow analysis code.
24318 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
24319 (LabeledStatement.IsDefined): New public property.
24320 (LabeledStatement.AddUsageVector): New public method to tell flow
24321 analyis that the label may be reached via a forward jump.
24322 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
24324 (VariableInfo.Number): New public field. This is used by flow analysis
24325 to number all locals of a block.
24326 (Block.CountVariables): New public property. This is the number of
24327 local variables in this block (including the locals from all parent
24329 (Block.EmitMeta): Number all the variables.
24331 * statement.cs: Added flow analysis support to all classes.
24333 2002-07-31 Martin Baulig <martin@gnome.org>
24335 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
24336 To get debugging messages, compile mcs with /define:MCS_DEBUG and
24337 then use this argument.
24339 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
24341 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
24342 use this to specify /define options.
24344 2002-07-29 Martin Baulig <martin@gnome.org>
24346 * statement.cs (Fixed): Moved all code that does variable lookups
24347 and resolvings from Emit to Resolve.
24349 * statement.cs (For): Moved all code that does variable lookups
24350 and resolvings from Emit to Resolve.
24352 * statement.cs (Using): Moved all code that does variable lookups
24353 and resolvings from Emit to Resolve.
24355 2002-07-29 Martin Baulig <martin@gnome.org>
24357 * attribute.cs (Attribute.Resolve): Explicitly catch a
24358 System.NullReferenceException when creating the
24359 CustromAttributeBuilder and report a different warning message.
24361 2002-07-29 Martin Baulig <martin@gnome.org>
24363 * support.cs (ParameterData.ParameterName): Added method to
24364 get the name of a parameter.
24366 * typemanager.cs (TypeManager.IsValueType): New public method.
24368 2002-07-29 Martin Baulig <martin@gnome.org>
24370 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
24371 is a flag which specifies that it's either ref or out.
24372 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
24373 the out parameter to `out Parameter.Modifier mod', also set the
24374 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
24376 * support.cs (InternalParameters.ParameterModifier): Distinguish
24377 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24378 Parameter.Modifier.ISBYREF flag if it's either ref or out.
24380 * expression.cs (Argument.GetParameterModifier): Distinguish
24381 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24382 Parameter.Modifier.ISBYREF flag if it's either ref or out.
24384 2002-07-29 Martin Baulig <martin@gnome.org>
24386 * expression.cs (ParameterReference.ParameterReference): Added
24387 `Location loc' argument to the constructor.
24389 * cs-parser.jay: Pass location to ParameterReference.
24391 2002-07-28 Miguel de Icaza <miguel@ximian.com>
24393 * statement.cs (Try): Initialize the location.
24395 * cs-parser.jay: pass location to Try.
24397 * expression.cs (Unary.Reduce): Change the prototype to return
24398 whether a constant fold could be performed or not. The result is
24399 returned in an out parameters. In the case of Indirection and
24400 AddressOf, we want to perform the full tests.
24402 2002-07-26 Miguel de Icaza <miguel@ximian.com>
24404 * statement.cs (Statement.Emit): Flag dead code.
24406 2002-07-27 Andrew Birkett <andy@nobugs.org>
24408 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24410 2002-07-27 Martin Baulig <martin@gnome.org>
24412 * class.cs (MethodData.Define): Put back call to
24413 TypeManager.AddMethod(), accidentally commented this out.
24415 * report.cs (Debug): New public method to print debugging information,
24416 this is `[Conditional ("DEBUG")]'.
24418 2002-07-26 Martin Baulig <martin@gnome.org>
24420 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24421 (switch_statement): Push the current_block to the switch_stack and
24422 pop it again when we're done with the switch.
24423 (switch_section): The new block is a child of the current_block.
24424 Fixes bug #24007, added test-152.cs.
24426 2002-07-27 Martin Baulig <martin@gnome.org>
24428 * expression.cs (Invocation.EmitArguments): When calling a varargs
24429 function with only its fixed arguments, we need to pass an empty
24432 2002-07-27 Martin Baulig <martin@gnome.org>
24434 Mono 0.13 has been released.
24436 2002-07-25 Miguel de Icaza <miguel@ximian.com>
24438 * driver.cs: Rename --resource to --linkres, because that is what
24439 we do currently, we dont support --resource yet.
24441 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24443 2002-07-25 Martin Baulig <martin@gnome.org>
24445 * class.cs (MethodData): New public class. This is a `method builder'
24446 class for a method or one accessor of a Property/Indexer/Event.
24447 (MethodData.GetMethodFlags): Moved here from MemberBase.
24448 (MethodData.ApplyAttributes): Likewise.
24449 (MethodData.ApplyObsoleteAttribute): Likewise.
24450 (MethodData.ApplyConditionalAttribute): Likewise.
24451 (MethodData.ApplyDllImportAttribute): Likewise.
24452 (MethodData.CheckAbstractAndExternal): Likewise.
24453 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24454 (MethodData.Emit): Formerly known as Method.Emit().
24455 (MemberBase): Moved everything which was specific to a single
24456 accessor/method to MethodData.
24457 (Method): Create a new MethodData and call Define() and Emit() on it.
24458 (Property, Indexer, Event): Create a new MethodData objects for each
24459 accessor and call Define() and Emit() on them.
24461 2002-07-25 Martin Baulig <martin@gnome.org>
24463 Made MethodCore derive from MemberBase to reuse the code from there.
24464 MemberBase now also checks for attributes.
24466 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24467 (MemberBase.GetMethodFlags): Moved here from class Method and marked
24469 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24470 `CallingConventions cc' and `Attributes opt_attrs' arguments.
24471 (MemberBase.ApplyAttributes): New virtual method; applies the
24472 attributes to a method or accessor.
24473 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24474 (MemberBase.ApplyConditionalAttribute): Likewise.
24475 (MemberBase.ApplyDllImportAttribute): Likewise.
24476 (MemberBase.CheckAbstractAndExternal): Likewise.
24477 (MethodCore.ParameterTypes): This is now a property instead of a
24478 method, it's initialized from DoDefineParameters().
24479 (MethodCore.ParameterInfo): Removed the set accessor.
24480 (MethodCore.DoDefineParameters): New protected virtual method to
24481 initialize ParameterTypes and ParameterInfo.
24482 (Method.GetReturnType): We can now simply return the MemberType.
24483 (Method.GetMethodFlags): Override the MemberBase version and add
24484 the conditional flags.
24485 (Method.CheckBase): Moved some code from Define() here, call
24486 DoDefineParameters() here.
24487 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24488 here to avoid some larger code duplication.
24489 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24490 ensure that abstract and external accessors don't declare a body.
24492 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24493 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24494 lookup in the attribute's parent classes, so we need to abort as soon
24495 as we found the first match.
24496 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24497 the attribute has no arguments.
24499 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24502 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24504 * cs-parser.jay: reverted previous patch.
24506 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24508 * cs-parser.jay: fixed bug #22119.
24510 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24512 * attribute.cs: fixed compilation. The error was:
24513 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
24514 be assigned to before control leaves the current method."
24515 [FIXME: Filed as bug #28186: MCS must report this error.]
24517 2002-07-25 Martin Baulig <martin@gnome.org>
24519 * attribute.cs (Attribute.Conditional_GetConditionName): New static
24520 method to pull the condition name ouf of a Conditional attribute.
24521 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24522 the obsolete message and error flag out of an Obsolete attribute.
24524 * class.cs (Method.GetMethodFlags): New public method to get the
24525 TypeManager.MethodFlags for this method.
24526 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24528 (Method.Define): Get and apply the Obsolete and Conditional attributes;
24529 if we're overriding a virtual function, set the new private variable
24530 `parent_method'; call the new TypeManager.AddMethod().
24532 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
24533 the MethodBuilder and the Method in a PtrHashtable.
24534 (TypeManager.builder_to_method): Added for this purpose.
24535 (TypeManager.MethodFlags): Added IsObsoleteError.
24536 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
24537 Obsolete and Conditional arguments in MethodBuilders. If we discover
24538 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24539 the message from the attribute.
24541 2002-07-24 Martin Baulig <martin@gnome.org>
24543 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24544 preprocessor directives, ensure that the argument to #define/#undef is
24545 exactly one identifier and that it's actually an identifier.
24547 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24550 2002-07-24 Martin Baulig <martin@gnome.org>
24552 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24553 initialize it to TypeManager.object_type in the constructor.
24554 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24555 of the `hm.get_current' method if we're using the collection pattern.
24556 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24557 for the explicit conversion to make it work when we're using the collection
24558 pattern and the `Current' property has a different return type than `object'.
24561 2002-07-24 Martin Baulig <martin@gnome.org>
24563 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24564 does not match, but don't report any errors. This method is called in
24565 order for all methods in a MethodGroupExpr until a matching method is
24566 found, so we don't want to bail out if the first method doesn't match.
24567 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24568 matches, report the 123. Fixes #28070.
24570 2002-07-24 Martin Baulig <martin@gnome.org>
24572 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24573 TypeManager.TypeToCoreType() to the top of the method so the
24574 following equality checks will work. Fixes #28107.
24576 2002-07-24 Martin Baulig <martin@gnome.org>
24578 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24579 operand is of type uint, and the other operand is of type sbyte,
24580 short or int, the operands are converted to type long." -
24581 Actually do what this comment already told us. Fixes bug #28106,
24584 2002-07-24 Martin Baulig <martin@gnome.org>
24586 * class.cs (MethodBase): New abstract class. This is now a base
24587 class for Property, Indexer and Event to avoid some code duplication
24588 in their Define() and DefineMethods() methods.
24589 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24590 generic methods for Define() and DefineMethods().
24591 (FieldBase): Derive from MemberBase, not MemberCore.
24592 (Property): Derive from MemberBase, not MemberCore.
24593 (Property.DefineMethod): Moved all the code from this method to the
24594 new MethodBase.DefineAccessor(), just call it with appropriate
24596 (Property.Define): Call the new Property.DoDefine(), this does some
24597 sanity checks and we don't need to duplicate the code everywhere.
24598 (Event): Derive from MemberBase, not MemberCore.
24599 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24600 accessors, this will also make them work with interface events.
24601 (Indexer): Derive from MemberBase, not MemberCore.
24602 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24603 (Indexer.Define): Use the new MethodBase functions.
24605 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24606 argument to the constructor.
24607 (Interface.FindMembers): Added support for interface events.
24608 (Interface.PopluateEvent): Implemented.
24610 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
24612 2002-07-22 Miguel de Icaza <miguel@ximian.com>
24614 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24615 but this is required to check for a method name being the same as
24616 the containing class.
24620 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24622 * interface.cs: initialize variable.
24624 2002-07-23 Martin Baulig <martin@gnome.org>
24626 Implemented the IndexerName attribute in interfaces.
24628 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24629 name if this is an explicit interface implementation.
24630 (Indexer.InterfaceIndexerName): New public variable. If we're
24631 implementing an interface indexer, this is the IndexerName in that
24632 interface. Otherwise, it's the IndexerName.
24633 (Indexer.DefineMethod): If we're implementing interface indexer,
24634 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
24635 and Pending.ImplementIndexer methods.
24636 (Indexer.Define): Also define the PropertyBuilder if we're
24637 implementing an interface indexer and this is neither an explicit
24638 interface implementation nor do the IndexerName match the one in
24641 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24642 If a method is defined here, then we always need to create a proxy
24643 for it. This is used when implementing interface indexers.
24644 (Pending.IsInterfaceIndexer): New public method.
24645 (Pending.ImplementIndexer): New public method.
24646 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24647 This is used when implementing interface indexers to define a proxy
24649 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24650 define a proxy if necessary.
24652 * interface.cs (Interface.IndexerName): New public variable.
24653 (Interface.PopulateIndexer): Set the IndexerName.
24654 (Interface.DefineIndexers): New private method. Populate all the
24655 indexers and make sure their IndexerNames match.
24657 * typemanager.cs (IndexerPropertyName): Added support for interface
24660 2002-07-22 Martin Baulig <martin@gnome.org>
24662 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24663 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24664 ret if HasReturnLabel.
24665 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24668 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24669 and set the ec.LoopBeginTryCatchLevel.
24670 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24671 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24672 the current ec.TryCatchLevel, the branch goes out of an exception
24673 block. In this case, we need to use Leave and not Br.
24675 2002-07-22 Martin Baulig <martin@gnome.org>
24677 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24678 block unless the block does not always return or it is contained in
24679 another try { ... } catch { ... } block. Fixes bug #26506.
24680 Added verify-1.cs to the test suite.
24682 2002-07-22 Martin Baulig <martin@gnome.org>
24684 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24685 then we do not always return. Fixes bug #24985.
24687 2002-07-22 Martin Baulig <martin@gnome.org>
24689 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24690 lookup on a per-class level; ie. walk up the class hierarchy until we
24691 found at least one applicable method, then choose the best among them.
24692 Fixes bug #24463 and test-29.cs.
24694 2002-07-22 Martin Baulig <martin@gnome.org>
24696 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24697 return types of the methods. The return type is not part of the
24698 signature and we must not check it to make the `new' modifier work.
24699 Fixes bug #27999, also added test-147.cs.
24700 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24702 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24703 on the method's return type.
24705 2002-07-21 Martin Baulig <martin@gnome.org>
24707 * assign.cs: Make this work if the rightmost source is a constant and
24708 we need to do an implicit type conversion. Also adding a few more tests
24709 to test-38.cs which should have caught this.
24711 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24712 target in the makefile for this. The makefile.gnu is primarily intended
24713 for end-users who don't want to debug the compiler.
24715 2002-07-21 Martin Baulig <martin@gnome.org>
24717 * assign.cs: Improved the Assign class so it can now handle embedded
24718 assignments (X = Y = Z = something). As a side-effect this'll now also
24719 consume less local variables. test-38.cs now passes with MCS, added
24720 a few new test cases to that test.
24722 2002-07-20 Martin Baulig <martin@gnome.org>
24724 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24725 instructions. Fixes bug #27977, also added test-146.cs.
24727 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24729 * cs-tokenizer.cs: fixed getHex ().
24731 2002-07-19 Martin Baulig <martin@gnome.org>
24733 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24734 not Type.GetType() to lookup the array type. This is needed when
24735 we're constructing an array of a user-defined type.
24736 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24737 single-dimensional arrays, but also for single-dimensial arrays of
24740 2002-07-19 Martin Baulig <martin@gnome.org>
24742 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24743 this function is called, it's not allowed to share LocalBuilders
24744 among ILGenerators.
24746 2002-07-19 Martin Baulig <martin@gnome.org>
24748 * expression.cs (Argument.Resolve): Report an error 118 when trying
24749 to pass a type as argument.
24751 2002-07-18 Martin Baulig <martin@gnome.org>
24753 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24754 Conv_R_Un for the signed `long' type.
24756 2002-07-15 Miguel de Icaza <miguel@ximian.com>
24758 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24759 `expr' for the temporary result, as that will fail if we do
24760 multiple resolves on the same expression.
24762 2002-07-05 Miguel de Icaza <miguel@ximian.com>
24764 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24765 ec.TypeContainer for looking up aliases.
24767 * class.cs (TypeContainer): Remove LookupAlias from here.
24769 * decl.cs (DeclSpace); Move here.
24771 2002-07-01 Miguel de Icaza <miguel@ximian.com>
24773 * class.cs (FindMembers): Only call filter if the constructor
24774 bulider is not null.
24776 Also handle delegates in `NestedTypes' now. Now we will perform
24777 type lookups using the standard resolution process. This also
24780 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24781 This uses Expressions (the limited kind that can be parsed by the
24782 tree) instead of strings.
24784 * expression.cs (ComposedCast.ToString): Implement, used to flag
24785 errors since now we have to render expressions.
24787 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
24790 * ecore.cs (SimpleName.ToString): ditto.
24792 * cs-parser.jay: Instead of using strings to assemble types, use
24793 Expressions to assemble the type (using SimpleName, ComposedCast,
24794 MemberAccess). This should fix the type lookups in declarations,
24795 because we were using a different code path for this.
24797 * statement.cs (Block.Resolve): Continue processing statements
24798 even when there is an error.
24800 2002-07-17 Miguel de Icaza <miguel@ximian.com>
24802 * class.cs (Event.Define): Also remove the `remove' method from
24803 the list of pending items.
24805 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24806 generate more compact code.
24808 2002-07-17 Martin Baulig <martin@gnome.org>
24810 * const.cs (Const.LookupConstantValue): Add support for constant
24811 `unchecked' and `checked' expressions.
24812 Also adding test case test-140.cs for this.
24814 2002-07-17 Martin Baulig <martin@gnome.org>
24816 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24817 check whether mi.ReturnType implements the IEnumerator interface; the
24818 `==' and the IsAssignableFrom() will fail in this situation.
24820 2002-07-16 Ravi Pratap <ravi@ximian.com>
24822 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
24825 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24827 * expression.cs: fixed bug #27811.
24829 2002-07-14 Miguel de Icaza <miguel@ximian.com>
24831 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24832 Molaro: when we are a ref, the value already contains a pointer
24833 value, do not take the address of it.
24835 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24836 * removed mb-parser.jay and mb-tokenizer.cs
24838 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24840 * expression.cs: check against the building corlib void type.
24842 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24844 * ecore.cs: fix for valuetype static readonly fields: when
24845 initializing them, we need their address, not the address of a copy.
24847 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24849 * typemanager.cs: register also enum_type in corlib.
24851 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24853 * class.cs: allow calling this (but not base) initializers in structs.
24855 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24857 * ecore.cs: make sure we compare against the building base types
24860 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24862 * typemanager.cs: fix TypeToCoreType() to handle void and object
24863 (corlib gets no more typerefs after this change).
24865 2002-07-12 Miguel de Icaza <miguel@ximian.com>
24867 * expression.cs (ArrayCreation.EmitArrayArguments): use
24868 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24870 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24871 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
24872 array indexes, the runtime actually forbids them.
24874 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24875 for array arguments here.
24877 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24878 instead of the default for ValueTypes.
24880 (New.DoEmit): Use IsValueType instead of
24881 IsSubclassOf (value_type)
24882 (New.DoResolve): ditto.
24883 (Invocation.EmitCall): ditto.
24885 * assign.cs (Assign): ditto.
24887 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24888 Statements *are* currently doing part of their resolution during
24891 Expressions do always resolve during resolve, but statements are
24892 only required to propagate resolution to their children.
24894 2002-07-11 Miguel de Icaza <miguel@ximian.com>
24896 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24898 (LoadAssembly): Do not add the dll if it is already specified
24900 (MainDriver): Add the System directory to the link path at the end,
24901 after all the other -L arguments.
24903 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24904 wrong opcode for loading bytes and bools (ldelem.i1 instead of
24905 ldelem.u1) and using the opposite for sbytes.
24907 This fixes Digger, and we can finally run it.
24909 * driver.cs (UnixParseOption): Move the option parsing here.
24910 (CSCParseOption): Implement CSC-like parsing of options.
24912 We now support both modes of operation, the old Unix way, and the
24913 new CSC-like way. This should help those who wanted to make cross
24914 platform makefiles.
24916 The only thing broken is that /r:, /reference: and /lib: are not
24917 implemented, because I want to make those have the same semantics
24918 as the CSC compiler has, and kill once and for all the confussion
24919 around this. Will be doing this tomorrow.
24921 * statement.cs (Unsafe.Resolve): The state is checked during
24922 resolve, not emit, so we have to set the flags for IsUnsfe here.
24924 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24926 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24927 not catch the Error_ObjectRefRequired in SimpleName (as it is
24928 possible to have a class/instance variable name that later gets
24929 deambiguated), we have to check this here.
24931 2002-07-10 Ravi Pratap <ravi@ximian.com>
24933 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24934 make static and put into Expression.
24936 (Event.Define): Register the private field of the event with the
24937 TypeManager so that GetFieldFromEvent can get at it.
24939 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24940 keep track of the private field associated with an event which
24943 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24946 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24948 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24950 * expression.cs (Binary.EmitBranchable): this routine emits the
24951 Binary expression in a branchable context. This basically means:
24952 we need to branch somewhere, not just get the value on the stack.
24954 This works together with Statement.EmitBoolExpression.
24956 * statement.cs (Statement.EmitBoolExpression): Use
24959 2002-07-09 Miguel de Icaza <miguel@ximian.com>
24961 * statement.cs (For): Reduce the number of jumps in loops.
24963 (For): Implement loop inversion for the For statement.
24965 (Break): We can be breaking out of a Try/Catch controlled section
24966 (foreach might have an implicit try/catch clause), so we need to
24967 use Leave instead of Br.
24969 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24970 now). If the instace expression supports IMemoryLocation, we use
24971 the AddressOf method from the IMemoryLocation to extract the
24972 address instead of emitting the instance.
24974 This showed up with `This', as we were emitting the instance
24975 always (Emit) instead of the Address of This. Particularly
24976 interesting when This is a value type, as we dont want the Emit
24977 effect (which was to load the object).
24979 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24981 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24983 * statement.cs (Checked): Set the CheckedState during the resolve
24984 process too, as the ConvCast operations track the checked state on
24985 the resolve process, and not emit.
24987 * cs-parser.jay (namespace_member_declaration): Flag that we have
24988 found a declaration when we do. This is used to flag error 1529
24990 * driver.cs: Report ok when we display the help only.
24992 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24994 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24996 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24998 * cs-tokenizer.cs (define): We also have to track locally the
24999 defines. AllDefines is just used for the Conditional Attribute,
25000 but we also need the local defines for the current source code.
25002 2002-07-03 Miguel de Icaza <miguel@ximian.com>
25004 * statement.cs (While, For, Do): These loops can exit through a
25005 Break statement, use this information to tell whether the
25006 statement is the last piece of code.
25008 (Break): Flag that we break.
25010 * codegen.cs (EmitContexts): New `Breaks' state variable.
25012 2002-07-03 Martin Baulig <martin@gnome.org>
25014 * class.cs (TypeContainer.MethodModifiersValid): Allow override
25015 modifiers in method declarations in structs. Otherwise, you won't
25016 be able to override things like Object.Equals().
25018 2002-07-02 Miguel de Icaza <miguel@ximian.com>
25020 * class.cs (Method, Property, Indexer): Do not allow the public
25021 modifier to be used in explicit interface implementations.
25023 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
25024 override modifiers in method declarations in structs
25026 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
25028 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
25029 integer or real overflow, report an error
25031 2002-07-02 Martin Baulig <martin@gnome.org>
25033 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
25034 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
25035 to tell the runtime about our newly created System.Object and
25036 System.ValueType types.
25038 2002-07-02 Miguel de Icaza <miguel@ximian.com>
25040 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
25041 struct instead of Ldarg/Starg.
25043 2002-07-02 Martin Baulig <martin@gnome.org>
25045 * expression.cs (Indirection.Indirection): Call
25046 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
25048 2002-07-02 Martin Baulig <martin@gnome.org>
25050 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
25051 ValueType, call TypeManager.TypeToCoreType() on it.
25052 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
25053 the OpCodes.Newarr argument.
25055 2002-07-02 Martin Baulig <martin@gnome.org>
25057 * expression.cs (Invocation.EmitCall): When compiling corlib,
25058 replace all calls to the system's System.Array type to calls to
25059 the newly created one.
25061 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
25062 System.Array methods.
25063 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
25064 from the system's System.Array type which must be replaced.
25066 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
25068 * typemanager.cs: load unverifiable_code_ctor so we can build
25069 corlib using the correct type. Avoid using GetTypeCode() with
25071 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
25072 TypeManager.object_type to allow building corlib.
25074 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25076 * ecore.cs: handle System.Enum separately in LoadFromPtr().
25078 2002-07-01 Martin Baulig <martin@gnome.org>
25080 * class.cs: Make the last change actually work, we need to check
25081 whether `ifaces != null' to avoid a crash.
25083 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25085 * class.cs: when we build structs without fields that implement
25086 interfaces, we need to add the interfaces separately, since there is
25087 no API to both set the size and add the interfaces at type creation
25090 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25092 * expression.cs: the dimension arguments to the array constructors
25093 need to be converted if they are a long.
25095 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
25097 * class.cs: don't emit ldarg.0 if there is no parent constructor
25098 (fixes showstopper for corlib).
25100 2002-06-29 Martin Baulig <martin@gnome.org>
25102 MCS now compiles corlib on GNU/Linux :-)
25104 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
25105 ie. check for MethodImplOptions.InternalCall.
25107 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
25108 and TypeManager.attribute_type are null, so we must explicitly check
25109 whether parent is not null to find out whether it's an attribute type.
25110 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
25111 and SetBuilder, not only if the property is neither abstract nor external.
25112 This is necessary to set the MethodImplOptions on the accessor methods.
25113 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
25114 SetBuilder, see Property.Emit().
25116 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
25117 populate "System.Object", "System.ValueType" and "System.Attribute" since
25118 they've already been populated from BootCorlib_PopulateCoreTypes().
25120 2002-06-29 Martin Baulig <martin@gnome.org>
25122 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
25123 is the NullLiteral, we also need to make sure that target_type is not
25126 2002-06-29 Martin Baulig <martin@gnome.org>
25128 * rootcontext.cs (RootContext.ResolveCore): We must initialize
25129 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
25130 before calling BootstrapCorlib_ResolveDelegate ().
25132 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25134 * statement.cs: fixed build-breaker. All tests passed ok.
25136 2002-06-27 Martin Baulig <martin@gnome.org>
25138 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
25139 for System.Decimal when compiling corlib.
25141 2002-06-27 Martin Baulig <martin@gnome.org>
25143 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
25144 switch blocks which contain nothing but a default clause.
25146 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
25148 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
25150 2002-06-27 Martin Baulig <martin@gnome.org>
25152 * ecore.cs (PropertyExpr.PropertyExpr): Call
25153 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
25155 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
25156 is already a TypeBuilder.
25158 2002-06-27 Martin Baulig <martin@gnome.org>
25160 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
25161 `target_type == TypeManager.array_type', not IsAssignableFrom() in
25162 the "from an array-type to System.Array" case. This makes it work
25163 when compiling corlib.
25165 2002-06-27 Martin Baulig <martin@gnome.org>
25167 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
25168 non-static PropertyExpr, set its InstanceExpression. This makes
25169 the `ICollection.Count' property work in System/Array.cs.
25171 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
25173 * driver.cs: Made error handling more consistent. Errors now
25174 tracked by Report class, so many methods which used to return int
25175 now return void. Main() now prints success/failure and
25176 errors/warnings message.
25178 Renamed '--probe' compiler argument to '--expect-error'. Removed
25179 the magic number return values (123 and 124). Now, if the
25180 expected error occurs, the compiler exits with success (exit value
25181 0). If the compilation completes without seeing that particular
25182 error, the compiler exits with failure (exit value 1). The
25183 makefile in mcs/errors has been changed to handle the new behaviour.
25185 * report.cs: Made 'expected error' number a property and renamed
25186 it from 'Probe' to 'ExpectedError'.
25188 * genericparser.cs: Removed error handling support, since it is
25189 now all done by Report class.
25191 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
25192 class, so parse() no longer returns an int.
25194 * namespace.cs: Use Report.Error instead of GenericParser.error
25196 2002-06-22 Miguel de Icaza <miguel@ximian.com>
25198 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
25199 TypeContainer.AddOperator): At the front of the list put the
25200 explicit implementations, so they get resolved/defined first.
25202 2002-06-21 Miguel de Icaza <miguel@ximian.com>
25204 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
25205 interface type is implemented by this TypeContainer. Used during
25206 explicit interface implementation.
25208 (Property.Define, Indexer.Define, Method.Define): Validate that
25209 the given interface in the explicit implementation is one of the
25210 base classes for the containing type.
25212 Also if we are explicitly implementing an interface, but there is
25213 no match in the pending implementation table, report an error.
25215 (Property.Define): Only define the property if we are
25216 not explicitly implementing a property from an interface. Use the
25217 correct name also for those properties (the same CSC uses,
25218 although that is really not needed).
25220 (Property.Emit): Do not emit attributes for explicitly implemented
25221 properties, as there is no TypeBuilder.
25223 (Indexer.Emit): ditto.
25225 Hiding then means that we do not really *implement* a pending
25226 implementation, which makes code fail.
25228 2002-06-22 Martin Baulig <martin@gnome.org>
25230 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
25231 the return value of Object.GetType(). [FIXME: we need to do this whenever
25232 we get a type back from the reflection library].
25234 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25236 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
25238 2002-06-20 Miguel de Icaza <miguel@ximian.com>
25240 * attribute.cs: Return null if we can not look up the type.
25242 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
25243 the interface types found.
25245 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
25246 interface types found.
25248 * typemanager.cs (GetInterfaces): Make this routine returns alll
25249 the interfaces and work around the lame differences between
25250 System.Type and System.Reflection.Emit.TypeBuilder in the results
25251 result for GetInterfaces.
25253 (ExpandInterfaces): Given an array of interface types, expand and
25254 eliminate repeated ocurrences of an interface. This expands in
25255 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
25258 2002-06-21 Martin Baulig <martin@gnome.org>
25260 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
25263 2002-06-21 Martin Baulig <martin@gnome.org>
25265 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
25266 and called with one of the core types, return the corresponding typebuilder for
25269 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
25272 2002-06-21 Martin Baulig <martin@gnome.org>
25274 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
25275 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
25276 (Expression.ConvertReferenceExplicit): Likewise.
25278 * expression.cs (ElementAccess.DoResolve): Likewise.
25279 (ElementAccess.DoResolveLValue): Likewise.
25281 2002-06-10 Martin Baulig <martin@gnome.org>
25283 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
25284 add the "value" parameter to the parameter list.
25286 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
25289 2002-06-19 Miguel de Icaza <miguel@ximian.com>
25291 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
25292 the argument to an int, uint, long or ulong, per the spec. Also
25293 catch negative constants in array creation.
25295 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
25297 * class.cs: do not allow the same interface to appear twice in
25298 the definition list.
25300 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
25302 * ecore.cs: don't use ldlen with System.Array.
25304 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25306 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
25308 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25310 * modifiers.cs: produce correct field attributes for protected
25311 internal. Easy fix so miguel can work on ther harder stuff:-)
25313 2002-06-18 Miguel de Icaza <miguel@ximian.com>
25315 * pending.cs: New file. Move the code from class.cs here.
25316 Support clearning the pending flag for all methods (when not doing
25317 explicit interface implementation).
25319 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25321 * rootcontext.cs: added a couple more types needed to bootstrap.
25323 2002-06-17 Miguel de Icaza <miguel@ximian.com>
25325 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
25326 constructor in the type, instead of any constructor in the type
25327 hierarchy. Thanks to Paolo for finding this bug (it showed up as
25328 a bug in the Mono runtime when applying the params attribute).
25330 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
25331 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
25333 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
25335 * expression.cs (Unary.ResolveOperator): Use TypeManager
25336 to resolve the type.
25338 2002-06-13 Ravi Pratap <ravi@ximian.com>
25340 * cs-parser.jay (enum_member_declaration): Pass in the attributes
25343 * enum.cs (AddEnumMember): Add support to store the attributes associated
25344 with each member too.
25346 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
25347 field builders too - this takes care of the enum member case.
25349 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
25351 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
25352 address-of operator on both value types and pointers.
25354 2002-06-10 Martin Baulig <martin@gnome.org>
25356 * interface.cs (Interface.PopulateIndexer): Add the indexer's
25357 PropertyBuilder to the `property_builders' list.
25359 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
25360 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
25361 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
25362 find any indexers which are inherited from an interface.
25364 2002-06-09 Martin Baulig <martin@gnome.org>
25366 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
25367 the same type as the constant if necessary. There's also a test-130.cs
25370 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
25372 * typemanager.cs (TypeManager.ChangeType): Previously known as
25373 Enum.ChangeEnumType().
25375 2002-06-09 Martin Baulig <martin@gnome.org>
25377 * expression.cs (Cast.TryReduce): Added support for consts.
25379 2002-06-08 Ravi Pratap <ravi@ximian.com>
25381 * class.cs (Accessor): Hold attributes information so we can pass
25384 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
25385 Modify to pass in attributes attached to the methods.
25387 (add_accessor_declaration, remove_accessor_declaration): Ditto.
25389 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
25390 to handle the Accessor kind :-)
25392 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
25394 2002-06-08 Martin Baulig <martin@gnome.org>
25396 * expression.cs (Unary.TryReduceNegative): Added support for
25399 2002-06-08 Martin Baulig <martin@gnome.org>
25401 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25402 name can't be found in the `defined_names' - the caller will do a
25403 MemberLookup in this case and thus find methods in System.Enum
25404 such as Enum.IsDefined().
25406 2002-06-08 Martin Baulig <martin@gnome.org>
25408 * enum.cs (Enum.ChangeEnumType): This is a custom version of
25409 Convert.ChangeType() which works with TypeBuilder created types.
25410 (Enum.LookupEnumValue, Enum.Define): Use it here.
25412 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25413 `TypeBuilder.BaseType != null' check.
25414 (TypeContainer.FindMembers): Only lookup parent members if we
25415 actually have a parent.
25416 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25417 (ConstructorInitializer.Resolve): Likewise.
25419 * interface.cs (Interface.FindMembers): Added
25420 `TypeBuilder.BaseType != null' check.
25422 * rootcontext.cs (RootContext.ResolveCore): Added
25423 "System.Runtime.CompilerServices.IndexerNameAttribute" to
25424 classes_second_stage.
25426 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25427 debug_type and trace_type when compiling with --nostdlib.
25429 2002-06-07 Martin Baulig <martin@gnome.org>
25431 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25432 (AddField): Set it to true when adding a non-static field.
25433 (DefineType): Use `have_nonstatic_fields' to find out whether we
25434 have non-static fields, not `Fields != null'.
25436 2002-06-02 Miguel de Icaza <miguel@ximian.com>
25438 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25439 dereferencing a null on the static-field code path)
25441 2002-05-30 Martin Baulig <martin@gnome.org>
25443 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25444 to take command line arguments. Use reflection to call the new
25445 custom `Initialize' function on the symbol writer and pass it the
25446 command line arguments.
25448 * driver.cs (--debug-args): New command line argument to pass command
25449 line arguments to the symbol writer.
25451 2002-05-28 Miguel de Icaza <miguel@ximian.com>
25453 * assign.cs (DoResolve): Forgot to do the implicit conversion to
25454 the target type for indexers and properties. Thanks to Joe for
25457 2002-05-27 Miguel de Icaza <miguel@ximian.com>
25459 * typemanager.cs (MethodFlags): returns the method flags
25460 (Obsolete/ShouldIgnore) that control warning emission and whether
25461 the invocation should be made, or ignored.
25463 * expression.cs (Invocation.Emit): Remove previous hack, we should
25464 not do this on matching a base type, we should do this based on an attribute
25466 Only emit calls to System.Diagnostics.Debug and
25467 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25468 on the command line.
25470 * rootcontext.cs: Global settings for tracing and debugging.
25472 * cs-tokenizer.cs (define): New utility function to track
25473 defines. Set the global settings for TRACE and DEBUG if found.
25475 2002-05-25 Ravi Pratap <ravi@ximian.com>
25477 * interface.cs (Populate*): Pass in the TypeContainer as well as
25478 the DeclSpace as parameters so that we can create EmitContexts and
25479 then use that to apply attributes etc.
25481 (PopulateMethod, PopulateEvent, PopulateProperty)
25482 (PopulateIndexer): Apply attributes everywhere.
25484 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25487 (ApplyAttributes): Update accordingly.
25489 We now apply interface attributes for all members too.
25491 2002-05-26 Miguel de Icaza <miguel@ximian.com>
25493 * class.cs (Indexer.Define); Correctly check if we are explicit
25494 implementation (instead of checking the Name for a ".", we
25495 directly look up if the InterfaceType was specified).
25497 Delay the creation of the PropertyBuilder.
25499 Only create the PropertyBuilder if we are not an explicit
25500 interface implementation. This means that explicit interface
25501 implementation members do not participate in regular function
25502 lookups, and hence fixes another major ambiguity problem in
25503 overload resolution (that was the visible effect).
25505 (DefineMethod): Return whether we are doing an interface
25508 * typemanager.cs: Temporary hack until we get attributes in
25509 interfaces (Ravi is working on that) and we get IndexerName
25510 support in interfaces.
25512 * interface.cs: Register the indexers as properties.
25514 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25515 warning, I have verified that this is a bug in the .NET runtime
25516 (JavaScript suffers of the same problem).
25518 * typemanager.cs (MemberLookup): When looking up members for
25519 interfaces, the parent of an interface is the implicit
25520 System.Object (so we succeed in searches of Object methods in an
25521 interface method invocation. Example: IEnumerable x; x.ToString
25524 2002-05-25 Miguel de Icaza <miguel@ximian.com>
25526 * class.cs (Event): Events should also register if they do
25527 implement the methods that an interface requires.
25529 * typemanager.cs (MemberLookup); use the new GetInterfaces
25532 (GetInterfaces): The code used to lookup interfaces for a type is
25533 used in more than one place, factor it here.
25535 * driver.cs: Track the errors at the bottom of the file, we kept
25538 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25539 instance if the method we are calling is static!
25541 2002-05-24 Miguel de Icaza <miguel@ximian.com>
25543 * attribute.cs (ApplyAttributes): Make this function filter out
25544 the IndexerName attribute (as that attribute in reality is never
25545 applied) and return the string constant for the IndexerName
25548 * class.cs (TypeContainer.Emit): Validate that all the indexers
25549 have the same IndexerName attribute, and if so, set the
25550 DefaultName attribute on the class.
25552 * typemanager.cs: The return value might contain other stuff (not
25553 only methods). For instance, consider a method with an "Item"
25554 property and an Item method.
25556 * class.cs: If there is a problem with the parameter types,
25559 2002-05-24 Ravi Pratap <ravi@ximian.com>
25561 * ecore.cs (ImplicitConversionExists): Wrapper function which also
25562 looks at user defined conversion after making a call to
25563 StandardConversionExists - we need this for overload resolution.
25565 * expression.cs : Update accordingly the various method calls.
25567 This fixes 2 bugs filed against implicit user defined conversions
25569 2002-05-22 Miguel de Icaza <miguel@ximian.com>
25571 * statement.cs: Track the result of the assignment.
25573 2002-05-21 Miguel de Icaza <miguel@ximian.com>
25575 * expression.cs (MemberAccess): Improved error reporting for
25576 inaccessible members.
25578 2002-05-22 Martin Baulig <martin@gnome.org>
25580 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
25581 itself with debugging support.
25583 2002-05-22 Martin Baulig <martin@gnome.org>
25585 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25586 Removed, this isn't needed anymore.
25588 2002-05-20 Martin Baulig <martin@gnome.org>
25590 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25591 be underlying type for an enum.
25593 2002-05-20 Miguel de Icaza <miguel@ximian.com>
25595 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25596 that splits out the loading of just the core types.
25598 * rootcontext.cs (ResolveCore): Split the struct resolution in
25599 two, so we can load the enumeration underlying types before any
25602 * expression.cs (Is): Bandaid until we fix properly Switch (see
25603 bug #24985 for details).
25605 * typemanager.cs (ImplementsInterface): The hashtable will contain
25606 a null if there are no interfaces implemented.
25608 2002-05-18 Miguel de Icaza <miguel@ximian.com>
25610 * cs-parser.jay (indexer_declarator): It is fine to have array
25613 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25615 * typemanager.cs: (RegisterBuilder): New function used to register
25616 TypeBuilders that implement interfaces. Since
25617 TypeBuilder.GetInterfaces (as usual) does not work with lame
25619 (AddUserType): register interfaces.
25621 (ImplementsInterface): Use the builder_to_ifaces hash if we are
25622 dealing with TypeBuilder. Also, arrays are showing up as
25623 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25624 methods can not be invoked on them!
25626 * ecore.cs (ExplicitReferenceConversionExists): Made public.
25627 (ImplicitReferenceConversionExists): Split out from
25628 StandardConversionExists.
25630 * expression.cs (As): We were only implementing one of the three
25631 cases for the as operator. We now implement them all.
25632 (Is): Implement the various other cases for Is as well.
25634 * typemanager.cs (CACHE): New define used to control if we want or
25635 not the FindMembers cache. Seems to have a negative impact on
25636 performance currently
25638 (MemberLookup): Nested types have full acess to
25639 enclosing type members
25641 Remove code that coped with instance/static returns for events, we
25642 now catch this in RealFindMembers.
25644 (RealFindMembers): only perform static lookup if the instance
25645 lookup did not return a type or an event.
25647 2002-05-17 Miguel de Icaza <miguel@ximian.com>
25649 * assign.cs (CompoundAssign): We pass more semantic information
25650 now to Compound Assignments than we did before: now we have all
25651 the information at hand, and now we resolve the target *before* we
25652 do the expression expansion, which allows the "CacheValue" method
25653 to have the effect we intended (before, a [x] += 1 would generate
25654 two differen ArrayAccess expressions from the ElementAccess,
25655 during the resolution process).
25657 (CompoundAssign.DoResolve): Resolve target and original_source here.
25659 2002-05-16 Miguel de Icaza <miguel@ximian.com>
25661 * expression.cs (ArrayAccess): dropped debugging information.
25663 * typemanager.cs: Small bug fix: I was always returning i_members,
25664 instead of one of i_members or s_members (depending on which had
25667 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
25668 method is invoked before any code generation takes place, and it
25669 is a mechanism to inform that the expression will be invoked more
25670 than once, and that the method should use temporary values to
25671 avoid having side effects
25673 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25675 * ecore.cs (Expression.CacheTemporaries): Provide empty default
25678 * expression.cs (Indirection, ArrayAccess): Add support for
25679 CacheTemporaries in these two bad boys.
25681 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25682 ldobj or ldind_ref.
25683 (StoreFromPtr): Handle stobj as well.
25685 * expression.cs (UnaryMutator): Share more code.
25687 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25688 down: I was not tracking the Filter function as well, which
25689 was affecting the results of the cache.
25691 2002-05-15 Miguel de Icaza <miguel@ximian.com>
25693 * attribute.cs: Remove the hack to handle the CharSet property on
25696 2002-05-14 Miguel de Icaza <miguel@ximian.com>
25698 * attribute.cs (DoResolve): More uglyness, we now only try to
25699 resolve the attribute partially, to extract the CharSet
25700 information (only if we are a StructLayout attribute). Otherwise
25702 (GetExtraTypeInfo): Add some code to conditionally kill in the
25703 future this. I am more and more convinced that the .NET
25704 framework has special code to handle the attribute setting on
25707 * expression.cs (IsParamsMethodApplicable): Revert my previous
25708 foreach change here, it was wrong.
25710 2002-05-13 Miguel de Icaza <miguel@ximian.com>
25712 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25713 (pp_expr): do not abort on unknown input, just return.
25714 (eval): abort if there are pending chars.
25716 * attribute.cs (Attribute.Resolve): Positional parameters are
25717 optional. Deal with that case.
25719 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25720 the Ansi/Unicode/Auto information for the type.
25722 (TypeContainer.DefineType): instantiate the EmitContext here, as
25723 we will be using it during the type definition (to resolve
25724 attributes) and during the emit phase.
25726 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25727 to pull type information out of the attributes
25729 (Attribute.Resolve): track the constructor builder, and allow for
25730 multiple invocations (structs and classes will use this).
25732 * ecore.cs (MemberLookupFinal): new version with all the
25733 parameters customizable.
25735 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25736 constructors. Return if the result value is null (as the error
25737 would have been flagged already by MemberLookupFinal)
25739 Do not allow instances of abstract classes or interfaces to be
25742 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25743 We have to compare the assembly property here when dealing with
25744 FamANDAssem and Assembly access modifiers, because we might be
25745 creating an assembly from *modules* (that means that we are not
25746 getting TypeBuilders for types defined in other modules that are
25747 part of this assembly).
25749 (Method.Emit): If the method is marked abstract and has a body,
25752 (TypeContainer.DefineMembers): If both the defined member and the
25753 parent name match are methods, then do not emit any warnings: let
25754 the Method.Define routine take care of flagging warnings. But if
25755 there is a mismatch (method overrides something else, or method is
25756 overriwritten by something, then emit warning).
25758 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25759 set to null, this means `do not check for the return type on the
25762 (Method.Define): set the return type for the method signature to
25763 null, so that we get methods with the same name and parameters and
25764 different return types. This is used to flag warning 114 (you are
25765 hiding a method, and you probably want to use the new/override
25768 * typemanager.cs (MemberLookup): Implemented proper access
25769 control, closing a long standing set of bug reports. The problem
25770 was that the Framework only has two bits: Public and NonPublic,
25771 and NonPublic includes private and protected methods, but we need
25772 to enforce the FamANDAssem, FamOrAssem and Family.
25774 2002-05-11 Miguel de Icaza <miguel@ximian.com>
25776 * statement.cs (GotoCase): Return true: Ammounts to giving up
25777 knowledge on whether we return or not, and letting the other case
25778 be responsible for it.
25780 2002-05-10 Miguel de Icaza <miguel@ximian.com>
25782 * driver.cs: Do not load directories for each file processed, only
25783 do it if there is a pattern.
25785 * ecore.cs: Report readonly assigns here as well, as we might have
25786 been resolved only by MemberAccess.
25788 (SimpleName.SimpleNameResolve): Also be useful for LValue
25789 resolution. We need this to propagate assign to local readonly variables
25791 * typemanager.cs: Use a ptrhashtable for the criteria, because we
25792 do not want to reuse potential criteria memory.
25794 * class.cs (MyEventBuilder): Set reflected_type;
25796 * ecore.cs (Constantify): Added support for constifying bools.
25798 (RootContext.LookupType): Added a cache for values looked up in
25799 the declaration space.
25801 * typemanager.cs (FindMembers): Now is a front-end to
25802 RealFindMembers, and provides a two-level hashtable-based cache to
25805 15% performance improvement: from 22.5 to 19.2 seconds.
25807 * expression.cs (IsParamsMethodApplicable): use foreach.
25808 (Invocation.DoResolve): ditto.
25809 (New.DoResolve): ditto.
25810 (ArrayCreation.DoResolve): ditto.
25812 * ecore.cs (FindMostEncompassingType): use foreach.
25814 * delegate.cs (NewDelegate.DoResolve): Use foreach
25816 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25817 (RemoveMethods): use foreach.
25819 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25820 nested foreach statements instead of for, and also break out of
25821 the inner loop once a match is found.
25823 (Invocation.OverloadResolve): Use foreach, simplify the code.
25825 2002-05-08 Miguel de Icaza <miguel@ximian.com>
25827 * cfold.cs (BinaryFold): During an enumeration evaluation context,
25828 we actually unwrap the expression to allow for extra information
25831 * expression.cs: Use Shr_Un on unsigned operations.
25833 2002-05-08 Ravi Pratap <ravi@ximian.com>
25835 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
25836 applicable operators was not being considered correctly. This closes
25837 the bug Miguel reported.
25839 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25841 * attribute.cs: check that the type derives from System.Attribute
25842 and report the correct error in that case (moved the duplicate code to
25843 its own method, too).
25845 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25847 * attribute.cs: lookup attribute type name as the spec says: first the
25848 bare attribute name and then name + "Attribute" (nant compiles with
25849 mcs after this fix).
25851 2002-05-07 Miguel de Icaza <miguel@ximian.com>
25853 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
25854 Because of the way we parse things, we should try to see if a
25855 UIntConstant can fit in an integer.
25857 2002-05-07 Ravi Pratap <ravi@ximian.com>
25859 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25860 when we are in an explicit context.
25862 (ConvertReferenceExplicit): When converting from Iface type S to Class
25863 T make sure the rules are implemented as an OR.
25865 * parameter.cs (ParameterType): Make it a property for now although the
25866 purpose really isn't anything immediate.
25868 * expression.cs (Is*Applicable): Do better checking on the parameter type
25869 of a ref/out parameter. The ones from the system assemblies are already
25870 marked with the correct type so we don't need to do any correction.
25872 * ecore.cs (StandardConversionExists): Conversion from Interface types to
25873 the object type is standard too so include that.
25875 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25877 * ecore.cs (StandardConversionExists): Augment with missing code:
25878 deal with IntConstant, LongConstants and Enumerations.
25880 * assign.cs: Report the error, instead of failing silently
25882 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25883 typecontainer that they are declared, because the
25884 typecontainer/namespace will have the list of using clauses that
25885 need to be applied.
25887 Assembly Attributes were escaping the normal registration
25890 (EmitCode): Apply attributes within an EmitContext that represents
25891 the container they were declared on.
25893 * cs-parser.jay: Track bases for structs. How did I get this wrong?
25895 2002-05-06 Ravi Pratap <ravi@ximian.com>
25897 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25898 Revamp completely - make much cleaner as we now operate only
25901 (FindMostSpecificSource, FindMostSpecificTarget): New methods
25902 to implement the logic detailed in the spec more correctly.
25904 (UserDefinedConversion): Update accordingly.
25906 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25908 * statement.cs: Return flow analysis information up.
25910 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25913 (token): Do not consume an extra character before calling
25916 2002-05-06 Piers Haken <piersh@friskit.com>
25918 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25920 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25922 * class.cs (Constructor.Emit): Set the IsStatic flag in the
25923 EmitContext during the instance constructor initializer
25924 resolution, to stop access to instance variables.
25926 This is mandated by the spec, last paragraph of the `constructor
25927 initializers' section.
25929 2002-05-05 Miguel de Icaza <miguel@ximian.com>
25931 * cs-parser.jay, class.cs (Accessor): new class used to represent
25932 an accessor (get or set). In the past we used `null' to represent
25933 a missing accessor. But this is ambiguous because there was no
25934 way to tell in abstract indexers/properties if one of them was
25937 Now there is a way of addressing that.
25939 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25940 instead of FindMembers.
25942 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25943 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25945 * attribute.cs: Treat indexers and properties as the same in terms
25946 of applying attributes
25948 * ecore.cs (FindMostEncompassedType): Use statically initialized
25949 EmptyExpressions()s like we do elsewhere to avoid creating useless
25950 objects (and we take this out of the tight loop).
25952 (GetConversionOperators): Move the code to extract the actual
25953 operators to a separate routine to clean things up.
25955 2002-05-04 Miguel de Icaza <miguel@ximian.com>
25957 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25958 events are always registered FieldBuilders.
25960 * class.cs (FieldBase): New class shared by Fields
25962 * delegate.cs: If we are a toplevel delegate, use our full name.
25963 If we are a nested delegate, then only use our tail name.
25965 2002-05-02 Ravi Pratap <ravi@ximian.com>
25967 * expression.cs (IsApplicable): Ensure that we add the "&" to
25968 ref/out types before comparing it with the type of the argument.
25970 (IsParamsMethodApplicable): Ditto.
25972 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
25975 * delegate.cs : Handle the case when we have more than one applicable
25976 method. Flag an error only when we finish checking all.
25978 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25980 * expression.cs: Add support for boolean static initializers.
25982 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25984 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25986 * parameter.cs (ComputeParameterTypes,
25987 ComputeAndDefineParameterTypes): Better error handling: now we
25988 clear the `types' cache if we fail during any of the type lookups.
25989 We also return the status code correctly to our caller
25991 * delegate.cs: If we fail to define a delegate, abort the extra
25994 * expression.cs (Binary.ResolveOperator): for
25995 operator==(object,object) and operator !=(object, object) we also
25996 have to verify that there is an implicit conversion from one to
25999 (ArrayAccess.DoResolve): Array Access can operate on
26002 2002-04-30 Miguel de Icaza <miguel@ximian.com>
26004 * assign.cs (CompoundAssign): A new class used as a "flag" that
26005 the assignment actually is happening as part of a compound
26006 assignment operator.
26008 During compound assignment, a few new rules exist to enable things
26015 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
26016 to the type of x) if y is implicitly convertible to the type of x,
26017 and the operator is a builtin operator and the return type of the
26018 operator is explicitly convertible to the type of x.
26020 * rootcontext.cs: Reset warning level to 2. 4 catches various
26021 "interesting" features in mcs, we must clean this up at some
26022 point, but currently am trying to kill other bugs ;-)
26024 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
26025 in container classes as well.
26027 * expression.cs (Binary.ResolveOperator): Handle string case
26028 before anything else (as operator overloading does emit an error
26029 before doing anything else).
26031 This code could go away when we move to a table driven model, but
26032 i could not come up with a good plan last night.
26034 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
26036 * typemanager.cs (CSharpName): reimplementation using regex.
26037 * class.cs: added null check for fields in Emit
26038 * rootcontext.cs: set warninglevel to 4
26040 2002-04-29 Miguel de Icaza <miguel@ximian.com>
26042 * typemanager.cs (CSharpName): reimplemented with Lupus
26045 2002-04-28 Miguel de Icaza <miguel@ximian.com>
26047 * statement.cs (If): correclty implement Resolve, because we were
26048 not catching sem errors in there. The same process is needed
26050 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
26053 (Statement.Warning_DeadCodeFound): Factorize code.
26054 (While): Report dead code here too.
26056 (Statement): Added Resolve virtual method to allow
26057 for resolution split from the emit code.
26059 2002-04-26 Miguel de Icaza <miguel@ximian.com>
26061 * statement.cs (EmitBoolExpression): No longer try to resolve the
26063 (MakeBoolean): New utility function that resolve, implicitly
26064 converts to boolean and tags the expression.
26067 (If, Do): Implement dead code elimination.
26068 (While): Implement loop inversion
26070 (Do, While, For, If): Resolve the expression prior to calling our
26073 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
26076 - added method Report28 (warning: program has more than one entry point)
26077 - added method IsEntryPoint, implements paragraph 10.1 of the spec
26078 - modified method Method.Define, the part at the end of the method
26080 * rootcontext.cs: added static public Location EntryPointLocation;
26082 * ../errors/cs0028.cs : Add test case for the above warning.
26085 - modified method CSharpName to allow arrays of primitive type to
26086 be printed nicely (e.g. instead of System.Int32[][] it now prints
26088 - added method CSharpSignature: returns the signature of a method
26089 in string format to be used in reporting errors, warnings, etc.
26091 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
26094 2002-04-26 Ravi Pratap <ravi@ximian.com>
26096 * delegate.cs (Define): Fix extremely silly bug where I was
26097 setting the type of the 'object' parameter of the BeginInvoke
26098 method to System.IAsyncResult instead of System.Object ;-)
26100 2002-04-26 Miguel de Icaza <miguel@ximian.com>
26102 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
26105 (Constructor.Emit): return if we fail to initialize the
26106 constructor. Another door closed!
26108 * expression.cs (New.DoResolve): Improve error message (from -6 to
26109 1501). Use DeclaredOnly lookup to find the exact constructor.
26111 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
26112 loop. This is useful.
26114 * cs-parser.jay: Adjust the default parameters so that destructors
26115 have the proper signature.
26117 2002-04-26 Martin Baulig <martin@gnome.org>
26119 * driver.cs (LoadAssembly): If `assembly' contains any characters
26120 which are only valid in path names and not in assembly names
26121 (currently slash, backslash and point), use Assembly.LoadFrom ()
26122 instead of Assembly.Load () on the `assembly' (before iteration
26123 over the link_paths).
26125 2002-04-26 Martin Baulig <martin@gnome.org>
26127 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
26129 2002-04-25 Miguel de Icaza <miguel@ximian.com>
26131 * class.cs (Property): use the new typemanager.MemberLookup
26133 (TypeContainer.MemberLookup): Implement using the
26134 TypeManager.MemberLookup now.
26136 * typemanager.cs: Make MemberLookup a function of the TypeManager,
26137 and return MemberInfos, so that these can be used without an
26138 EmitContext (what we had before).
26140 2002-04-24 Miguel de Icaza <miguel@ximian.com>
26142 * expression.cs: Fix the case where the argument to params if the
26143 type of the params. I omitted handling this before. Fixed
26145 2002-04-22 Miguel de Icaza <miguel@ximian.com>
26147 * driver.cs: Call BootCorlib_PopulateCoreType
26149 * class.cs (Property.CheckBase): Check for properties only, not
26152 * interface.cs: Temporary hack: try/catch around the
26153 CustomAttributeBuilder, because I am getting an exception that I
26156 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
26157 types whose definitions are required to be there (attributes are
26158 defined before standard types).
26160 Compute definitions as we boot the various types, as they are used
26161 immediately (value_type class will need object_type, but if we do
26162 not initialize object_type, we will pass a null, which will let
26163 the runtime pick the System.Object from the existing corlib, which
26164 is not what we want).
26166 2002-04-22 Patrik Torstensson <totte@labs2.com>
26168 * cs-tokenizer.cs: fixed a number of trim() issues.
26170 2002-04-22 Ravi Pratap <ravi@ximian.com>
26172 * expression.cs (Argument.Type): Ensure that we return the correct
26173 type when we have out or ref parameters [in which case we
26176 2002-04-22 Miguel de Icaza <miguel@ximian.com>
26178 * class.cs (Property, Indexer): Allow extern modifier in there.
26180 * typemanager.cs (InitBaseTypes): Initializes object_type and
26181 value_type, since those will be used early on during the bootstrap
26182 process to compile corlib.
26184 (InitCoreTypes): Move code from here to InitBaseTypes.
26186 2002-04-21 Miguel de Icaza <miguel@ximian.com>
26188 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
26189 single-dimension arrays as using the ldlen opcode.
26191 Daniel Lewis discovered this optimization.
26193 * typemanager.cs: Add signature for System.Array::get_Length
26195 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26197 * statement.cs: report the error when the foreach does not apply to an
26198 array nor a collection.
26200 2002-04-19 Miguel de Icaza <miguel@ximian.com>
26202 * expression.cs: Add implicit conversions to the operator ~.
26204 * constant.cs (DecimalConstant.Emit): Emit decimal value.
26206 * typemanager.cs: Locate the decimal constructor.
26208 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26210 * attribute.cs: use the new property of TypeOf.
26211 * expression.cs: added 'get' property around typearg.
26213 These changes fix a build breaker reported by NickD. Is this the
26214 correct way to fix? If not, please, revert my changes and make it
26217 2002-04-17 Miguel de Icaza <miguel@ximian.com>
26219 * attribute.cs: Add support for typeof in attribute invocations.
26220 I am not sure that this is right though.
26222 2002-04-14 Duncan Mak <duncan@ximian.com>
26224 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
26225 Binary.Operator.Division case.
26227 2002-04-13 Ravi Pratap <ravi@ximian.com>
26229 * class.cs (DefineType): Ensure that we do a proper check on
26230 attribute types and also register it with the TypeManager.
26232 (TypeContainer.Targets): The default for attribute types is
26233 AttributeTargets.All.
26235 * attribute.cs (ApplyAttributes): Registering the attribute type
26236 is done elsewhere, not when we discover we have a Usage attribute.
26238 2002-04-12 Ravi Pratap <ravi@ximian.com>
26240 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
26241 and get rid of is_delegate parameter.
26243 * everywhere : update.
26245 2002-04-12 Ravi Pratap <ravi@ximian.com>
26247 * cs-parser.jay (compilation_unit): Revamp completely to use
26248 some new ideas that I got from Rhys' grammar to solve the problems
26249 with assembly level attributes.
26251 (outer_declaration): New grammar production.
26253 (attribute_sections): Add.
26255 (opt_attributes): Base on attribute_sections
26257 (namespace_declaration): Allow opt_attributes to tackle the case
26258 when we have assembly level attributes - we are clever in this
26261 * attribute.cs (ApplyAttributes): Do not worry about assembly
26262 attributes in the non-global context.
26264 * rootcontext.cs (AddGlobalAttributes): Go back to using this
26265 instead of SetGlobalAttributes.
26267 * class.cs, rootcontext.cs : Ensure we define and generate
26268 attribute types before anything else.
26270 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
26271 and flag the new error -20 for the case when the attribute type
26272 does not have valid targets specified. csc does not catch this.
26274 * ../errors/errors.txt : update for error # -20
26276 2002-04-11 Ravi Pratap <ravi@ximian.com>
26278 * support.cs (InternalParameters.ParameterModifier): Do some null
26279 checking and return sane values.
26281 * class.cs (Method.Define): If we are a PInvoke method, ensure
26282 that we are static and extern. Report error # 601
26284 * ../errors/cs0601.cs : Add test case for the above error.
26286 2002-04-07 Ravi Pratap <ravi@ximian.com>
26288 * rootcontext.cs (attribute_types): We need to keep type of
26289 all attribute types separately and emit code for them first.
26291 (RegisterAttribute) : Implement.
26293 * class.cs (DefineType): Check if the current Type is a custom
26294 attribute type and register it accordingly.
26296 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
26297 adding the first attribute twice and rename to
26299 (SetGlobalAttributes): this.
26301 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
26304 * attribute.cs (ApplyAttributes): Take an additional argument telling us
26305 if we are processing global arguments. Hmm, I am unsure of this.
26307 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26309 * expression.cs: added static array of strings to avoid calling
26310 Enum.ToString () for Operator in Binary. Significant recover of
26313 2002-04-10 Miguel de Icaza <miguel@ximian.com>
26315 * class.cs (FindMembers): Allow the Builders of the various
26316 members to be null. If they are skip them. This only happens
26317 during the PInvoke declaration.
26319 2002-04-09 Miguel de Icaza <miguel@ximian.com>
26321 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
26322 failure, so we do not keep going afterwards.
26324 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
26325 wanted to pass `false' as the `is_delegate' argument. If this is
26326 the case, why not use delegate_type == null to mean `is_delegate =
26327 false' and anything else as is_delegate = true.
26329 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
26331 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
26332 code for the section, not the beginning of the tests.
26334 2002-04-08 Miguel de Icaza <miguel@ximian.com>
26336 * cfold.cs: Handle operator + (Enum x, Underlying x)
26338 * expression.cs (Binary): same. Warn about errors where we have
26339 Enum/Enum in operator + as well.
26341 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
26344 - added support for switch(bool)
26345 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
26346 - add TableSwitchEmit() to handle table-based switch statements
26348 2002-04-05 Ravi Pratap <ravi@ximian.com>
26350 * expression.cs (Invocation.OverloadResolve): Factor out code which
26351 does parameter compatibility checking with arguments so that we can
26352 re-use the code even from Delegate.VerifyApplicability
26354 (VerifyArgumentsCompat): Move above code here.
26356 * delegate.cs (VerifyApplicability): Get rid of duplicate code
26357 and instead make a call to the above method.
26359 2002-03-31 Ravi Pratap <ravi@ximian.com>
26361 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
26362 We use it to keep track of classes which are attribute types.
26364 2002-04-02 Miguel de Icaza <miguel@ximian.com>
26366 * delegate.cs (Delegate.Define): Correctly define the types in the
26367 presence of fixed and array parameters.
26369 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
26372 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
26373 include NonPublic after the first iteration.
26375 * class.cs (Indexer.CheckBase): Only check if both parents are
26378 * cs-parser.jay (accessor_body): If empty, set to null.
26380 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
26381 same code path here to resolve constants names that we did have in
26382 MemberAccess.DoResolve. There is too much code duplicated here.
26384 2002-04-01 Miguel de Icaza <miguel@ximian.com>
26386 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
26388 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
26391 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
26392 tokens, numbers and strings.
26394 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26397 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26398 asyncronous parameters and the regular parameters.
26400 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26401 specify the target directory.
26403 * expression.cs: (This.DoResolve): Simplify
26404 (As.Emit): Optimize, do not generate IsInst if the expression is
26405 always of the given type.
26407 (Is.DoResolve): Bug fix, we were reporting both always/never for
26410 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26411 creating too many unnecessary arrays.
26413 2002-03-31 Miguel de Icaza <miguel@ximian.com>
26415 * class.cs (EmitFieldInitializer): Use Assign expression to assign
26416 fields instead of rolling our own initializer. Takes care of all
26417 implicit conversions, and drops unnecessary static checks/argument.
26419 2002-03-31 Dick Porter <dick@ximian.com>
26421 * driver.cs: use the GetDirectories() return values properly, and
26422 use "/" as path separator.
26424 2002-03-30 Miguel de Icaza <miguel@ximian.com>
26426 * expression.cs (Unary): Optimize - - expr into expr.
26427 (Binary): Optimize a + (-b) into a -b.
26429 * codegen.cs (CodeGen): Made all methods static.
26431 2002-03-29 Miguel de Icaza <miguel@ximian.com>
26435 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26436 TypeBuilder property.
26438 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26441 * tree.cs: Removed the various RecordXXXX, and replaced with a
26442 single RecordDecl. Removed all the accessor methods, and just
26443 left a single access point Type
26445 * enum.cs: Rename DefineEnum to DefineType.
26447 * decl.cs: New abstract method `DefineType' used to unify the
26448 Defines for Enumerations, Interfaces, TypeContainers and
26451 (FindType): Moved LookupInterfaceOrClass here. Moved the
26452 LookupBaseClasses method that used to live in class.cs and
26453 interface.cs here, and renamed to FindType.
26455 * delegate.cs: Implement DefineType. Take advantage of the
26456 refactored pattern for locating the parent builder without taking
26457 the parent_builder argument (which we know does not work if we are
26458 nested, and triggering a toplevel definition).
26460 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26462 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26463 accessibility of a member has changed during override and report
26466 * class.cs (Method.Define, Property.Define): Only complain on
26467 overrides if the method is private, any other accessibility is
26468 fine (and since we just checked the permission is the same, we are
26471 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26472 and elif are processed always. The other pre-processing
26473 directives are only processed if we are "taking" the path
26475 2002-03-29 Martin Baulig <martin@gnome.org>
26477 * class.cs (Method.Emit): Only emit symbolic debugging info if the
26478 current location is not Null.
26480 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26481 a separate method so we can profile it.
26483 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26484 `span.Seconds' are just seconds, but no minutes or hours.
26485 (MainDriver): Profile the CodeGen.SaveSymbols calls.
26487 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26489 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26490 Remove the gratuitous set of Final:
26492 // If an interface implementation, then we can set Final.
26493 if (((flags & MethodAttributes.Abstract) == 0) &&
26494 implementing.DeclaringType.IsInterface)
26495 flags |= MethodAttributes.Final;
26497 I do not know what I was smoking when I used that.
26500 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26501 step into fixing the name resolution issues for delegates and
26502 unifying the toplevel name resolution.
26504 2002-03-28 Martin Baulig <martin@gnome.org>
26506 * class.cs (Method.Emit): If we have a symbol writer, call its
26507 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26508 tell it about the current method.
26510 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26511 writer that we're going to emit the first byte of IL code for a new
26512 statement (a new source line).
26513 (EmitContext.EmitTopBlock): If we have a symbol writer, call
26514 EmitContext.Mark() before emitting any code.
26516 * location.cs (SymbolDocument): Return null when we're Null.
26518 * statement.cs (Statement): Moved the `Location loc' variable here.
26519 (Statement.EmitBoolExpression): If we have a symbol writer, call
26520 ec.Mark() before emitting any code to tell it that we're at the
26521 beginning of a new statement.
26522 (StatementExpression): Added `Location' argument to the constructor.
26523 (Block): Added public readonly variable `StartLocation' and public
26524 variable `EndLocation'. The latter is to be set using SetEndLocation().
26525 (Block): Added constructor which takes a start and end location.
26526 (Block.SetEndLocation): New method. This sets the end location.
26527 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26528 local variables we create.
26529 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26530 each statement and do also mark the begin and end of the block.
26532 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26533 tell it the current lexer.Location, use Location.Null for the end of the
26535 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26536 current block, set its end location using SetEndLocation().
26537 (statement_expression): StatementExpression constructor now takes the
26538 lexer.Location as additional argument.
26539 (for_statement, declare_local_variables): Likewise.
26540 (declare_local_variables): When creating a new implicit block, use the
26541 new Block constructor and pass it the lexer.Location.
26543 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26545 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26546 members also on the parent interfaces recursively.
26548 2002-03-27 Miguel de Icaza <miguel@ximian.com>
26550 * report.cs: Use new formats, since Gonzalo finished the missing
26553 * expression.cs (Binary.ResolveOperator): added missing operator|
26554 operator& and operator^ for bool/bool.
26556 * cs-parser.jay: CheckDef now takes a Location argument that is
26557 used to report errors more precisly (instead of reporting the end
26558 of a definition, we try to track something which is a lot closer
26559 to the source of the problem).
26561 * cs-tokenizer.cs: Track global token use, so we can properly flag
26562 the use of #define/#undef after the first token has been seen.
26564 Also, rename the reportXXXX to Error_DescriptiveName
26566 * decl.cs (DeclSpace.IsTopLevel): Move property here from
26567 TypeContainer, so that Enum and Interface can use this too.
26569 * class.cs (TypeContainer.LookupInterfaceOrClass,
26570 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26571 `builder' argument. Typically this was used to pass the parent
26572 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26575 The problem is that a nested class could trigger the definition of
26576 a toplevel class, and the builder would be obviously wrong in that
26579 So we drop this argument, and we compute dynamically the
26580 TypeBuilder/ModuleBuilder (the correct information was available
26581 to us anyways from DeclSpace.Parent)
26583 * interface.cs (Interface.DefineInterface): Drop builder
26584 parameter cleanup like class.cs
26586 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
26589 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26592 (Try.Emit): Propagate the returns value from the statement.
26594 (Return.Emit): Even if we are leavning
26596 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26598 * modifiers.cs: Fix the computation of MethodAttributes flags.
26600 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26602 * driver.cs: allow compilation of files that start with '/'.
26603 Add a default case when checking the argument of --target.
26605 2002-03-25 Miguel de Icaza <miguel@ximian.com>
26607 * interface.cs: Implement the same search algorithm for types in
26608 the interface code.
26610 * delegate.cs: Do not allow multiple definition.
26612 * Recovered ChangeLog that got accidentally amputated
26614 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26616 * rootcontext.cs: Load manually enum to allow core classes to
26617 contain enumerations.
26619 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26620 Update to new static methods in TypeManager.
26622 * typemanager.cs (GetMethod, GetConstructor): Use our
26623 implementation of FindMembers to find the members, since during
26624 corlib compilation, the types are TypeBuilders and GetMethod and
26625 GetConstructor do not work.
26627 Make all methods in TypeManager static.
26629 (InitCodeHelpers): Split the functionality from
26630 the InitCodeTypes function.
26632 * driver.cs: Call InitCodeHelpers after we have populated the
26635 * cs-parser.jay (delegate_declaration): we did not used to compute
26636 the delegate name correctly for void delegates.
26638 2002-03-24 Miguel de Icaza <miguel@ximian.com>
26640 * rootcontext.cs (RootContext): Init the interface_resolve_order
26641 and type_container_resolve_order always.
26643 (ResolveCore, BootstrapCorlib_ResolveClass,
26644 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26645 compiler when compiling with --nostdlib
26647 * class.cs (TypeContainer.DefineType): Check that our parent is
26648 not null. This test is most important when we are bootstraping
26651 * codegen.cs: Split out the symbol writing code.
26653 2002-03-25 Martin Baulig <martin@gnome.org>
26655 * driver.cs (-g): Made -g an alias for --debug.
26657 2002-03-24 Martin Baulig <martin@gnome.org>
26659 * codegen.cs (SymbolWriter): New public variable. Returns the
26660 current symbol writer.
26661 (CodeGen): Added `bool want_debugging_support' argument to the
26662 constructor. If true, tell the ModuleBuild that we want debugging
26663 support and ask it for the ISymbolWriter.
26664 (Save): If we have a symbol writer, call it's Close() method after
26665 saving the assembly.
26667 * driver.c (--debug): New command line argument to create a
26668 debugger information file.
26670 * location.cs (SymbolDocument): New public property. Returns an
26671 ISymbolDocumentWriter object for the current source file or null
26672 if we don't have a symbol writer.
26674 2002-03-21 Miguel de Icaza <miguel@ximian.com>
26676 * driver.cs (LoadAssembly): Correctly return when all the paths
26677 have been tried and not before.
26679 * statement.cs (Switch.Emit): return the actual coverage for this
26680 statement (returns/not-returns)
26682 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26683 switch of the statement if we are the last switch section. That
26684 kills two problems: try/catch problems (we used to emit an empty
26685 nop at the end) and switch statements where all branches would
26688 2002-03-19 Miguel de Icaza <miguel@ximian.com>
26690 * driver.cs: Add default assemblies (the equivalent to the
26691 Microsoft CSC.RSP file)
26693 * cs-tokenizer.cs: When updating `cols and setting it to zero,
26694 also update tokens_seen and set it to false.
26696 * driver.cs: Implement --recurse for Mike.
26698 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26699 correctly splitting out the paths.
26701 2002-03-18 Miguel de Icaza <miguel@ximian.com>
26703 * interface.cs (Interface.PopulateProperty): Instead of using
26704 `parent' as the declaration space for the set parameters, use
26707 * support.cs (InternalParameters): InternalParameters constructor
26708 takes a DeclSpace instead of a TypeContainer.
26710 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26711 types are being initialized, load the address of it before calling
26714 (New): Provide a mechanism to disable the generation of local
26715 value type temporaries when the caller will be providing us with
26716 an address to store it.
26718 (ArrayCreation.EmitDynamicInitializers): Use it.
26720 2002-03-17 Miguel de Icaza <miguel@ximian.com>
26722 * expression.cs (Invocation.EmitArguments): Only probe for array
26723 property if there is more than one argument. Sorry about that.
26725 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26726 empty param arrays.
26728 * class.cs (Method.LabelParameters): Fix incorrect code path that
26729 prevented the `ParamArrayAttribute' from being applied to the
26732 2002-03-16 Miguel de Icaza <miguel@ximian.com>
26734 * support.cs (ReflectionParameters): Correctly compute whether the
26735 last argument is a params array. Fixes the problem with
26738 * typemanager.cs: Make the assemblies array always be non-null
26739 (empty, but non-null)
26741 * tree.cs (RecordDecl): New function that abstracts the recording
26742 of names. This reports error 101, and provides a pointer to the
26743 previous declaration. Fixes a crash in the compiler.
26745 * cs-parser.jay (constructor_declaration): Update to new grammar,
26746 and provide a constructor_body that can be empty.
26748 2002-03-15 Miguel de Icaza <miguel@ximian.com>
26750 * driver.cs: Add support for --resources.
26752 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26753 Make all types for the various array helper methods be integer.
26755 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26756 CheckState to ConvCast.
26758 (ConvCast): Now it takes a `checked' state argument, to avoid
26759 depending on the emit context for the conversion, and just using
26760 the resolve time setting.
26762 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26763 instead of Invocation.EmitArguments. We do not emit the original
26764 arguments, instead we emit those which have been converted to
26765 unsigned int expressions.
26767 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26769 * codegen.cs: ditto.
26771 * expression.cs (LocalVariableReference): Drop the use of the
26772 Store function that depended on the variable index.
26774 * statement.cs (VariableInfo): Drop the `Idx' property from this
26775 class, as this is not taking into account the indexes for
26776 temporaries tat we generate during the execution, getting the
26779 * class.cs: First emit class initializers, then call the parent
26782 * expression.cs (Binary): Fix opcode emision.
26783 (UnaryMutator.EmitCode): Support checked code generation
26785 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26786 matches for events for both the Static and Instance scans,
26787 pointing to the same element. Fix that.
26789 2002-03-14 Miguel de Icaza <miguel@ximian.com>
26791 * rootcontext.cs (ResolveTree): Always set the
26792 interface_resolve_order, because nested interfaces will be calling
26795 * class.cs (GetInterfaceOrClass): Track the same resolution
26796 process used by TypeManager.LookupType. This fixes the nested
26797 type lookups in class declarations (separate path from
26800 (TypeContainer.DefineType): Also define nested interfaces.
26801 (TypeContainer.RegisterOrder): New public function used to
26802 register the order in which child interfaces need to be closed.
26804 Nested interfaces need to be closed after their parents have been
26807 * interface.cs (InterfaceAttr): Put all the logic for computing
26808 the interface attribute here.
26810 (DefineInterface): Register our interface order with the
26811 RootContext or with the TypeContainer depending on the case.
26813 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26815 * cs-parser.jay: rework foreach statement to work with the new
26816 changes to the policy on SimpleNames.
26818 * report.cs: support Stacktrace on warnings as well.
26820 * makefile: drop --unsafe and /unsafe from the compile.
26822 2002-03-13 Ravi Pratap <ravi@ximian.com>
26824 * ecore.cs (StandardConversionExists): Modify to take an Expression
26825 as the first parameter. Ensure we do null -> reference type conversion
26828 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26829 temporary Expression objects.
26831 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26833 * interface.cs: workaround bug in method overloading resolution
26834 (there is already a bugzilla bug for it).
26836 2002-03-12 Miguel de Icaza <miguel@ximian.com>
26838 We could also solve this problem by having a separate path for
26839 performing type lookups, instead of DoResolve, we could have a
26840 ResolveType entry point, and only participating pieces of the
26841 production (simplename, deref, array) would implement this.
26843 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26844 signal SimpleName to only resolve type names and not attempt to
26845 resolve anything else.
26847 * expression.cs (Cast): Set the flag.
26849 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26851 * class.cs: Only report 108 if there is no `new' modifier.
26853 * cs-parser.jay: rework foreach statement to work with the new
26854 changes to the policy on SimpleNames.
26856 * report.cs: support Stacktrace on warnings as well.
26858 * makefile: drop --unsafe and /unsafe from the compile.
26860 2002-03-11 Miguel de Icaza <miguel@ximian.com>
26862 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26863 lookups here, instead of doing that at parse time. This means
26864 that our grammar will not introduce `LocalVariableReferences' as
26865 expressions at this point. That solves the problem of code like
26869 static void Main ()
26873 This is only half the fix. The full fix requires parameters to
26874 also be handled in this way.
26876 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26877 makes the use more obvious of the DeclSpace. The
26878 ec.TypeContainer.TypeBuilder is now only used to pull the
26879 TypeBuilder for it.
26881 My theory is that I can get rid of the TypeBuilder completely from
26882 the EmitContext, and have typecasts where it is used (from
26883 DeclSpace to where it matters).
26885 The only pending problem is that the code that implements Aliases
26886 is on TypeContainer, and probably should go in DeclSpace.
26888 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26889 lookups here, instead of doing that at parse time. This means
26890 that our grammar will not introduce `LocalVariableReferences' as
26891 expressions at this point. That solves the problem of code like
26895 static void Main ()
26899 This is only half the fix. The full fix requires parameters to
26900 also be handled in this way.
26902 * class.cs (Property.DefineMethod): When implementing an interface
26903 method, set newslot, when implementing an abstract method, do not
26904 set the flag (before we tried never setting it, or always setting
26905 it, which is the difference).
26906 (Indexer.DefineMethod): same.
26907 (Method.DefineMethod): same.
26909 * ecore.cs: Only set the status used flag if we get back a Field.
26911 * attribute.cs: Temporary hack, so Paolo can keep working.
26913 2002-03-08 Ravi Pratap <ravi@ximian.com>
26915 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26916 the unmanaged type in the case we have a MarshalAs attribute.
26918 (Resolve): Handle the case when we are parsing the special MarshalAs
26919 attribute [we need to store the unmanaged type to use later]
26921 * typemanager.cs (marshal_as_attr_type): Built in type for the
26922 MarshalAs Attribute.
26924 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
26925 on parameters and accordingly set the marshalling info.
26927 2002-03-09 Miguel de Icaza <miguel@ximian.com>
26929 * class.cs: Optimizing slightly by removing redundant code after
26930 we switched to the `NoTypes' return value.
26931 (Property.DefineMethod): use NoTypes here too.
26933 This fixes the bug I introduced in my last batch of changes.
26935 2002-03-05 Ravi Pratap <ravi@ximian.com>
26937 * tree.cs (RecordEnum): Add. We now keep track of enums too.
26939 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26940 Enums since those are types too.
26942 * cs-parser.jay (enum_declaration): Record enums as we parse them.
26944 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
26945 thanks to a call during the lookup process.
26947 2002-03-07 Miguel de Icaza <miguel@ximian.com>
26949 * statement.cs (Foreach): Lots of work to accomodate a particular
26950 kind of foreach statement that I had not kept in mind. It is
26951 possible to have foreachs on classes that provide a GetEnumerator
26952 method that return objects that implement the "pattern" for using
26953 a foreach, there is no need to support GetEnumerator
26956 This is needed to compile nant.
26958 * decl.cs: Only report 114 if the member is not `Finalize' and if
26959 the warning level is at least 2.
26961 * class.cs: Moved the compare function from Method to
26964 (MethodSignature.InheritableMemberSignatureCompare): Add new
26965 filter function that is used to extract inheritable methods from a
26968 (Method.Define): Use the new `inheritable_method_signature_filter'
26971 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26974 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26976 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26978 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26980 * expression.cs: Pass location information to
26981 ConvertImplicitStandard.
26983 * class.cs: Added debugging code to track return values from
26986 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26988 * expression.cs (Is.DoResolve): If either side of the `is' is an
26989 interface, do not flag the warning.
26991 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26994 * report.cs: Allow for --fatal to be used with --probe.
26996 * typemanager.cs (NoTypes): Move the definition for the empty Type
26999 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
27001 (TypeContainer.DefineProxy): New function used to proxy to parent
27002 implementations when implementing interfaces.
27003 (TypeContainer.ParentImplements): used to lookup if our parent
27004 implements a public function that is required by an interface.
27005 (TypeContainer.VerifyPendingMethods): Hook this up.
27007 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
27008 `modules' and `assemblies' arraylists into arrays. We only grow
27009 these are the very early start up of the program, so this improves
27010 the speedof LookupType (nicely measured).
27012 * expression.cs (MakeByteBlob): Replaced unsafe code with
27013 BitConverter, as suggested by Paolo.
27015 * cfold.cs (ConstantFold.Binary): Special case: perform constant
27016 folding of string concatenation, but if either side is a string,
27017 and the other is not, then return null, and let the runtime use
27018 the concatenation on the string plus the object (using
27019 `Object.ToString').
27021 2002-03-04 Miguel de Icaza <miguel@ximian.com>
27023 Constant Folding has been implemented now.
27025 * expression.cs (Unary.Reduce): Do not throw an exception, catch
27026 the error instead on types that are not supported in one's
27029 * constant.cs (Constant and all children): New set of functions to
27030 perform implict and explicit conversions.
27032 * ecore.cs (EnumConstant): Implement the new functions to perform
27033 conversion by proxying to the child expression.
27035 * codegen.cs: (ConstantCheckState): Constant evaluation has its
27036 own separate setting that can not be turned off from the command
27037 line using --unchecked or --checked and is only controlled using
27038 the checked/unchecked statements and expressions. This setting is
27039 used by the constant folder to flag errors.
27041 * expression.cs (CheckedExpr, UncheckedExpr): Set the
27042 ConstantCheckState as well.
27044 During Resolve, they also have to flag the state, because the
27045 constant folder runs completely in the Resolve phase.
27047 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
27050 2002-03-01 Miguel de Icaza <miguel@ximian.com>
27052 * cfold.cs: New file, this file contains the constant folder.
27054 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
27055 argument to track whether we are using the resulting address to
27056 load or store a value and provide better error messages.
27058 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
27059 new AddressOf arguments.
27061 * statement.cs (Foreach.EmitCollectionForeach): Update
27063 * expression.cs (Argument.Emit): Call AddressOf with proper
27064 arguments to track usage.
27066 (New.DoEmit): Call AddressOf with new arguments.
27068 (Unary.Emit): Adjust AddressOf call.
27070 2002-03-01 Ravi Pratap <ravi@ximian.com>
27072 * cs-parser.jay (member_access): Change the case for pre-defined types
27073 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
27076 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
27079 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
27080 essentially like methods and apply attributes like MethodImplOptions to them too.
27082 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
27085 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
27086 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
27089 * Update code everywhere accordingly.
27091 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
27093 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
27095 2002-02-28 Ravi Pratap <ravi@ximian.com>
27097 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
27098 try performing lookups against those instead of jumping straight into using
27099 the 'using' clauses.
27101 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
27103 (LookupType): Perform lookups in implicit parents too.
27105 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
27106 sequence as RootContext.LookupType.
27108 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
27109 the various cases of namespace lookups into this method.
27111 2002-03-01 Miguel de Icaza <miguel@ximian.com>
27113 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
27114 in positional arguments)
27116 * class.cs (Operator): Update the AllowedModifiers to contain
27119 * cs-parser.jay: Update operator declaration to allow for the
27120 operator body to be empty.
27122 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
27125 2002-02-27 Miguel de Icaza <miguel@ximian.com>
27127 * class.cs (Method.Emit): Label parameters.
27129 * driver.cs: Return 1 or 0 as the program exit code.
27131 2002-02-26 Miguel de Icaza <miguel@ximian.com>
27133 * expression.cs: Special case the `null' object when trying to
27134 auto-compute the type, as anything can be explicitly converted to
27137 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
27138 spotting this Paolo.
27140 (Expression.ImplicitNumericConversion): Perform comparissions of
27141 the type using the underlying type in the case of an enumeration
27142 rather than using the enumeration type for the compare.
27144 Cope with the underlying == type case, which is not possible to
27147 (Expression.ConvertNumericExplicit): Perform comparissions of
27148 the type using the underlying type in the case of an enumeration
27149 rather than using the enumeration type for the compare.
27151 * driver.cs: If the user does not supply an extension, assume .exe
27153 * cs-parser.jay (if_statement): Rewrote so that we can track the
27154 location for the if statement.
27156 * expression.cs (Binary.ConstantFold): Only concat strings when
27157 the operation is "+", not everything ;-)
27159 * statement.cs (Statement.EmitBoolExpression): Take a location
27161 (If, While, Do): Track location.
27163 * expression.cs (Binary.ResolveOperator): In the object + string
27164 case, I was missing a call to ConvertImplicit
27166 2002-02-25 Ravi Pratap <ravi@ximian.com>
27168 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
27169 Location arguments. Ensure we use RootContext.LookupType to do our work
27170 and not try to do a direct Type.GetType and ModuleBuilder.GetType
27172 * interface.cs (PopulateMethod): Handle the type of the parameter being
27175 * expression.cs (Invocation.BetterFunction): Handle the case when we
27176 have a params method with no fixed arguments and a call is made with no
27179 2002-02-25 Miguel de Icaza <miguel@ximian.com>
27181 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
27182 the verbatim-string-literal
27184 * support.cs (InternalParameters.ParameterModifier): handle null
27186 (InternalParameters.ParameterType): ditto.
27188 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
27189 duplicating the name of the variable parameter.
27190 (GetParameterByName): Fix bug where we were not looking up array
27191 paramters if they were the only present (thanks Paolo!).
27192 (GetParameterInfo): We only have an empty set of types if both
27193 fixed and array are set to null.
27194 (GetParameterInfo-idx): Handle FixedParameter == null
27196 * cs-parser.jay: Handle the case where there is no catch
27197 statements (missing null test).
27199 2002-02-22 Miguel de Icaza <miguel@ximian.com>
27201 * driver.cs (MainDriver): Be conservative on our command line
27204 Catch DirectoryNotFoundException when calling GetFiles.
27206 (SplitPathAndPattern): Used to split the input specification into
27207 a path and a pattern that we can feed to Directory.GetFiles.
27209 2002-02-21 Miguel de Icaza <miguel@ximian.com>
27211 * statement.cs (Fixed): Implement the last case of the Fixed
27212 statement (string handling).
27214 * expression.cs (StringPtr): New class used to return a char * to
27215 a string; Used by the Fixed statement.
27217 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
27219 * expression.cs (Binary.ResolveOperator): Remove redundant
27220 MemberLookup pn parent type.
27221 Optimize union call, we do not need a union if the types are the same.
27222 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
27225 Specialize the use of MemberLookup everywhere, instead of using
27226 the default settings.
27228 (StackAlloc): Implement stackalloc keyword.
27230 * cs-parser.jay: Add rule to parse stackalloc.
27232 * driver.cs: Handle /h, /help, /?
27234 * expression.cs (MakeByteBlob): Removed the hacks we had in place
27235 before we supported unsafe code.
27237 * makefile: add --unsafe to the self compilation of mcs.
27239 2002-02-20 Miguel de Icaza <miguel@ximian.com>
27241 * expression.cs (PointerArithmetic): New class that is used to
27242 perform pointer arithmetic.
27243 (Binary.Resolve): Handle pointer arithmetic
27244 Handle pointer comparission.
27245 (ArrayPtr): Utility expression class that is used to take the
27246 address of an array.
27248 (ElementAccess): Implement array access for pointers
27250 * statement.cs (Fixed): Implement fixed statement for arrays, we
27251 are missing one more case before we are done.
27253 * expression.cs (Indirection): Implement EmitAssign and set the
27254 ExprClass to Variable. This allows pointer dereferences to be
27255 treated as variables, and to have values assigned to them.
27257 * ecore.cs (Expression.StoreFromPtr): New utility function to
27258 store values dereferencing.
27260 2002-02-20 Ravi Pratap <ravi@ximian.com>
27262 * expression.cs (Binary.ResolveOperator): Ensure that we are
27263 not trying to operate on a void type - this fixes the reported
27266 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
27267 the parent implementation is sealed.
27269 * ../errors/cs0239.cs : Add.
27271 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
27273 * typemanager.cs (unverifiable_code_type): Corresponds to
27274 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
27275 which have unsafe code in them.
27277 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
27280 2002-02-19 Miguel de Icaza <miguel@ximian.com>
27282 * cs-tokenizer.cs: Add support for @"litreal strings"
27284 Make tokenizer accept pre-processor directives
27285 on any column (remove the old C-like limitation).
27287 * rootcontext.cs (EmitCode): Emit any global attributes.
27288 (AddGlobalAttributes): Used to keep track of assembly attributes.
27290 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
27292 * cs-parser.jay: Add support for global attributes.
27294 2002-02-17 Miguel de Icaza <miguel@ximian.com>
27296 * expression.cs (Indirection): New helper class. Unary will
27297 create Indirection classes to be able to implement the
27298 IMemoryLocation interface on it.
27300 2002-02-16 Miguel de Icaza <miguel@ximian.com>
27302 * cs-parser.jay (fixed_statement): reference the right statement.
27304 * statement.cs (Fixed.Emit): Finish implementing the fixed
27305 statement for the &x case.
27307 2002-02-14 Miguel de Icaza <miguel@ximian.com>
27309 * class.cs (Property.Define, Method.Define): Remove newslot when
27312 * modifiers.cs: My use of NewSlot when `Abstract' was set was
27313 wrong. NewSlot should only be used if the `new' keyword is present.
27315 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
27316 locating our system dir. Sorry about this.
27318 2002-02-13 Miguel de Icaza <miguel@ximian.com>
27320 * driver.cs (GetSystemDir): Compute correctly the location of our
27321 system assemblies. I was using the compiler directory instead of
27322 the library directory.
27324 2002-02-13 Ravi Pratap <ravi@ximian.com>
27326 * expression.cs (BetterFunction): Put back in what Miguel commented out
27327 since it is the correct fix. The problem is elsewhere ;-)
27329 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
27330 parameters of the parms method are themselves compatible or not !
27332 (StandardConversionExists): Fix very dangerous bug where we were forgetting
27333 to check that a class implements an interface before saying that an implicit
27334 conversion was allowed. Use ImplementsInterface to do the checking.
27336 2002-02-13 Miguel de Icaza <miguel@ximian.com>
27338 * class.cs (Method.Define): Track whether we are an explicit
27339 implementation or not. And only call DefineMethodOverride if we
27340 are an explicit implementation.
27342 (Property.DefineMethod): Ditto.
27344 2002-02-11 Ravi Pratap <ravi@ximian.com>
27346 * expression.cs (BetterFunction): Catch hideous bug which was
27347 preventing us from detecting ambiguous calls due to implicit casts i.e
27350 2002-01-29 Miguel de Icaza <miguel@ximian.com>
27352 * support.cs (Pair): Remove un-needed method. I figured why I was
27353 getting the error in cs-parser.jay, the variable in a foreach loop
27354 is readonly, and the compiler does not really treat this as a variable.
27356 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
27357 instead of EQUALS in grammar.
27359 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
27361 * expression.cs (Unary.DoResolve): Check whether the argument is
27364 2002-01-28 Miguel de Icaza <miguel@ximian.com>
27366 * support.cs: Api for Pair to set a value. Despite the fact that
27367 the variables are public the MS C# compiler refuses to compile
27368 code that accesses the field if the variable is part of a foreach
27371 * statement.cs (Fixed): Begin implementation of the fixed
27374 (Block.AddVariable): Return the VariableInfo on success and null
27375 on failure instead of true/false.
27377 * cs-parser.jay (foreach): Catch errors on variables already
27378 defined (we were ignoring this value before) and properly unwind
27379 the block hierarchy
27381 (fixed_statement): grammar for the fixed statement.
27383 2002-01-25 Miguel de Icaza <miguel@ximian.com>
27385 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
27386 pointer types to be incretemented.
27388 (SizeOf): Implement.
27390 * cs-parser.jay (pointer_member_access): Implement
27391 expr->IDENTIFIER production.
27393 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
27394 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27397 (Unary): Implement indirection.
27399 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27400 use in non-unsafe context).
27402 (SimpleName.DoResolve): Check for pointers in field access on safe
27405 (Expression.LoadFromPtr): Factor the load-indirect code in this
27406 function. This was duplicated in UnboxCast and ParameterReference
27408 2002-01-24 Miguel de Icaza <miguel@ximian.com>
27410 * expression.cs (ComposedCast): report an error if a pointer cast
27411 is used in a safe region.
27413 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27414 pointer type casts in unsafe context.
27416 * codegen.cs (EmitContext): Set up IsUnsafe.
27418 * cs-parser.jay (non_expression_type): Add productions for pointer
27421 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27422 code. We should not use force into static mode if the method is
27423 not virtual. Fixes bug in MIS
27425 * statement.cs (Do.Emit, While.Emit, For.Emit,
27426 Statement.EmitBoolExpression): Add support to Do and While to
27427 propagate infinite loop as `I do return' semantics.
27429 Improve the For case to also test for boolean constants.
27431 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27432 to the list of attributes we can add.
27434 Remove `EmitContext' argument.
27436 * class.cs (Method.Define): Apply parameter attributes.
27437 (Constructor.Define): Apply parameter attributes.
27438 (MethodCore.LabelParameters): Move here the core of labeling
27441 * support.cs (ReflectionParameters.ParameterModifier,
27442 InternalParameters.ParameterModifier): Use IsByRef on the type and
27443 only return the OUT bit for these parameters instead of in/out/ref
27446 This is because I miss-understood things. The ParameterInfo.IsIn
27447 and IsOut represent whether the parameter has the [In] and [Out]
27450 2002-01-22 Miguel de Icaza <miguel@ximian.com>
27452 * ecore.cs (FieldExpr.Emit): Release temporaries.
27454 * assign.cs (LocalTemporary.Release): new function.
27456 * codegen.cs (EmitContext.GetTemporaryStorage,
27457 EmitContext.FreeTemporaryStorage): Rework the way we deal with
27458 temporary storage. Now we can "put back" localbuilders when we
27461 2002-01-21 Miguel de Icaza <miguel@ximian.com>
27463 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27464 need to make a copy of the variable to generate verifiable code.
27466 2002-01-19 Miguel de Icaza <miguel@ximian.com>
27468 * driver.cs: Compute dynamically the system directory.
27470 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27471 Slower, but more generally useful. Used by the abstract
27472 registering implementation.
27474 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27475 the rules for the special rule on Type/instances. First check if
27476 we have the same name, and if so, try that special static path
27477 rather than the instance path.
27479 2002-01-18 Miguel de Icaza <miguel@ximian.com>
27481 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27484 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27485 Enum, ValueType, Delegate or Array for non-corlib compiles.
27487 * cs-tokenizer.cs: Catch long identifiers (645)
27489 * typemanager.cs (IndexerPropetyName): Ravi never tested this
27492 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27493 fix, we were returning too early, so we were not registering
27494 pending methods from abstract classes.
27496 Do not register pending methods if the class is abstract.
27498 * expression.cs (Conditional.DoResolve): Report circular implicit
27499 conversions when we neecd to compute it for conditional
27502 (Is.DoResolve): If the expression is always of the provided type,
27503 flag warning 183. If the expression can not ever be of the
27504 provided type flag warning 184.
27506 * class.cs: Catch 169 as well.
27508 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27511 2002-01-18 Nick Drochak <ndrochak@gol.com>
27513 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
27515 2002-01-17 Miguel de Icaza <miguel@ximian.com>
27517 * interface.cs: (PopulateMethod): Check for pointers being defined
27518 only if the unsafe context is active.
27519 (PopulateProperty): ditto.
27520 (PopulateIndexer): ditto.
27522 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27523 specified. If pointers are present, make sure that they are
27524 present in an unsafe context.
27525 (Constructor, Constructor.Define): ditto.
27526 (Field, Field.Define): ditto.
27527 (Property, Property.Define): ditto.
27528 (Event, Event.Define): ditto.
27530 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27531 hashtable if there are classes or structs defined.
27533 * expression.cs (LocalVariableReference.DoResolve): Simplify this
27534 code, as the constant resolution moved.
27536 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27537 the metadata, so we can flag error 133.
27539 * decl.cs (MemberCore.UnsafeOK): New function to test that a
27540 pointer is being declared in an unsafe context.
27542 2002-01-16 Miguel de Icaza <miguel@ximian.com>
27544 * modifiers.cs (Modifiers.Check): Require a Location argument.
27545 Report error 227 for Unsafe use.
27547 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27549 * statement.cs (For.Emit): If the test is null, then report that
27550 we do `return', as we wont reach anything afterwards.
27552 (Switch.SwitchGoverningType): Track the expression that matched
27555 * driver.cs: Allow negative numbers as an error code to flag.
27557 * cs-parser.jay: Handle 1551.
27559 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27561 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27563 * cs-parser.jay: Report 1518 (type declaration can only contain
27564 class, struct, interface, enum or delegate)
27566 (switch_label): Report 1523 (keywords `case' or `default' must
27569 (opt_switch_sections): Report 1522 (empty switch)
27571 * driver.cs: Report 1515 (response file specified multiple times)
27572 Report 1516 (Source file specified multiple times).
27574 * expression.cs (Argument.Resolve): Signal 1510
27576 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27577 access not allowed in static code)
27579 2002-01-11 Ravi Pratap <ravi@ximian.com>
27581 * typemanager.cs (IsPointerType): Utility method which we are going
27584 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27585 the object type, so we take care of that.
27587 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27589 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27590 added to non-params parameters :-)
27592 * typemanager.cs (CSharpName): Include 'void' type too.
27594 (void_ptr_type): Include in the set of core types.
27596 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
27599 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
27602 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
27603 completely forgotten about it.
27605 2002-01-10 Ravi Pratap <ravi@ximian.com>
27607 * cs-parser.jay (pointer_type): Add. This begins our implementation
27608 of parsing rules for unsafe code.
27610 (unsafe_statement): Implement.
27612 (embedded_statement): Modify to include the above.
27614 * statement.cs (Unsafe): Implement new class for unsafe blocks.
27616 * codegen.cs (EmitContext.InUnsafe): Add. This determines
27617 if the current context is an unsafe one.
27619 * cs-parser.jay (local_variable_pointer_type): Since local variable types
27620 are handled differently, we need separate rules for them.
27622 (local_variable_declaration): Update to use local_variable_pointer_type
27623 to allow variable declarations of unmanaged pointer types.
27625 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27626 in unsafe contexts.
27628 * ../errors/cs0214.cs : Add.
27630 2002-01-16 Nick Drochak <ndrochak@gol.com>
27632 * makefile: remove 'response' file when cleaning.
27634 2002-01-15 Miguel de Icaza <miguel@ximian.com>
27636 * cs-parser.jay: Report 1524.
27638 2002-01-14 Miguel de Icaza <miguel@ximian.com>
27640 * typemanager.cs (RegisterMethod): drop checking if we have
27641 registered this from here
27643 2002-01-12 Miguel de Icaza <miguel@ximian.com>
27645 * class.cs (Method.EmitDestructor): Implement calling our base
27648 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27649 value of InFinally.
27651 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27652 this routine and will wrap the call in a try/catch block. Deal
27655 2002-01-11 Miguel de Icaza <miguel@ximian.com>
27657 * ecore.cs (Expression.MemberLookup): instead of taking a
27658 parameter `same_type' that was used to tell whether we could
27659 access private members we compute our containing type from the
27662 (FieldExpr): Added partial support for volatile fields. This does
27663 not work for volatile fields exposed from assemblies, as I can not
27664 figure out how to extract the modreq from it.
27666 Updated all the source files to use this.
27668 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27669 because it is referenced by MemberLookup very often.
27671 2002-01-09 Ravi Pratap <ravi@ximian.com>
27673 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27674 TypeBuilder.GetCustomAttributes to retrieve what we need.
27676 Get rid of redundant default_member_attr_type as this is the same as
27677 default_member_type which already exists.
27679 * interface.cs, attribute.cs : Update accordingly.
27681 2002-01-08 Miguel de Icaza <miguel@ximian.com>
27683 * typemanager.cs: Enable IndexerPropertyName again. It does not
27684 work for TYpeBuilders though. Ravi, can you please fix this?
27686 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27688 * expression.cs (Argument.Emit): Handle the case of ref objects
27689 being passed to ref functions;
27691 (ParameterReference.EmitLoad): Loads the content of the pointer
27692 without dereferencing.
27694 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27696 * cs-tokenizer.cs: Implemented the pre-processing expressions.
27698 2002-01-08 Ravi Pratap <ravi@ximian.com>
27700 * class.cs (Indexer.DefineMethod): Incorporate the interface
27701 type in the name of the method if we are doing explicit interface
27704 * expression.cs (ConversionExists): Remove as it is completely obsolete.
27706 (BetterConversion): Fix extremely trivial bug where we were referring to
27707 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27710 * ../errors/bug16.cs : Add although we have fixed it.
27712 2002-01-07 Miguel de Icaza <miguel@ximian.com>
27714 * expression.cs (BaseIndexer): Begin implementation.
27716 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27718 * cs-parser.jay (indexer_declarator): Use qualified_identifier
27719 production directly to remove a shift/reduce, and implement
27720 explicit interface implementation.
27722 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27723 after a floating point suffix.
27725 * expression.cs (DoNumericPromotions): Improved the conversion for
27726 uint/uint. If we have a constant, we avoid doing a typecast to a
27729 * class.cs (Indexer): Implement explicit interface implementation
27732 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27734 * class.cs: make the default instance constructor public and hidebysig.
27736 2001-01-03 Ravi Pratap <ravi@ximian.com>
27738 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27739 so we can call it from elsewhere.
27741 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27742 we emit it internally if the class has a defined indexer; otherwise the user
27743 emits it by decorating the class definition with the DefaultMemberAttribute.
27745 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27746 attribute is not used on a type which defines an indexer.
27748 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27749 character when we skip whitespace.
27751 * ../errors/cs0646.cs : Add.
27753 2002-01-03 Miguel de Icaza <miguel@ximian.com>
27755 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27758 * makefile: Add practical target `mcs3.exe' which builds the third
27759 generation compiler.
27761 * expression.cs (New): Fix structures constructor calling.
27763 * class.cs (Property, Method, Indexer): Emit Final flag on the
27764 method if we are an interface implementation and we are not
27767 * ecore.cs (PropertyExpr): New public field `IsBase', tells
27768 whether this property is referencing a `base' method.
27770 * expression.cs (Invocation.EmitCall): take an extra argument:
27771 is_base, this is used to determine whether the `call' or
27772 `callvirt' opcode should be used.
27775 * delegate.cs: update EmitCall.
27777 * class.cs (Method.Define): Set NewSlot for the cases where we are
27778 not implementing an interface method.
27780 (Property.Define): ditto.
27782 2002-01-02 Miguel de Icaza <miguel@ximian.com>
27784 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27785 'r'. Allows mcs to parse itself fully.
27787 2002-01-02 Ravi Pratap <ravi@ximian.com>
27789 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27790 of the number of initializers that require the InitializeArray method.
27792 (CheckIndices): Store the Expression in all cases - not the plain value. Also
27793 update the above field where necessary.
27795 (MakeByteBlob): Update accordingly.
27797 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
27800 (EmitDynamicInitializers): Update in accordance with the new optimization.
27802 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27803 same OpCode applies.
27805 * cs-parser.jay : Fix some glaring errors I introduced.
27807 2002-01-01 Ravi Pratap <ravi@ximian.com>
27809 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27810 so that we can check for name clashes there too.
27812 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27813 for interface indexers.
27815 * interfaces.cs (Define): Emit the default member attribute.
27817 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27818 variable was being referred to while setting the value ;-)
27820 2002-01-01 Miguel de Icaza <miguel@ximian.com>
27822 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27823 byte-by-byte information when we know the data is zero.
27825 Make the block always a multiple of 4, because
27826 DefineInitializedData has a bug.
27828 * assign.cs: Fix, we should assign from the temporary, not from
27831 * expression.cs (MakeByteBlob): Fix my incorrect code.
27833 2001-12-31 Miguel de Icaza <miguel@ximian.com>
27835 * typemanager.cs (EnumToUnderlying): This function is used to get
27836 the underlying type from an enumeration, because it does not
27839 * constant.cs: Use the I4_S form for values between -128 and 127.
27841 * statement.cs (Block.LookupLabel): Looks up a label.
27842 (Block): Drop support for labeled blocks.
27844 (LabeledStatement): New kind of statement that represents a label
27847 (Goto): Finally implement this bad boy.
27849 * cs-parser.jay: Update to reflect new mechanism to implement
27852 2001-12-30 Miguel de Icaza <miguel@ximian.com>
27854 * codegen.cs (EmitContext.This): a codegen property that keeps the
27855 a single instance of this instead of creating many different this
27858 * delegate.cs (Delegate.DoResolve): Update to use the property;
27860 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27862 * expression.cs (BaseAccess.DoResolve): Ditto.
27864 2001-12-29 Ravi Pratap <ravi@ximian.com>
27866 * typemanager.cs (methodimpl_attr_type): Add to hold the type
27867 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27869 (InitCoreTypes): Update accordingly.
27871 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27872 so we can quickly store the state.
27874 (ApplyAttributes): Set the correct implementation flags
27875 for InternalCall methods.
27877 2001-12-29 Miguel de Icaza <miguel@ximian.com>
27879 * expression.cs (EmitCall): if a method is not virtual, then do
27880 not use callvirt on it.
27882 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27883 user defined stuff) requires the use of stobj, which takes an
27884 address on the stack instead of an array and an index. So emit
27885 the Ldelema operation for it.
27887 (EmitStoreOpcode): Use stobj for valuetypes.
27889 (UnaryMutator.EmitCode): Use the right 1 value depending on
27890 whether we are dealing with int64/uint64, float or doubles.
27892 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27893 constructors that I implemented last night.
27895 (Constructor.IsDefault): Fix to work properly for static
27898 * cs-parser.jay (CheckDef): report method signature errors.
27899 Update error number 103 to be 132.
27901 * decl.cs: New AdditionResult enumeration value: MethodExists.
27902 Although we do this check for methods later on in the semantic
27903 analysis, catching repeated default constructors is so easy that
27904 we catch these here.
27906 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27909 (ParameterReference.EmitAssign, Emit): handle
27912 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27913 (ArrayAccess.EmitStoreOpcode): ditto.
27915 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27917 * expression.cs (MakeByteBlob): Complete all the missing types
27918 (uint, short, ushort, byte, sbyte)
27920 * class.cs: Only init instance field initializers on instance
27923 Rename `constructors' to instance_constructors.
27925 (TypeContainer.AddConstructor): Only add constructors to the list
27926 if it is not static.
27928 Make sure that we handle default_static_constructor independently
27929 everywhere where we handle instance_constructors
27931 2001-12-28 Miguel de Icaza <miguel@ximian.com>
27933 * class.cs: Do not lookup or create a base initializer for a
27934 static constructor.
27936 (ConstructorInitializer.Resolve): use the proper type to lookup
27939 * cs-parser.jay: Report error 1585 (modifiers between type and name).
27941 * enum.cs, interface.cs: Remove CloseType, this is taken care by
27944 * decl.cs: CloseType is now an virtual method, the default
27945 implementation just closes this type.
27947 2001-12-28 Ravi Pratap <ravi@ximian.com>
27949 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27950 to PreserveSig by default. Also emit HideBySig on such methods.
27952 Basically, set the defaults to standard values.
27954 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27955 argument, if candidate is better, it can't be worse than the best !
27957 (Invocation): Re-write bits to differentiate between methods being
27958 applicable in their expanded form and their normal form - for params
27961 Get rid of use_standard everywhere as only standard conversions are allowed
27962 in overload resolution.
27964 More spec conformance.
27966 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27968 * driver.cs: Add --timestamp, to see where the compiler spends
27971 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27972 `this' in static code.
27974 (SimpleName.DoResolve): Implement in terms of a helper function
27975 that allows static-references to be passed upstream to
27978 (Expression.ResolveWithSimpleName): Resolve specially simple
27979 names when called by MemberAccess to implement the special
27982 (Expression.ImplicitReferenceConversion): Handle conversions from
27983 Null to reference types before others, as Null's type is
27986 * expression.cs (Invocation.EmitCall): Handle the special case of
27987 calling methods declared on a reference type from a ValueType
27988 (Base classes System.Object and System.Enum)
27990 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27991 the left hand side is a TypeExpr, not on every enumeration.
27993 (Binary.Resolve): If types are reference types, then do a cast to
27994 object on operators != and == of both arguments.
27996 * typemanager.cs (FindMembers): Extract instance and static
27997 members if requested.
27999 * interface.cs (PopulateProperty): Use void_type instead of null
28000 as the return type for the setter method.
28002 (PopulateIndexer): ditto.
28004 2001-12-27 Ravi Pratap <ravi@ximian.com>
28006 * support.cs (ReflectionParameters): Fix minor bug where we
28007 were examining the wrong parameter for the ParamArray attribute.
28009 Cope with requests for the type of the parameter at position
28010 greater than the params parameter's. We now return the element
28011 type of the params array as that makes more sense.
28013 * expression.cs (Invocation.IsParamsMethodApplicable): Update
28014 accordingly as we no longer have to extract the element type
28017 (Invocation.OverloadResolve): Update.
28019 2001-12-27 Miguel de Icaza <miguel@ximian.com>
28021 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
28022 against IEnumerator, test whether the return value is a descendant
28023 of the IEnumerator interface.
28025 * class.cs (Indexer.Define): Use an auxiliary method to implement
28026 the other bits of the method definition. Begin support for
28027 explicit interface implementation.
28029 (Property.DefineMethod): Use TypeManager.void_type instead of null
28030 for an empty return value.
28032 2001-12-26 Miguel de Icaza <miguel@ximian.com>
28034 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
28035 dealing with a FieldExpr which is composed of a FieldBuilder, in
28036 the code path we did extract the constant, but we should have
28037 obtained the underlying value to be able to cast it (otherwise we
28038 end up in an infinite loop, this is what Ravi was running into).
28040 (ArrayCreation.UpdateIndices): Arrays might be empty.
28042 (MemberAccess.ResolveMemberAccess): Add support for section
28043 14.5.4.1 that deals with the special case of E.I when E is a type
28044 and something else, that I can be a reference to a static member.
28046 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
28047 handle a particular array type to create byte blobs, it is just
28048 something we dont generate byteblobs for.
28050 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
28053 * location.cs (Push): remove the key from the hashtable that we
28054 are about to add. This happens for empty files.
28056 * driver.cs: Dispose files after we have parsed them.
28058 (tokenize): new function that only runs the tokenizer on its
28059 input, for speed testing.
28061 2001-12-26 Ravi Pratap <ravi@ximian.com>
28063 * class.cs (Event.Define): Define the private field only if there
28064 are no accessors defined.
28066 * expression.cs (ResolveMemberAccess): If there is no associated
28067 field with the event, that means we have an event defined with its
28068 own accessors and we should flag error cs0070 since transforming
28069 ourselves into a field is not valid in that case.
28071 * ecore.cs (SimpleName.DoResolve): Same as above.
28073 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
28074 and charset to sane values.
28076 2001-12-25 Ravi Pratap <ravi@ximian.com>
28078 * assign.cs (DoResolve): Perform check on events only if they
28079 are being accessed outside the declaring type.
28081 * cs-parser.jay (event_declarations): Update rules to correctly
28082 set the type of the implicit parameter etc.
28084 (add_accessor, remove_accessor): Set current local parameters.
28086 * expression.cs (Binary): For delegate addition and subtraction,
28087 cast the return value from the method into the appropriate delegate
28090 2001-12-24 Ravi Pratap <ravi@ximian.com>
28092 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
28093 of these as the workaround is unnecessary.
28095 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
28096 delegate data - none of that is needed at all.
28098 Re-write bits to extract the instance expression and the delegate method
28101 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
28104 * attribute.cs (ApplyAttributes): New method to take care of common tasks
28105 of attaching attributes instead of duplicating code everywhere.
28107 * everywhere : Update code to do attribute emission using the above method.
28109 2001-12-23 Miguel de Icaza <miguel@ximian.com>
28111 * expression.cs (IsParamsMethodApplicable): if there are not
28112 parameters, return immediately.
28114 * ecore.cs: The 0 literal can be implicity converted to an enum
28117 (SimpleName.DoResolve): First lookup the type, then lookup the
28120 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
28121 want to get its address. If the InstanceExpression is not
28122 addressable, store the result in a temporary variable, then get
28125 * codegen.cs: Only display 219 errors on warning level or above.
28127 * expression.cs (ArrayAccess): Make it implement the
28128 IMemoryLocation interface.
28130 (Binary.DoResolve): handle the operator == (object a, object b)
28131 and operator != (object a, object b) without incurring into a
28132 BoxedCast (because 5 != o should never be performed).
28134 Handle binary enumerator operators.
28136 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
28137 value type, otherwise use Ldelem_ref.
28139 Use precomputed names;
28141 (AddressOf): Implement address of
28143 * cs-parser.jay (labeled_statement): Fix recursive block
28144 addition by reworking the production.
28146 * expression.cs (New.DoEmit): New has a special case:
28148 If we are dealing with a ValueType, we have a few
28149 situations to deal with:
28151 * The target of New is a ValueType variable, that is
28152 easy, we just pass this as the variable reference
28154 * The target of New is being passed as an argument,
28155 to a boxing operation or a function that takes a
28158 In this case, we need to create a temporary variable
28159 that is the argument of New.
28162 2001-12-23 Ravi Pratap <ravi@ximian.com>
28164 * rootcontext.cs (LookupType): Check that current_type is not null before
28165 going about looking at nested types.
28167 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
28168 not implement the IAssignMethod interface any more.
28170 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
28171 where we tranform them into FieldExprs if they are being resolved from within
28172 the declaring type.
28174 * ecore.cs (SimpleName.DoResolve): Do the same here.
28176 * assign.cs (DoResolve, Emit): Clean up code considerably.
28178 * ../errors/bug10.cs : Add.
28180 * ../errors/cs0070.cs : Add.
28182 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
28184 * assign.cs : Get rid of EventIsLocal everywhere.
28186 2001-12-23 Miguel de Icaza <miguel@ximian.com>
28188 * ecore.cs (ConvertIntLiteral): finished the implementation.
28190 * statement.cs (SwitchLabel): Convert the value we are using as a
28191 key before looking up the table.
28193 2001-12-22 Miguel de Icaza <miguel@ximian.com>
28195 * codegen.cs (EmitTopBlock): Require a Location argument now.
28197 * cs-parser.jay (constructor_declarator): We need to setup
28198 current_local_parameters before we parse the
28199 opt_constructor_initializer, to allow the variables to be bound
28200 to the constructor arguments.
28202 * rootcontext.cs (LookupType): First lookup nested classes in our
28203 class and our parents before we go looking outside our class.
28205 * expression.cs (ConstantFold): Extract/debox the values at the
28208 * rootcontext.cs (EmitCode): Resolve the constants first before we
28209 resolve the types. This is not really needed, but it helps debugging.
28211 * statement.cs: report location.
28213 * cs-parser.jay: pass location to throw statement.
28215 * driver.cs: Small bug fix.
28217 * report.cs: Updated format to be 4-zero filled digits.
28219 2001-12-22 Ravi Pratap <ravi@ximian.com>
28221 * expression.cs (CheckIndices): Fix minor bug where the wrong
28222 variable was being referred to ;-)
28224 (DoEmit): Do not call EmitStaticInitializers when the
28225 underlying type is System.Object.
28227 2001-12-21 Ravi Pratap <ravi@ximian.com>
28229 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
28230 and do the usual workaround for SRE.
28232 * class.cs (MyEventBuilder.EventType): New member to get at the type
28233 of the event, quickly.
28235 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
28237 * assign.cs (Assign.DoResolve): Handle the case when the target
28238 is an EventExpr and perform the necessary checks.
28240 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
28243 (SimpleName.MemberStaticCheck): Include check for EventExpr.
28245 (EventExpr): Set the type in the constructor itself since we
28246 are meant to be born fully resolved.
28248 (EventExpr.Define): Revert code I wrote earlier.
28250 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
28251 instance expression is null. The instance expression is a This in that case
28252 or a null, depending on whether it is a static method or not.
28254 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
28255 refers to more than one method.
28257 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
28258 and accordingly flag errors.
28260 2001-12-21 Miguel de Icaza <miguel@ximian.com>
28262 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
28264 2001-12-22 Miguel de Icaza <miguel@ximian.com>
28266 * location.cs (ToString): Provide useful rutine.
28268 2001-12-21 Miguel de Icaza <miguel@ximian.com>
28270 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
28271 objects, return the actual integral boxed.
28273 * statement.cs (SwitchLabel): define an ILLabel for each
28276 (Switch.CheckSwitch): If the value is a Literal, extract
28277 the underlying literal.
28279 Also in the unused hashtable we had, add the SwitchLabel so we can
28280 quickly look this value up.
28282 * constant.cs: Implement a bunch of new constants. Rewrite
28283 Literal based on this. Made changes everywhere to adapt to this.
28285 * expression.cs (Expression.MakeByteBlob): Optimize routine by
28286 dereferencing array only once, and also copes with enumrations.
28288 bytes are two bytes wide, not one.
28290 (Cast): Perform constant conversions.
28292 * ecore.cs (TryImplicitIntConversion): Return literals instead of
28293 wrappers to the literals here.
28295 * expression.cs (DoNumericPromotions): long literals can converted
28296 to ulong implicity (this is taken care of elsewhere, but I was
28297 missing this spot).
28299 * ecore.cs (Expression.Literalize): Make the return type Literal,
28300 to improve type checking.
28302 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
28304 2001-12-20 Miguel de Icaza <miguel@ximian.com>
28306 * literal.cs: Revert code from ravi that checked the bounds. The
28307 bounds are sane by the definition of the type itself.
28309 * typemanager.cs: Fix implementation of ImplementsInterface. We
28310 need to actually look up in our parent hierarchy for interfaces
28313 * const.cs: Use the underlying type for enumerations
28315 * delegate.cs: Compute the basename for the delegate creation,
28316 that should fix the delegate test case, and restore the correct
28317 Type Lookup semantics in rootcontext
28319 * rootcontext.cs: Revert Ravi's last patch. The correct way of
28320 referencing a nested type with the Reflection API is using the "+"
28323 * cs-parser.jay: Do not require EOF token at the end.
28325 2001-12-20 Ravi Pratap <ravi@ximian.com>
28327 * rootcontext.cs (LookupType): Concatenate type names with
28328 a '.' instead of a '+' The test suite passes again.
28330 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
28331 field of the enumeration.
28333 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
28334 the case when the member is an EventExpr.
28336 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
28337 static has an associated instance expression.
28339 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
28341 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
28343 * class.cs (Event.Define): Register event and perform appropriate checks
28346 We define the Add and Remove methods even if the use provides none because
28347 in that case, we provide default implementations ourselves.
28349 Define a private field of the type of the event. This is done by the CSC compiler
28350 and we should be doing it too ;-)
28352 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
28353 More methods we use in code we generate.
28355 (multicast_delegate_type, delegate_type): Two separate types since the distinction
28358 (InitCoreTypes): Update accordingly for the above.
28360 * class.cs (Event.Emit): Generate code for default accessors that we provide
28362 (EmitDefaultMethod): Do the job in the above.
28364 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
28367 2001-12-20 Miguel de Icaza <miguel@ximian.com>
28369 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
28370 builders even if we were missing one.
28372 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
28373 pass the Basename as our class name instead of the Name. The
28374 basename will be correctly composed for us.
28376 * parameter.cs (Paramters): Now takes a Location argument.
28378 * decl.cs (DeclSpace.LookupType): Removed convenience function and
28379 make all the code call directly LookupType in RootContext and take
28380 this chance to pass the Location information everywhere.
28382 * Everywhere: pass Location information.
28384 2001-12-19 Miguel de Icaza <miguel@ximian.com>
28386 * class.cs (Constructor.Define): Updated way of detecting the
28387 length of the parameters.
28389 (TypeContainer.DefineType): Use basename as the type name for
28392 (TypeContainer.Define): Do not recursively define types here, as
28393 definition is taken care in order by the RootContext.
28395 * tree.cs: Keep track of namespaces in a per-file basis.
28397 * parameter.cs (Parameter.ComputeSignature): Update to use
28400 (Parameters.GetSignature): ditto.
28402 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28403 instead of a TypeContainer.
28405 (Interface.SemanticAnalysis): Use `this' instead of our parent to
28406 resolve names. Because we need to be resolve in our context, not
28409 * driver.cs: Implement response files.
28411 * class.cs (TypeContainer.DefineType): If we are defined, do not
28412 redefine ourselves.
28414 (Event.Emit): Emit the code for add/remove handlers.
28415 (Event.Define): Save the MethodBuilders for add/remove.
28417 * typemanager.cs: Use pair here too.
28419 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28420 DictionaryEntry requires the first argument to be non-null.
28422 (enum_declaration): Compute full name for registering the
28425 (delegate_declaration): Instead of using
28426 formal_parameter_list, use opt_formal_parameter_list as the list
28429 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28430 (EventParsing): New property that controls whether `add' and
28431 `remove' are returned as tokens or identifiers (for events);
28433 2001-12-19 Ravi Pratap <ravi@ximian.com>
28435 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28436 use MyEventBuilder only and let it wrap the real builder for us.
28438 (MyEventBuilder): Revamp constructor etc.
28440 Implement all operations that we perform on EventBuilder in precisely the same
28443 (FindMembers): Update to use the EventBuilder member.
28445 (Event.Emit): Update accordingly.
28447 2001-12-18 Ravi Pratap <ravi@ximian.com>
28449 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28450 by calling the appropriate methods.
28452 (GetCustomAttributes): Make stubs as they cannot possibly do anything
28455 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28457 2001-12-17 Ravi Pratap <ravi@ximian.com>
28459 * delegate.cs (Delegate.Populate): Check that the return type
28460 and various parameters types are indeed accessible.
28462 * class.cs (Constructor.Define): Same here.
28464 (Field.Define): Ditto.
28466 (Event.Define): Ditto.
28468 (Operator.Define): Check that the underlying Method defined itself
28469 correctly - so it's MethodBuilder should not be null.
28471 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28472 expression happens to be null.
28474 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28475 members but as of now we don't seem to be able to do anything really useful with it.
28477 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28478 not the EventBuilder.
28480 2001-12-18 Miguel de Icaza <miguel@ximian.com>
28482 * cs-tokenizer.cs: Add support for defines.
28483 Add support for #if, #elif, #else, #endif
28485 (eval_var): evaluates a variable.
28486 (eval): stubbed for evaluating functions.
28488 * cs-parser.jay: Pass the defines information
28490 * driver.cs: Add --define command line option.
28492 * decl.cs: Move MemberCore here.
28494 Make it the base class for DeclSpace. This allows us to catch and
28495 report 108 and 109 for everything now.
28497 * class.cs (TypeContainer.Define): Extract all the members
28498 before populating and emit the warning 108 (new keyword required
28499 to override) instead of having each member implement this.
28501 (MemberCore.Define): New abstract method, we will be using this in
28502 the warning reporting engine in Populate.
28504 (Operator.Define): Adjust to new MemberCore protocol.
28506 * const.cs (Const): This does not derive from Expression, it is a
28507 temporary object we use to create fields, it is a MemberCore.
28509 * class.cs (Method.Define): Allow the entry point to be in a
28512 * driver.cs: Rewrite the argument handler to clean it up a bit.
28514 * rootcontext.cs: Made it just an auxiliary namespace feature by
28515 making everything static.
28517 * driver.cs: Adapt code to use RootContext type name instead of
28520 * delegate.cs: Remove RootContext argument.
28522 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28525 * class.cs (Event.Define): The lookup can fail.
28527 * cs-tokenizer.cs: Begin implementation of pre-procesor.
28529 * expression.cs: Resolve the this instance before invoking the code.
28531 2001-12-17 Miguel de Icaza <miguel@ximian.com>
28533 * cs-parser.jay: Add a production in element_access that allows
28534 the thing to become a "type" reference. This way we can parse
28535 things like "(string [])" as a type.
28537 Note that this still does not handle the more complex rules of
28541 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
28543 * ecore.cs: (CopyNewMethods): new utility function used to
28544 assemble the list of methods from running FindMembers.
28546 (MemberLookup): Rework FindMembers so that
28548 2001-12-16 Miguel de Icaza <miguel@ximian.com>
28550 * class.cs (TypeContainer): Remove Delegates who fail to be
28553 * delegate.cs (Populate): Verify that we dont get null return
28554 values. TODO: Check for AsAccessible.
28556 * cs-parser.jay: Use basename to emit error 574 (destructor should
28557 have the same name as container class), not the full name.
28559 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28560 possible representation.
28562 Also implements integer type suffixes U and L.
28564 2001-12-15 Miguel de Icaza <miguel@ximian.com>
28566 * expression.cs (ArrayCreation.DoResolve): We need to do the
28567 argument resolution *always*.
28569 * decl.cs: Make this hold the namespace. Hold the root context as
28571 (LookupType): Move here.
28573 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28575 * location.cs (Row, Name): Fixed the code, it was always returning
28576 references to the first file.
28578 * interface.cs: Register properties defined through interfaces.
28580 * driver.cs: Add support for globbing on the command line
28582 * class.cs (Field): Make it derive from MemberCore as well.
28585 2001-12-15 Ravi Pratap <ravi@ximian.com>
28587 * class.cs (Event::Define): Check that the type of the event is a delegate
28588 type else flag error #66.
28590 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28593 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28594 values of EntryPoint, CharSet etc etc.
28596 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28598 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28599 be null and we should ignore this. I am not sure if this is really clean. Apparently,
28600 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28601 which needs this to do its work.
28603 * ../errors/cs0066.cs : Add.
28605 2001-12-14 Miguel de Icaza <miguel@ximian.com>
28607 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28610 * class.cs: (MethodSignature.MethodSignature): Removed hack that
28611 clears out the parameters field.
28612 (MemberSignatureCompare): Cleanup
28614 (MemberCore): New base class used to share code between MethodCore
28617 (RegisterRequiredImplementations) BindingFlags.Public requires
28618 either BindingFlags.Instace or Static. Use instance here.
28620 (Property): Refactored code to cope better with the full spec.
28622 * parameter.cs (GetParameterInfo): Return an empty array instead
28625 * class.cs (Property): Abstract or extern properties have no bodies.
28627 * parameter.cs (GetParameterInfo): return a zero-sized array.
28629 * class.cs (TypeContainer.MethodModifiersValid): Move all the
28630 method modifier validation to the typecontainer so we can reuse
28631 this on properties.
28633 (MethodCore.ParameterTypes): return an empty sized array of types.
28635 (Property.Define): Test property modifier validity.
28637 Add tests for sealed/override too.
28639 (Method.Emit): abstract or extern methods have no bodies.
28641 2001-12-14 Ravi Pratap <ravi@ximian.com>
28643 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28646 (Method::Define, ::Emit): Modify accordingly.
28648 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28650 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28652 * makefile: Pass in /unsafe.
28654 2001-12-13 Miguel de Icaza <miguel@ximian.com>
28656 * class.cs (MakeKey): Kill routine.
28658 * class.cs (TypeContainer.Define): Correctly define explicit
28659 method implementations (they require the full interface name plus
28662 * typemanager.cs: Deply the PtrHashtable here and stop using the
28663 lame keys. Things work so much better.
28665 This of course broke everyone who depended on `RegisterMethod' to
28666 do the `test for existance' test. This has to be done elsewhere.
28668 * support.cs (PtrHashtable): A hashtable that avoid comparing with
28669 the object stupid Equals method (because, that like fails all over
28670 the place). We still do not use it.
28672 * class.cs (TypeContainer.SetRequiredInterface,
28673 TypeContainer.RequireMethods): Killed these two routines and moved
28674 all the functionality to RegisterRequiredImplementations.
28676 (TypeContainer.RegisterRequiredImplementations): This routine now
28677 registers all the implementations required in an array for the
28678 interfaces and abstract methods. We use an array of structures
28679 which can be computed ahead of time to reduce memory usage and we
28680 also assume that lookups are cheap as most classes will not
28681 implement too many interfaces.
28683 We also avoid creating too many MethodSignatures.
28685 (TypeContainer.IsInterfaceMethod): Update and optionally does not
28686 clear the "pending" bit if we find that there are problems with
28689 (TypeContainer.VerifyPendingMethods): Update to report errors of
28690 methods that look like implementations but are not.
28692 (TypeContainer.Define): Add support for explicit interface method
28695 2001-12-12 Miguel de Icaza <miguel@ximian.com>
28697 * typemanager.cs: Keep track of the parameters here instead of
28698 being a feature of the TypeContainer.
28700 * class.cs: Drop the registration of parameters here, as
28701 InterfaceMethods are also interface declarations.
28703 * delegate.cs: Register methods with the TypeManager not only with
28704 the TypeContainer. This code was buggy.
28706 * interface.cs: Full registation here.
28708 2001-12-11 Miguel de Icaza <miguel@ximian.com>
28710 * expression.cs: Remove reducer for binary expressions, it can not
28713 * const.cs: Put here the code that used to go into constant.cs
28715 * constant.cs: Put here the code for constants, this is a new base
28716 class for Literals.
28718 * literal.cs: Make Literal derive from Constant.
28720 2001-12-09 Miguel de Icaza <miguel@ximian.com>
28722 * statement.cs (Return.Emit): Report error 157 if the user
28723 attempts to return from a finally block.
28725 (Return.Emit): Instead of emitting a return, jump to the end of
28728 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28729 LocalBuilder to store the result of the function. ReturnLabel is
28730 the target where we jump.
28733 2001-12-09 Radek Doulik <rodo@ximian.com>
28735 * cs-parser.jay: remember alias in current namespace
28737 * ecore.cs (SimpleName::DoResolve): use aliases for types or
28740 * class.cs (LookupAlias): lookup alias in my_namespace
28742 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28744 (LookupAlias): lookup alias in this and if needed in parent
28747 2001-12-08 Miguel de Icaza <miguel@ximian.com>
28751 * rootcontext.cs: (ModuleBuilder) Made static, first step into
28752 making things static. I need this to avoid passing the
28753 TypeContainer when calling ParameterType.
28755 * support.cs (InternalParameters.ParameterType): Remove ugly hack
28756 that did string manipulation to compute the type and then call
28757 GetType. Use Parameter.ParameterType instead.
28759 * cs-tokenizer.cs: Consume the suffix for floating values.
28761 * expression.cs (ParameterReference): figure out whether this is a
28762 reference parameter or not. Kill an extra variable by computing
28763 the arg_idx during emission.
28765 * parameter.cs (Parameters.GetParameterInfo): New overloaded
28766 function that returns whether a parameter is an out/ref value or not.
28768 (Parameter.ParameterType): The type of the parameter (base,
28769 without ref/out applied).
28771 (Parameter.Resolve): Perform resolution here.
28772 (Parameter.ExternalType): The full type (with ref/out applied).
28774 * statement.cs (Using.Emit, Using.EmitExpression): Implement
28775 support for expressions on the using statement.
28777 2001-12-07 Miguel de Icaza <miguel@ximian.com>
28779 * statement.cs (Using.EmitLocalVariableDecls): Split the
28780 localvariable handling of the using statement.
28782 (Block.EmitMeta): Keep track of variable count across blocks. We
28783 were reusing slots on separate branches of blocks.
28785 (Try.Emit): Emit the general code block, we were not emitting it.
28787 Check the type of the declaration to be an IDisposable or
28788 something that can be implicity converted to it.
28790 Emit conversions if required.
28792 * ecore.cs (EmptyExpression): New utility class.
28793 (Expression.ImplicitConversionExists): New utility function.
28795 2001-12-06 Miguel de Icaza <miguel@ximian.com>
28797 * statement.cs (Using): Implement.
28799 * expression.cs (LocalVariableReference): Support read only variables.
28801 * statement.cs: Remove the explicit emit for the Leave opcode.
28802 (VariableInfo): Add a readonly field.
28804 2001-12-05 Miguel de Icaza <miguel@ximian.com>
28806 * ecore.cs (ConvCast): new class used to encapsulate the various
28807 explicit integer conversions that works in both checked and
28808 unchecked contexts.
28810 (Expression.ConvertNumericExplicit): Use new ConvCast class to
28811 properly generate the overflow opcodes.
28813 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28815 * statement.cs: The correct type for the EmptyExpression is the
28816 element_type, not the variable type. Ravi pointed this out.
28818 2001-12-04 Ravi Pratap <ravi@ximian.com>
28820 * class.cs (Method::Define): Handle PInvoke methods specially
28821 by using DefinePInvokeMethod instead of the usual one.
28823 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28824 above to do the task of extracting information and defining the method.
28826 2001-12-04 Ravi Pratap <ravi@ximian.com>
28828 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28829 of the condition for string type.
28831 (Emit): Move that here.
28833 (ArrayCreation::CheckIndices): Keep string literals in their expression
28836 (EmitDynamicInitializers): Handle strings appropriately.
28838 2001-12-04 Miguel de Icaza <miguel@ximian.com>
28840 * codegen.cs (EmitContext): Replace multiple variables with a
28841 single pointer to the current Switch statement.
28843 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28846 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28850 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28853 (Foreach.Emit): Foreach on arrays was not setting
28854 up the loop variables (for break/continue).
28856 (GotoCase): Semi-implented.
28858 2001-12-03 Ravi Pratap <ravi@ximian.com>
28860 * attribute.cs (CheckAttribute): Handle system attributes by using
28861 Attribute.GetAttributes to examine information we need.
28863 (GetValidPlaces): Same here.
28865 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28867 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28869 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28871 (Method::Define): Set appropriate flags if we have a DllImport attribute.
28873 (Method::Emit): Handle the case when we are a PInvoke method.
28875 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28877 * expression.cs: Use ResolveWithSimpleName on compound names.
28879 2001-12-02 Ravi Pratap <ravi@ximian.com>
28881 * constant.cs (EmitConstant): Make sure we resolve the associated expression
28882 before trying to reduce it.
28884 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28886 * constant.cs (LookupConstantValue): Implement.
28888 (EmitConstant): Use the above in emitting the constant.
28890 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28891 that are user-defined by doing a LookupConstantValue on them.
28893 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28896 2001-11-29 Miguel de Icaza <miguel@ximian.com>
28898 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28900 (BaseAccess.DoResolve): Implement.
28902 (MemberAccess.DoResolve): Split this routine into a
28903 ResolveMemberAccess routine that can be used independently
28905 2001-11-28 Miguel de Icaza <miguel@ximian.com>
28907 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28908 As that share bits of the implementation. Is returns a boolean,
28909 while As returns the Type that is being probed.
28911 2001-12-01 Ravi Pratap <ravi@ximian.com>
28913 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28914 instead of a Literal - much easier.
28916 (EnumInTransit): Remove - utterly useless :-)
28918 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28920 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28922 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28923 chain when we have no associated expression.
28925 2001-11-30 Ravi Pratap <ravi@ximian.com>
28927 * constant.cs (Define): Use Location while reporting the errror.
28929 Also emit a warning when 'new' is used and there is no inherited
28932 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
28935 (LookupEnumValue): Implement to lookup an enum member's value and define it
28938 (Populate): Re-write accordingly to use the above routine.
28940 2001-11-27 Miguel de Icaza <miguel@ximian.com>
28942 * expression.cs (This): Fix prototype for DoResolveLValue to
28943 override the base class DoResolveLValue.
28945 * cs-parser.cs: Report errors cs574 and cs575 (destructor
28948 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28949 (we need to load the address of the field here). This fixes
28952 (FieldExpr.DoResolveLValue): Call the DoResolve
28953 function to initialize the Instance expression.
28955 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28956 correctly the GetEnumerator operation on a value type.
28958 * cs-parser.jay: Add more simple parsing error catches.
28960 * statement.cs (Switch): Add support for string switches.
28961 Handle null specially.
28963 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
28965 2001-11-28 Ravi Pratap <ravi@ximian.com>
28967 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28969 (declare_local_constant): New helper function.
28971 * statement.cs (AddConstant): Keep a separate record of constants
28973 (IsConstant): Implement to determine if a variable is a constant.
28975 (GetConstantExpression): Implement.
28977 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28979 * statement.cs (IsVariableDefined): Re-write.
28981 2001-11-27 Ravi Pratap <ravi@ximian.com>
28983 * class.cs (TypeContainer::FindMembers): Look for constants
28984 in the case when we are looking for MemberTypes.Field
28986 * expression.cs (MemberAccess::DoResolve): Check that in the
28987 case we are a FieldExpr and a Literal, we are not being accessed
28988 by an instance reference.
28990 * cs-parser.jay (local_constant_declaration): Implement.
28992 (declaration_statement): Implement for constant declarations.
28994 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28996 * statement.cs (Switch): Catch double defaults.
28998 (Switch): More work on the switch() statement
28999 implementation. It works for integral values now, need to finish
29003 2001-11-24 Miguel de Icaza <miguel@ximian.com>
29005 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
29006 integer literals into other integer literals. To be used by
29009 2001-11-24 Ravi Pratap <ravi@ximian.com>
29011 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
29014 (EmitDynamicInitializers): Cope with the above since we extract data
29015 directly from ArrayData now.
29017 (ExpectInitializers): Keep track of whether initializers are mandatory
29020 (Bounds): Make it a hashtable to prevent the same dimension being
29021 recorded for every element in that dimension.
29023 (EmitDynamicInitializers): Fix bug which prevented the Set array method
29026 Also fix bug which was causing the indices to be emitted in the reverse
29029 2001-11-24 Miguel de Icaza <miguel@ximian.com>
29031 * expression.cs (ArrayCreation): Implement the bits that Ravi left
29032 unfinished. They do not work, because the underlying code is
29035 2001-11-22 Miguel de Icaza <miguel@ximian.com>
29037 * cs-parser.jay: Remove bogus fixme.
29039 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
29040 on Switch statement.
29042 2001-11-23 Ravi Pratap <ravi@ximian.com>
29044 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
29047 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
29048 parameter. Apparently, any expression is allowed.
29050 (ValidateInitializers): Update accordingly.
29052 (CheckIndices): Fix some tricky bugs thanks to recursion.
29054 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
29055 I was being completely brain-dead.
29057 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
29058 and re-write acordingly.
29060 (DelegateInvocation): Re-write accordingly.
29062 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
29064 (MakeByteBlob): Handle types more correctly.
29066 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
29067 initialization from expressions but it is incomplete because I am a complete
29070 2001-11-22 Miguel de Icaza <miguel@ximian.com>
29072 * statement.cs (If.Emit): Fix a bug that generated incorrect code
29073 on If. Basically, we have to return `true' (ie, we do return to
29074 our caller) only if both branches of the if return.
29076 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
29077 short-circuit operators, handle them as short circuit operators.
29079 (Cast.DoResolve): Resolve type.
29080 (Cast.Cast): Take an expression as the target type.
29082 * cs-parser.jay (cast_expression): Remove old hack that only
29083 allowed a limited set of types to be handled. Now we take a
29084 unary_expression and we resolve to a type during semantic
29087 Use the grammar productions from Rhys to handle casts (this is
29088 not complete like Rhys syntax yet, we fail to handle that corner
29089 case that C# has regarding (-x), but we will get there.
29091 2001-11-22 Ravi Pratap <ravi@ximian.com>
29093 * class.cs (EmitFieldInitializer): Take care of the case when we have a
29094 field which is an array type.
29096 * cs-parser.jay (declare_local_variables): Support array initialization too.
29098 * typemanager.cs (MakeKey): Implement.
29100 (everywhere): Use the above appropriately.
29102 * cs-parser.jay (for_statement): Update for array initialization while
29103 declaring variables.
29105 * ecore.cs : The error message was correct, it's the variable's names that
29106 were misleading ;-) Make the code more readable.
29108 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
29109 the correct type etc.
29111 (ConvertExplicit): Handle Enum types by examining the underlying type.
29113 2001-11-21 Ravi Pratap <ravi@ximian.com>
29115 * parameter.cs (GetCallingConvention): Always return
29116 CallingConventions.Standard for now.
29118 2001-11-22 Miguel de Icaza <miguel@ximian.com>
29120 * expression.cs (Binary.ResolveOperator): Update the values of `l'
29121 and `r' after calling DoNumericPromotions.
29123 * ecore.cs: Fix error message (the types were in the wrong order).
29125 * statement.cs (Foreach.ProbeCollectionType): Need to pass
29126 BindingFlags.Instance as well
29128 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
29129 implicit int literal conversion in an empty cast so that we
29130 propagate the right type upstream.
29132 (UnboxCast): new class used to unbox value types.
29133 (Expression.ConvertExplicit): Add explicit type conversions done
29136 (Expression.ImplicitNumericConversion): Oops, forgot to test for
29137 the target type before applying the implicit LongLiterals to ULong
29140 2001-11-21 Miguel de Icaza <miguel@ximian.com>
29142 * cs-parser.jay (for_statement): Reworked the way For works: now
29143 we declare manually any variables that are introduced in
29144 for_initializer to solve the problem of having out-of-band code
29145 emition (that is what got for broken).
29147 (declaration_statement): Perform the actual variable declaration
29148 that used to be done in local_variable_declaration here.
29150 (local_variable_declaration): Do not declare anything, just pass
29151 the information on a DictionaryEntry
29153 2001-11-20 Ravi Pratap <ravi@ximian.com>
29155 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
29156 re-write of the logic to now make it recursive.
29158 (UpdateIndices): Re-write accordingly.
29160 Store element data in a separate ArrayData list in the above methods.
29162 (MakeByteBlob): Implement to dump the array data into a byte array.
29164 2001-11-19 Ravi Pratap <ravi@ximian.com>
29166 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
29169 * constant.cs (Define): Implement.
29171 (EmitConstant): Re-write fully.
29173 Pass in location info.
29175 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
29178 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
29179 DictionaryEntry since we need location info too.
29181 (constant_declaration): Update accordingly.
29183 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
29184 code into another method : UpdateIndices.
29186 2001-11-18 Ravi Pratap <ravi@ximian.com>
29188 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
29189 some type checking etc.
29191 2001-11-17 Ravi Pratap <ravi@ximian.com>
29193 * expression.cs (ArrayCreation::ValidateInitializers): Implement
29194 bits to provide dimension info if the user skips doing that.
29196 Update second constructor to store the rank correctly.
29198 2001-11-16 Ravi Pratap <ravi@ximian.com>
29200 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
29201 and try to implement.
29203 * ../errors/cs0150.cs : Add.
29205 * ../errors/cs0178.cs : Add.
29207 2001-11-16 Miguel de Icaza <miguel@ximian.com>
29209 * statement.cs: Implement foreach on multi-dimensional arrays.
29211 * parameter.cs (Parameters.GetParameterByName): Also lookup the
29212 name of the params argument.
29214 * expression.cs: Use EmitStoreOpcode to get the right opcode while
29215 initializing the array.
29217 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
29218 we can use this elsewhere.
29220 * statement.cs: Finish implementation of foreach for single
29223 * cs-parser.jay: Use an out-of-band stack to pass information
29224 around, I wonder why I need this.
29226 foreach_block: Make the new foreach_block the current_block.
29228 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
29229 function used to return a static Parameters structure. Used for
29230 empty parameters, as those are created very frequently.
29232 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
29234 2001-11-15 Ravi Pratap <ravi@ximian.com>
29236 * interface.cs : Default modifier is private, not public. The
29237 make verify test passes again.
29239 2001-11-15 Ravi Pratap <ravi@ximian.com>
29241 * support.cs (ReflectionParameters): Fix logic to determine
29242 whether the last parameter is a params one. Test 9 passes again.
29244 * delegate.cs (Populate): Register the builders we define with
29245 RegisterParameterForBuilder. Test 19 passes again.
29247 * cs-parser.jay (property_declaration): Reference $6 instead
29248 of $$ to get at the location.
29250 (indexer_declaration): Similar stuff.
29252 (attribute): Ditto.
29254 * class.cs (Property): Register parameters for the Get and Set methods
29255 if they exist. Test 23 passes again.
29257 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
29258 call to EmitArguments as we are sure there aren't any params arguments.
29259 Test 32 passes again.
29261 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
29262 IndexOutOfRangeException.
29264 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
29265 Test 33 now passes again.
29267 2001-11-15 Miguel de Icaza <miguel@ximian.com>
29269 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
29270 broke a bunch of things. Will have to come up with a better way
29271 of tracking locations.
29273 * statement.cs: Implemented foreach for single dimension arrays.
29275 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29277 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
29278 an error. This removes the lookup from the critical path.
29280 * cs-parser.jay: Removed use of temporary_loc, which is completely
29283 2001-11-14 Miguel de Icaza <miguel@ximian.com>
29285 * support.cs (ReflectionParameters.ParameterModifier): Report
29286 whether the argument is a PARAMS argument or not.
29288 * class.cs: Set the attribute `ParamArrayAttribute' on the
29289 parameter argument.
29291 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
29292 and cons_param_array_attribute (ConstructorInfo for
29293 ParamArrayAttribute).,
29295 * codegen.cs: Emit the return using the `Return' statement, that
29296 way we can report the error correctly for missing return values.
29298 * class.cs (Method.Emit): Clean up.
29300 * expression.cs (Argument.Resolve): Take another argument: the
29301 location where this argument is used. Notice that this is not
29302 part of the "Argument" class as to reduce the size of the
29303 structure (we know the approximate location anyways).
29305 Test if the argument is a variable-reference, if not, then
29306 complain with a 206.
29308 (Argument.Emit): Emit addresses of variables.
29310 (Argument.FullDesc): Simplify.
29312 (Invocation.DoResolve): Update for Argument.Resolve.
29314 (ElementAccess.DoResolve): ditto.
29316 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
29317 method should be virtual, as this method is always virtual.
29319 (NewDelegate.DoResolve): Update for Argument.Resolve.
29321 * class.cs (ConstructorInitializer.DoResolve): ditto.
29323 * attribute.cs (Attribute.Resolve): ditto.
29325 2001-11-13 Miguel de Icaza <miguel@ximian.com>
29327 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
29329 * expression.cs (ParameterReference): Drop IStackStorage and implement
29330 IAssignMethod instead.
29332 (LocalVariableReference): ditto.
29334 * ecore.cs (FieldExpr): Drop IStackStorage and implement
29335 IAssignMethod instead.
29337 2001-11-13 Miguel de Icaza <miguel@ximian.com>
29339 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
29340 enumerations that are used in heavily used structures derive from
29341 byte in a laughable and pathetic attempt to reduce memory usage.
29342 This is the kind of pre-optimzations that you should not do at
29343 home without adult supervision.
29345 * expression.cs (UnaryMutator): New class, used to handle ++ and
29346 -- separatedly from the other unary operators. Cleans up the
29347 code, and kills the ExpressionStatement dependency in Unary.
29349 (Unary): Removed `method' and `Arguments' from this class, making
29350 it smaller, and moving it all to SimpleCall, so I can reuse this
29351 code in other locations and avoid creating a lot of transient data
29352 strucutres when not required.
29354 * cs-parser.jay: Adjust for new changes.
29356 2001-11-11 Miguel de Icaza <miguel@ximian.com>
29358 * enum.cs (Enum.Populate): If there is a failure during
29361 * cs-parser.jay (opt_enum_base): we used to catch type errors
29362 here, but this is really incorrect. The type error should be
29363 catched during semantic analysis.
29365 2001-12-11 Ravi Pratap <ravi@ximian.com>
29367 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
29368 current_local_parameters as expected since I, in my stupidity, had forgotten
29371 * attribute.cs (GetValidPlaces): Fix stupid bug.
29373 * class.cs (Method::Emit): Perform check on applicability of attributes.
29375 (Constructor::Emit): Ditto.
29377 (Field::Emit): Ditto.
29379 (Field.Location): Store location information.
29381 (Property, Event, Indexer, Operator): Ditto.
29383 * cs-parser.jay (field_declaration): Pass in location for each field.
29385 * ../errors/cs0592.cs : Add.
29387 2001-11-12 Ravi Pratap <ravi@ximian.com>
29389 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
29391 (InitCoreTypes): Update accordingly.
29393 (RegisterAttrType, LookupAttr): Implement.
29395 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
29396 info about the same.
29398 (Resolve): Update to populate the above as necessary.
29400 (Error592): Helper.
29402 (GetValidPlaces): Helper to the above.
29404 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29406 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29408 2001-11-12 Ravi Pratap <ravi@ximian.com>
29410 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29412 * ../errors/cs0617.cs : Add.
29414 2001-11-11 Ravi Pratap <ravi@ximian.com>
29416 * enum.cs (Emit): Rename to Populate to be more consistent with what
29417 we expect it to do and when exactly it is called.
29419 * class.cs, rootcontext.cs : Update accordingly.
29421 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29422 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29424 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29426 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29427 of a fieldinfo using the above, when dealing with a FieldBuilder.
29429 2001-11-10 Ravi Pratap <ravi@ximian.com>
29431 * ../errors/cs0031.cs : Add.
29433 * ../errors/cs1008.cs : Add.
29435 * ../errrors/cs0543.cs : Add.
29437 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29440 (FindMembers): Implement.
29442 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29443 enums and delegates too.
29445 (enum_types): Rename to builder_to_enum.
29447 (delegate_types): Rename to builder_to_delegate.
29449 * delegate.cs (FindMembers): Implement.
29451 2001-11-09 Ravi Pratap <ravi@ximian.com>
29453 * typemanager.cs (IsEnumType): Implement.
29455 * enum.cs (Emit): Re-write parts to account for the underlying type
29456 better and perform checking etc.
29458 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29459 of the underlying type.
29461 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29464 * enum.cs (error31): Helper to report error #31.
29466 * cs-parser.jay (enum_declaration): Store location of each member too.
29468 * enum.cs (member_to_location): New hashtable.
29470 (AddEnumMember): Update location hashtable.
29472 (Emit): Use the location of each member while reporting errors.
29474 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29476 * cs-parser.jay: A for_initializer if is a
29477 local_variable_declaration really ammount to have an implicit
29478 block with the variable declaration and no initializer for for.
29480 * statement.cs (For.Emit): Cope with null initializers.
29482 This fixes the infinite loop on for initializers.
29484 2001-11-08 Miguel de Icaza <miguel@ximian.com>
29486 * enum.cs: More cleanup.
29488 * ecore.cs: Remove dead code.
29490 * class.cs (Property.Emit): More simplification.
29491 (Event.Emit): ditto.
29493 Reworked to have less levels of indentation.
29495 2001-11-08 Ravi Pratap <ravi@ximian.com>
29497 * class.cs (Property): Emit attributes.
29507 * enum.cs (Emit): Ditto.
29509 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29512 * class.cs (Field, Event, etc.): Move attribute generation into the
29513 Emit method everywhere.
29515 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29516 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29517 as we had no way of defining nested enums !
29519 * rootcontext.cs : Adjust code accordingly.
29521 * typemanager.cs (AddEnumType): To keep track of enum types separately.
29523 2001-11-07 Ravi Pratap <ravi@ximian.com>
29525 * expression.cs (EvalConstantExpression): Move into ecore.cs
29527 * enum.cs (Enum): Rename some members and make them public and readonly
29528 according to our convention.
29530 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29533 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29535 (Enum::Emit): Write a simple version for now which doesn't try to compute
29536 expressions. I shall modify this to be more robust in just a while.
29538 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29540 (TypeContainer::CloseType): Create the Enum types too.
29542 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29544 * expression.cs (EvalConstantExpression): Get rid of completely.
29546 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29547 user-defined values and other cases.
29549 (IsValidEnumLiteral): Helper function.
29551 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
29552 out there in the case we had a literal FieldExpr.
29554 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29556 (Literalize): Revamp a bit to take two arguments.
29558 (EnumLiteral): New class which derives from Literal to wrap enum literals.
29560 2001-11-06 Ravi Pratap <ravi@ximian.com>
29562 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29564 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29566 (Resolve): Use the above to ensure we have proper initializers.
29568 2001-11-05 Ravi Pratap <ravi@ximian.com>
29570 * expression.cs (Expression::EvalConstantExpression): New method to
29571 evaluate constant expressions.
29573 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29575 2001-11-07 Miguel de Icaza <miguel@ximian.com>
29577 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29580 (Binary.ResolveOperator): Handle operator != (object a, object b)
29581 and operator == (object a, object b);
29583 (Binary.DoNumericPromotions): Indicate whether the numeric
29584 promotion was possible.
29586 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29589 Made the ArrayAccess implement interface IAssignMethod instead of
29590 IStackStore as the order in which arguments are passed reflects
29593 * assign.cs: Instead of using expr.ExprClass to select the way of
29594 assinging, probe for the IStackStore/IAssignMethod interfaces.
29596 * typemanager.cs: Load InitializeArray definition.
29598 * rootcontext.cs (RootContext.MakeStaticData): Used to define
29599 static data that can be used to initialize arrays.
29601 2001-11-05 Miguel de Icaza <miguel@ximian.com>
29603 * expression.cs: Handle operator== and operator!= for booleans.
29605 (Conditioal.Reduce): Implement reducer for the ?: operator.
29607 (Conditional.Resolve): Implement dead code elimination.
29609 (Binary.Resolve): Catch string literals and return a new
29610 concatenated string.
29612 (Unary.Reduce): Implement reduction of unary expressions.
29614 * ecore.cs: Split out the expression core handling here.
29616 (Expression.Reduce): New method used to perform constant folding
29617 and CSE. This is needed to support constant-expressions.
29619 * statement.cs (Statement.EmitBoolExpression): Pass true and false
29620 targets, and optimize for !x.
29622 2001-11-04 Ravi Pratap <ravi@ximian.com>
29624 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29625 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29626 set custom atttributes.
29628 * literal.cs (Literal::GetValue): New abstract method to return the actual
29629 value of the literal, cast as an object.
29631 (*Literal): Implement GetValue method.
29633 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29634 expressions to the arraylist but objects of type Argument.
29636 * class.cs (TypeContainer::Emit): Emit our attributes too.
29638 (Method::Emit, Constructor::Emit): Ditto.
29640 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29641 to be ignoring earlier.
29643 2001-11-03 Ravi Pratap <ravi@ximian.com>
29645 * attribute.cs (AttributeSection::Define): Implement to do the business
29646 of constructing a CustomAttributeBuilder.
29648 (Attribute): New trivial class. Increases readability of code.
29650 * cs-parser.jay : Update accordingly.
29652 (positional_argument_list, named_argument_list, named_argument): New rules
29654 (attribute_arguments): Use the above so that we are more correct.
29656 2001-11-02 Ravi Pratap <ravi@ximian.com>
29658 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29659 to perform all checks for a method with a params parameter.
29661 (Invocation::OverloadResolve): Update to use the above method and therefore
29662 cope correctly with params method invocations.
29664 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
29667 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29668 constructors in our parent too because we can't afford to miss out on
29671 * attribute.cs (AttributeSection): New name for the class Attribute
29673 Other trivial changes to improve readability.
29675 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29676 use the new class names.
29678 2001-11-01 Ravi Pratap <ravi@ximian.com>
29680 * class.cs (Method::Define): Complete definition for params types too
29682 (Indexer::Define): Ditto.
29684 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29685 Cope everywhere with a request for info about the array parameter.
29687 2001-11-01 Ravi Pratap <ravi@ximian.com>
29689 * tree.cs (RecordNamespace): Fix up to check for the correct key.
29691 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
29692 local_variable_type to extract the string corresponding to the type.
29694 (local_variable_type): Fixup the action to use the new helper method.
29696 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
29699 * expression.cs : Clean out code which uses the above.
29701 2001-10-31 Ravi Pratap <ravi@ximian.com>
29703 * typemanager.cs (RegisterMethod): Check if we already have an existing key
29704 and bale out if necessary by returning a false.
29706 (RegisterProperty): Ditto.
29708 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29709 and print out appropriate error messages.
29711 * interface.cs (everywhere): Ditto.
29713 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29714 location to constructor.
29716 * class.cs (Property, Event, Indexer): Update accordingly.
29718 * ../errors/cs111.cs : Added.
29720 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29721 of a method, as laid down by the spec.
29723 (Invocation::OverloadResolve): Use the above method.
29725 2001-10-31 Ravi Pratap <ravi@ximian.com>
29727 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29728 now take a TypeContainer and a Parameters object.
29730 (ParameterData): Modify return type of ParameterModifier method to be
29731 Parameter.Modifier and not a string.
29733 (ReflectionParameters, InternalParameters): Update accordingly.
29735 * expression.cs (Argument::GetParameterModifier): Same here.
29737 * support.cs (InternalParameters::ParameterType): Find a better way of determining
29738 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29739 symbol in it at all so maybe this is only for now.
29741 2001-10-30 Ravi Pratap <ravi@ximian.com>
29743 * support.cs (InternalParameters): Constructor now takes an extra argument
29744 which is the actual Parameters class.
29746 (ParameterDesc): Update to provide info on ref/out modifiers.
29748 * class.cs (everywhere): Update call to InternalParameters to pass in
29749 the second argument too.
29751 * support.cs (ParameterData): Add ParameterModifier, which is a method
29752 to return the modifier info [ref/out etc]
29754 (InternalParameters, ReflectionParameters): Implement the above.
29756 * expression.cs (Argument::ParameterModifier): Similar function to return
29757 info about the argument's modifiers.
29759 (Invocation::OverloadResolve): Update to take into account matching modifiers
29762 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29763 a new SetFormalParameters object which we pass to InternalParameters.
29765 2001-10-30 Ravi Pratap <ravi@ximian.com>
29767 * expression.cs (NewArray): Merge into the ArrayCreation class.
29769 2001-10-29 Ravi Pratap <ravi@ximian.com>
29771 * expression.cs (NewArray): Merge classes NewBuiltinArray and
29772 NewUserdefinedArray into one as there wasn't much of a use in having
29775 * expression.cs (Argument): Change field's name to ArgType from Type.
29777 (Type): New readonly property which returns the proper type, taking into
29778 account ref/out modifiers.
29780 (everywhere): Adjust code accordingly for the above.
29782 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29783 whether we are emitting for a ref or out parameter.
29785 * expression.cs (Argument::Emit): Use the above field to set the state.
29787 (LocalVariableReference::Emit): Update to honour the flag and emit the
29790 * parameter.cs (Attributes): Set the correct flags for ref parameters.
29792 * expression.cs (Argument::FullDesc): New function to provide a full desc.
29794 * support.cs (ParameterData): Add method ParameterDesc to the interface.
29796 (ReflectionParameters, InternalParameters): Implement the above method.
29798 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29801 (Invocation::FullMethodDesc): Ditto.
29803 2001-10-29 Miguel de Icaza <miguel@ximian.com>
29805 * cs-parser.jay: Add extra production for the second form of array
29808 * expression.cs (ArrayCreation): Update to reflect the above
29811 * Small changes to prepare for Array initialization.
29813 2001-10-28 Miguel de Icaza <miguel@ximian.com>
29815 * typemanager.cs (ImplementsInterface): interface might be null;
29816 Deal with this problem;
29818 Also, we do store negative hits on the cache (null values), so use
29819 this instead of calling t.GetInterfaces on the type everytime.
29821 2001-10-28 Ravi Pratap <ravi@ximian.com>
29823 * typemanager.cs (IsBuiltinType): New method to help determine the same.
29825 * expression.cs (New::DoResolve): Get rid of array creation code and instead
29826 split functionality out into different classes.
29828 (New::FormArrayType): Move into NewBuiltinArray.
29830 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29833 (NewBuiltinArray): New class to handle creation of built-in arrays.
29835 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29836 account creation of one-dimensional arrays.
29838 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29840 (NewUserdefinedArray::DoResolve): Implement.
29842 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29844 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29845 we maintain inside the TypeManager. This is necessary to perform lookups on the
29848 (LookupType): Update to perform GetType on the module builders too.
29850 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29852 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29854 2001-10-23 Ravi Pratap <ravi@ximian.com>
29856 * expression.cs (New::DoResolve): Implement guts of array creation.
29858 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29860 2001-10-27 Miguel de Icaza <miguel@ximian.com>
29862 * expression.cs: Fix bug I introduced lsat night that broke
29865 (Expression.Resolve): Report a 246 error (can not resolve name)
29866 if we find a SimpleName in the stream.
29868 (Expression.ResolveLValue): Ditto.
29870 (Expression.ResolveWithSimpleName): This function is a variant of
29871 ResolveName, this one allows SimpleNames to be returned without a
29872 warning. The only consumer of SimpleNames is MemberAccess
29874 2001-10-26 Miguel de Icaza <miguel@ximian.com>
29876 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29877 might arrive here. I have my doubts that this is correct.
29879 * statement.cs (Lock): Implement lock statement.
29881 * cs-parser.jay: Small fixes to support `lock' and `using'
29883 * cs-tokenizer.cs: Remove extra space
29885 * driver.cs: New flag --checked, allows to turn on integer math
29888 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29889 Threading.Monitor.Exit
29891 2001-10-23 Miguel de Icaza <miguel@ximian.com>
29893 * expression.cs (IndexerAccess::DoResolveLValue): Set the
29894 Expression Class to be IndexerAccess.
29896 Notice that Indexer::DoResolve sets the eclass to Value.
29898 2001-10-22 Miguel de Icaza <miguel@ximian.com>
29900 * class.cs (TypeContainer::Emit): Emit code for indexers.
29902 * assign.cs (IAssignMethod): New interface implemented by Indexers
29903 and Properties for handling assignment.
29905 (Assign::Emit): Simplify and reuse code.
29907 * expression.cs (IndexerAccess, PropertyExpr): Implement
29908 IAssignMethod, clean up old code.
29910 2001-10-22 Ravi Pratap <ravi@ximian.com>
29912 * typemanager.cs (ImplementsInterface): New method to determine if a type
29913 implements a given interface. Provides a nice cache too.
29915 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29918 (ConvertReferenceExplicit): Ditto.
29920 * delegate.cs (Delegate::Populate): Update to define the parameters on the
29921 various methods, with correct names etc.
29923 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
29924 Operator.UnaryNegation.
29926 * cs-parser.jay (operator_declarator): Be a little clever in the case where
29927 we have a unary plus or minus operator.
29929 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
29932 * everywhere : update accordingly.
29934 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29937 * class.cs (Method::Define): For the case where we are implementing a method
29938 inherited from an interface, we need to set the MethodAttributes.Final flag too.
29939 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29941 2001-10-21 Ravi Pratap <ravi@ximian.com>
29943 * interface.cs (FindMembers): Implement to work around S.R.E
29946 * typemanager.cs (IsInterfaceType): Implement.
29948 (FindMembers): Update to handle interface types too.
29950 * expression.cs (ImplicitReferenceConversion): Re-write bits which
29951 use IsAssignableFrom as that is not correct - it doesn't work.
29953 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29954 and accordingly override EmitStatement.
29956 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29957 using the correct logic :-)
29959 2001-10-19 Ravi Pratap <ravi@ximian.com>
29961 * ../errors/cs-11.cs : Add to demonstrate error -11
29963 2001-10-17 Miguel de Icaza <miguel@ximian.com>
29965 * assign.cs (Assign::Resolve): Resolve right hand side first, and
29966 then pass this as a hint to ResolveLValue.
29968 * expression.cs (FieldExpr): Add Location information
29970 (FieldExpr::LValueResolve): Report assignment to readonly
29973 (Expression::ExprClassFromMemberInfo): Pass location information.
29975 (Expression::ResolveLValue): Add new method that resolves an
29978 (Expression::DoResolveLValue): Default invocation calls
29981 (Indexers): New class used to keep track of indexers in a given
29984 (IStackStore): Renamed from LValue, as it did not really describe
29985 what this did. Also ResolveLValue is gone from this interface and
29986 now is part of Expression.
29988 (ElementAccess): Depending on the element access type
29990 * typemanager.cs: Add `indexer_name_type' as a Core type
29991 (System.Runtime.CompilerServices.IndexerNameAttribute)
29993 * statement.cs (Goto): Take a location.
29995 2001-10-18 Ravi Pratap <ravi@ximian.com>
29997 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29998 if two delegates are compatible.
30000 (NewDelegate::DoResolve): Update to take care of the case when
30001 we instantiate a delegate from another delegate.
30003 * typemanager.cs (FindMembers): Don't even try to look up members
30004 of Delegate types for now.
30006 2001-10-18 Ravi Pratap <ravi@ximian.com>
30008 * delegate.cs (NewDelegate): New class to take care of delegate
30011 * expression.cs (New): Split the delegate related code out into
30012 the NewDelegate class.
30014 * delegate.cs (DelegateInvocation): New class to handle delegate
30017 * expression.cs (Invocation): Split out delegate related code into
30018 the DelegateInvocation class.
30020 2001-10-17 Ravi Pratap <ravi@ximian.com>
30022 * expression.cs (New::DoResolve): Implement delegate creation fully
30023 and according to the spec.
30025 (New::DoEmit): Update to handle delegates differently.
30027 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
30028 because of which we were printing out arguments in reverse order !
30030 * delegate.cs (VerifyMethod): Implement to check if the given method
30031 matches the delegate.
30033 (FullDelegateDesc): Implement.
30035 (VerifyApplicability): Implement.
30037 * expression.cs (Invocation::DoResolve): Update to accordingly handle
30038 delegate invocations too.
30040 (Invocation::Emit): Ditto.
30042 * ../errors/cs1593.cs : Added.
30044 * ../errors/cs1594.cs : Added.
30046 * delegate.cs (InstanceExpression, TargetMethod): New properties.
30048 2001-10-16 Ravi Pratap <ravi@ximian.com>
30050 * typemanager.cs (intptr_type): Core type for System.IntPtr
30052 (InitCoreTypes): Update for the same.
30054 (iasyncresult_type, asynccallback_type): Ditto.
30056 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
30059 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
30062 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
30063 the builders for the 4 members of a delegate type :-)
30065 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
30068 * expression.cs (New::DoResolve): Implement guts for delegate creation.
30070 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
30072 2001-10-15 Miguel de Icaza <miguel@ximian.com>
30074 * statement.cs (Break::Emit): Implement.
30075 (Continue::Emit): Implement.
30077 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
30078 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
30079 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
30080 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
30083 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
30084 properties that track the label for the current loop (begin of the
30085 loop and end of the loop).
30087 2001-10-15 Ravi Pratap <ravi@ximian.com>
30089 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
30090 use of emitting anything at all.
30092 * class.cs, rootcontext.cs : Get rid of calls to the same.
30094 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
30096 (Populate): Define the constructor correctly and set the implementation
30099 * typemanager.cs (delegate_types): New hashtable to hold delegates that
30102 (AddDelegateType): Implement.
30104 (IsDelegateType): Implement helper method.
30106 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
30108 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
30109 and accordingly handle it.
30111 * delegate.cs (Populate): Take TypeContainer argument.
30112 Implement bits to define the Invoke method. However, I still haven't figured out
30113 how to take care of the native int bit :-(
30115 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
30116 Qualify the name of the delegate, not its return type !
30118 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
30121 (StandardConversionExists): Checking for array types turns out to be recursive.
30123 (ConvertReferenceExplicit): Implement array conversion.
30125 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
30127 2001-10-12 Ravi Pratap <ravi@ximian.com>
30129 * cs-parser.jay (delegate_declaration): Store the fully qualified
30130 name as it is a type declaration.
30132 * delegate.cs (ReturnType, Name): Rename members to these. Make them
30135 (DefineDelegate): Renamed from Define. Does the same thing essentially,
30136 as TypeContainer::DefineType.
30138 (Populate): Method in which all the definition of the various methods (Invoke)
30141 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
30144 (CloseDelegate): Finally creates the delegate.
30146 * class.cs (TypeContainer::DefineType): Update to define delegates.
30147 (Populate, Emit and CloseType): Do the same thing here too.
30149 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
30150 delegates in all these operations.
30152 2001-10-14 Miguel de Icaza <miguel@ximian.com>
30154 * expression.cs: LocalTemporary: a new expression used to
30155 reference a temporary that has been created.
30157 * assign.cs: Handle PropertyAccess back here, so that we can
30158 provide the proper semantic access to properties.
30160 * expression.cs (Expression::ConvertReferenceExplicit): Implement
30161 a few more explicit conversions.
30163 * modifiers.cs: `NEW' modifier maps to HideBySig.
30165 * expression.cs (PropertyExpr): Make this into an
30166 ExpressionStatement, and support the EmitStatement code path.
30168 Perform get/set error checking, clean up the interface.
30170 * assign.cs: recognize PropertyExprs as targets, and if so, turn
30171 them into toplevel access objects.
30173 2001-10-12 Miguel de Icaza <miguel@ximian.com>
30175 * expression.cs: PropertyExpr::PropertyExpr: use work around the
30178 * typemanager.cs: Keep track here of our PropertyBuilders again to
30179 work around lameness in SRE.
30181 2001-10-11 Miguel de Icaza <miguel@ximian.com>
30183 * expression.cs (LValue::LValueResolve): New method in the
30184 interface, used to perform a second resolution pass for LValues.
30186 (This::DoResolve): Catch the use of this in static methods.
30188 (This::LValueResolve): Implement.
30190 (This::Store): Remove warning, assigning to `this' in structures
30193 (Invocation::Emit): Deal with invocation of
30194 methods on value types. We need to pass the address to structure
30195 methods rather than the object itself. (The equivalent code to
30196 emit "this" for structures leaves the entire structure on the
30197 stack instead of a pointer to it).
30199 (ParameterReference::DoResolve): Compute the real index for the
30200 argument based on whether the method takes or not a `this' pointer
30201 (ie, the method is static).
30203 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
30204 value types returned from functions when we need to invoke a
30205 method on the sturcture.
30208 2001-10-11 Ravi Pratap <ravi@ximian.com>
30210 * class.cs (TypeContainer::DefineType): Method to actually do the business of
30211 defining the type in the Modulebuilder or Typebuilder. This is to take
30212 care of nested types which need to be defined on the TypeBuilder using
30213 DefineNestedMethod.
30215 (TypeContainer::GetClassBases): Implement. Essentially the code from the
30216 methods in RootContext, only ported to be part of TypeContainer.
30218 (TypeContainer::GetInterfaceOrClass): Ditto.
30220 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
30222 * interface.cs (Interface::DefineInterface): New method. Does exactly
30223 what RootContext.CreateInterface did earlier, only it takes care of nested types
30226 (Interface::GetInterfaces): Move from RootContext here and port.
30228 (Interface::GetInterfaceByName): Same here.
30230 * rootcontext.cs (ResolveTree): Re-write.
30232 (PopulateTypes): Re-write.
30234 * class.cs (TypeContainer::Populate): Populate nested types too.
30235 (TypeContainer::Emit): Emit nested members too.
30237 * typemanager.cs (AddUserType): Do not make use of the FullName property,
30238 instead just use the name argument passed in as it is already fully
30241 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
30242 to TypeContainer mapping to see if a type is user-defined.
30244 * class.cs (TypeContainer::CloseType): Implement.
30246 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
30247 the default constructor.
30249 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
30252 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
30254 * interface.cs (CloseType): Create the type here.
30256 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
30259 Remove all the methods which are now in TypeContainer.
30261 2001-10-10 Ravi Pratap <ravi@ximian.com>
30263 * delegate.cs (Define): Re-write bits to define the delegate
30266 2001-10-10 Miguel de Icaza <miguel@ximian.com>
30268 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
30270 * expression.cs (ImplicitReferenceConversion): handle null as well
30271 as a source to convert to any reference type.
30273 * statement.cs (Return): Perform any implicit conversions to
30274 expected return type.
30276 Validate use of return statement.
30278 * codegen.cs (EmitContext): Pass the expected return type here.
30280 * class.cs (Method, Constructor, Property): Pass expected return
30281 type to EmitContext.
30283 2001-10-09 Miguel de Icaza <miguel@ximian.com>
30285 * expression.cs: Make DoResolve take an EmitContext instead of a
30288 Replaced `l' and `location' for `loc', for consistency.
30290 (Error, Warning): Remove unneeded Tc argument.
30292 * assign.cs, literal.cs, constant.cs: Update to new calling
30295 * codegen.cs: EmitContext now contains a flag indicating whether
30296 code is being generated in a static method or not.
30298 * cs-parser.jay: DecomposeQI, new function that replaces the old
30299 QualifiedIdentifier. Now we always decompose the assembled
30300 strings from qualified_identifier productions into a group of
30303 2001-10-08 Miguel de Icaza <miguel@ximian.com>
30305 * rootcontext.cs: Deal with field-less struct types correctly now
30306 by passing the size option to Define Type.
30308 * class.cs: Removed hack that created one static field.
30310 2001-10-07 Miguel de Icaza <miguel@ximian.com>
30312 * statement.cs: Moved most of the code generation here.
30314 2001-10-09 Ravi Pratap <ravi@ximian.com>
30316 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
30319 (ElementAccess): Remove useless bits for now - keep checks as the spec
30322 2001-10-08 Ravi Pratap <ravi@ximian.com>
30324 * expression.cs (ElementAccess::DoResolve): Remove my crap code
30325 and start performing checks according to the spec.
30327 2001-10-07 Ravi Pratap <ravi@ximian.com>
30329 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
30330 rank_specifiers instead.
30332 (rank_specifiers): Change the order in which the rank specifiers are stored
30334 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
30336 * expression.cs (ElementAccess): Implement the LValue interface too.
30338 2001-10-06 Ravi Pratap <ravi@ximian.com>
30340 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
30341 except that user defined conversions are not included.
30343 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
30344 perform the conversion of the return type, if necessary.
30346 (New::DoResolve): Check whether we are creating an array or an object
30347 and accordingly do the needful.
30349 (New::Emit): Same here.
30351 (New::DoResolve): Implement guts of array creation.
30353 (New::FormLookupType): Helper function.
30355 2001-10-07 Miguel de Icaza <miguel@ximian.com>
30357 * codegen.cs: Removed most of the code generation here, and move the
30358 corresponding code generation bits to the statement classes.
30360 Added support for try/catch/finalize and throw.
30362 * cs-parser.jay: Added support for try/catch/finalize.
30364 * class.cs: Catch static methods having the flags override,
30365 virtual or abstract.
30367 * expression.cs (UserCast): This user cast was not really doing
30368 what it was supposed to do. Which is to be born in fully resolved
30369 state. Parts of the resolution were being performed at Emit time!
30373 2001-10-05 Miguel de Icaza <miguel@ximian.com>
30375 * expression.cs: Implicity convert the result from UserCast.
30377 2001-10-05 Ravi Pratap <ravi@ximian.com>
30379 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
30380 prevented it from working correctly.
30382 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
30383 merely ConvertImplicit.
30385 2001-10-05 Miguel de Icaza <miguel@ximian.com>
30387 * typemanager.cs: Make the LookupTypeContainer function static,
30388 and not per-instance.
30390 * class.cs: Make static FindMembers (the one that takes a Type
30393 * codegen.cs: Add EmitForeach here.
30395 * cs-parser.jay: Make foreach a toplevel object instead of the
30396 inline expansion, as we need to perform semantic analysis on it.
30398 2001-10-05 Ravi Pratap <ravi@ximian.com>
30400 * expression.cs (Expression::ImplicitUserConversion): Rename to
30401 UserDefinedConversion.
30403 (Expression::UserDefinedConversion): Take an extra argument specifying
30404 whether we look for explicit user conversions too.
30406 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30408 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30410 (ExplicitUserConversion): Make it a call to UserDefinedConversion
30411 with the appropriate arguments.
30413 * cs-parser.jay (cast_expression): Record location too.
30415 * expression.cs (Cast): Record location info.
30417 (Expression::ConvertExplicit): Take location argument.
30419 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30420 to determine if we are doing explicit conversions.
30422 (UserCast::Emit): Update accordingly.
30424 (Expression::ConvertExplicit): Report an error if everything fails.
30426 * ../errors/cs0030.cs : Add.
30428 2001-10-04 Miguel de Icaza <miguel@ximian.com>
30430 * modifiers.cs: If the ABSTRACT keyword is present, also set the
30431 virtual and newslot bits.
30433 * class.cs (TypeContainer::RegisterRequiredImplementations):
30434 Record methods we need.
30436 (TypeContainer::MakeKey): Helper function to make keys for
30437 MethodBases, since the Methodbase key is useless.
30439 (TypeContainer::Populate): Call RegisterRequiredImplementations
30440 before defining the methods.
30442 Create a mapping for method_builders_to_methods ahead of time
30443 instead of inside a tight loop.
30445 (::RequireMethods): Accept an object as the data to set into the
30446 hashtable so we can report interface vs abstract method mismatch.
30448 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30450 * report.cs: Make all of it static.
30452 * rootcontext.cs: Drop object_type and value_type computations, as
30453 we have those in the TypeManager anyways.
30455 Drop report instance variable too, now it is a global.
30457 * driver.cs: Use try/catch on command line handling.
30459 Add --probe option to debug the error reporting system with a test
30462 * report.cs: Add support for exiting program when a probe
30463 condition is reached.
30465 2001-10-03 Ravi Pratap <ravi@ximian.com>
30467 * expression.cs (Binary::DoNumericPromotions): Fix the case when
30468 we do a forcible conversion regardless of type, to check if
30469 ForceConversion returns a null.
30471 (Binary::error19): Use location to report error.
30473 (Unary::error23): Use location here too.
30475 * ../errors/cs0019.cs : Check in.
30477 * ../errors/cs0023.cs : Check in.
30479 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30480 case of a non-null MethodInfo object with a length of 0 !
30482 (Binary::ResolveOperator): Flag error if overload resolution fails to find
30483 an applicable member - according to the spec :-)
30484 Also fix logic to find members in base types.
30486 (Unary::ResolveOperator): Same here.
30488 (Unary::report23): Change name to error23 and make first argument a TypeContainer
30489 as I was getting thoroughly confused between this and error19 :-)
30491 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30492 (::FindMostEncompassedType): Implement.
30493 (::FindMostEncompassingType): Implement.
30494 (::StandardConversionExists): Implement.
30496 (UserImplicitCast): Re-vamp. We now need info about most specific
30497 source and target types so that we can do the necessary conversions.
30499 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30500 mathematical union with no duplicates.
30502 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30504 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30505 in order from base classes to child classes, so that we can in
30506 child classes look up in our parent for method names and
30507 attributes (required for handling abstract, virtual, new, override
30508 constructs: we need to instrospect our base class, and if we dont
30509 populate the classes in order, the introspection might be
30510 incorrect. For example, a method could query its parent before
30511 the parent has any methods and would determine that the parent has
30512 no abstract methods (while it could have had them)).
30514 (RootContext::CreateType): Record the order in which we define the
30517 2001-10-02 Miguel de Icaza <miguel@ximian.com>
30519 * class.cs (TypeContainer::Populate): Also method definitions can
30520 fail now, keep track of this.
30522 (TypeContainer::FindMembers): Implement support for
30523 DeclaredOnly/noDeclaredOnly flag.
30525 (Constructor::Emit) Return the ConstructorBuilder.
30527 (Method::Emit) Return the MethodBuilder.
30528 Check for abstract or virtual methods to be public.
30530 * rootcontext.cs (RootContext::CreateType): Register all the
30531 abstract methods required for the class to be complete and the
30532 interface methods that must be implemented.
30534 * cs-parser.jay: Report error 501 (method requires body if it is
30535 not marked abstract or extern).
30537 * expression.cs (TypeOf::Emit): Implement.
30539 * typemanager.cs: runtime_handle_type, new global type.
30541 * class.cs (Property::Emit): Generate code for properties.
30543 2001-10-02 Ravi Pratap <ravi@ximian.com>
30545 * expression.cs (Unary::ResolveOperator): Find operators on base type
30546 too - we now conform exactly to the spec.
30548 (Binary::ResolveOperator): Same here.
30550 * class.cs (Operator::Define): Fix minor quirk in the tests.
30552 * ../errors/cs0215.cs : Added.
30554 * ../errors/cs0556.cs : Added.
30556 * ../errors/cs0555.cs : Added.
30558 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30560 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30561 single integer which is really efficient
30563 2001-10-01 Ravi Pratap <ravi@ximian.com>
30565 * expression.cs (Expression::ImplicitUserConversion): Use location
30566 even in the case when we are examining True operators.
30568 * class.cs (Operator::Define): Perform extensive checks to conform
30569 with the rules for operator overloading in the spec.
30571 * expression.cs (Expression::ImplicitReferenceConversion): Implement
30572 some of the other conversions mentioned in the spec.
30574 * typemanager.cs (array_type): New static member for the System.Array built-in
30577 (cloneable_interface): For System.ICloneable interface.
30579 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30580 we start resolving the tree and populating types.
30582 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30584 2001-10-01 Miguel de Icaza <miguel@ximian.com>
30586 * expression.cs (Expression::ExprClassFromMemberInfo,
30587 Expression::Literalize): Create literal expressions from
30588 FieldInfos which are literals.
30590 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30591 type casts, because they were wrong. The test suite in tests
30594 (ImplicitNumericConversion): ushort to ulong requires a widening
30597 Int32 constant to long requires widening cast as well.
30599 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30600 for integers because the type on the stack is not i4.
30602 2001-09-30 Miguel de Icaza <miguel@ximian.com>
30604 * expression.cs (report118): require location argument.
30606 * parameter.cs: Do not dereference potential null value.
30608 * class.cs: Catch methods that lack the `new' keyword when
30609 overriding a name. Report warnings when `new' is used without
30610 anything being there to override.
30612 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30614 * class.cs: Only add constructor to hashtable if it is non-null
30615 (as now constructors can fail on define).
30617 (TypeManager, Class, Struct): Take location arguments.
30619 Catch field instance initialization in structs as errors.
30621 accepting_filter: a new filter for FindMembers that is static so
30622 that we dont create an instance per invocation.
30624 (Constructor::Define): Catch errors where a struct constructor is
30627 * cs-parser.jay: Pass location information for various new
30630 * delegate.cs (Delegate): take a location argument.
30632 * driver.cs: Do not call EmitCode if there were problesm in the
30633 Definition of the types, as many Builders wont be there.
30635 * decl.cs (Decl::Decl): Require a location argument.
30637 * cs-tokenizer.cs: Handle properly hex constants that can not fit
30638 into integers, and find the most appropiate integer for it.
30640 * literal.cs: Implement ULongLiteral.
30642 * rootcontext.cs: Provide better information about the location of
30643 failure when CreateType fails.
30645 2001-09-29 Miguel de Icaza <miguel@ximian.com>
30647 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30650 * expression.cs (Binary::CheckShiftArguments): Add missing type
30652 (Binary::ResolveOperator): Add type to the logical and and logical
30653 or, Bitwise And/Or and Exclusive Or code paths, it was missing
30656 (Binary::DoNumericPromotions): In the case where either argument
30657 is ulong (and most signed types combined with ulong cause an
30658 error) perform implicit integer constant conversions as well.
30660 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30662 * expression.cs (UserImplicitCast): Method should always be
30664 (Invocation::BetterConversion): Simplified test for IntLiteral.
30666 (Expression::ImplicitNumericConversion): Split this routine out.
30667 Put the code that performs implicit constant integer conversions
30670 (Expression::Resolve): Become a wrapper around DoResolve so we can
30671 check eclass and type being set after resolve.
30673 (Invocation::Badness): Remove this dead function
30675 (Binary::ResolveOperator): Do not compute the expensive argumnets
30676 unless we have a union for it.
30678 (Probe::Emit): Is needs to do an isinst and then
30679 compare against null.
30681 (::CanConvert): Added Location argument. If the Location argument
30682 is null (Location.Null), then we do not report errors. This is
30683 used by the `probe' mechanism of the Explicit conversion. We do
30684 not want to generate an error for something that the user
30685 explicitly requested to be casted. But the pipeline for an
30686 explicit cast first tests for potential implicit casts.
30688 So for now, if the Location is null, it means `Probe only' to
30689 avoid adding another argument. Might have to revise this
30692 (ClassCast): New class used to type cast objects into arbitrary
30693 classes (used in Explicit Reference Conversions).
30695 Implement `as' as well.
30697 Reverted all the patches from Ravi below: they were broken:
30699 * The use of `level' as a mechanism to stop recursive
30700 invocations is wrong. That was there just to catch the
30701 bug with a strack trace but not as a way of addressing
30704 To fix the problem we have to *understand* what is going
30705 on and the interactions and come up with a plan, not
30706 just get things going.
30708 * The use of the type conversion cache that I proposed
30709 last night had an open topic: How does this work across
30710 protection domains. A user defined conversion might not
30711 be public in the location where we are applying the
30712 conversion, a different conversion might be selected
30713 (ie, private A->B (better) but public B->A (worse),
30714 inside A, A->B applies, but outside it, B->A will
30717 * On top of that (ie, even if the above is solved),
30718 conversions in a cache need to be abstract. Ie, `To
30719 convert from an Int to a Short use an OpcodeCast', not
30720 `To convert from an Int to a Short use the OpcodeCast on
30721 the variable 5' (which is what this patch was doing).
30723 2001-09-28 Ravi Pratap <ravi@ximian.com>
30725 * expression.cs (Invocation::ConversionExists): Re-write to use
30726 the conversion cache
30728 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30729 cache all conversions done, not just user-defined ones.
30731 (Invocation::BetterConversion): The real culprit. Use ConversionExists
30732 to determine if a conversion exists instead of acutually trying to
30733 perform the conversion. It's faster too.
30735 (Expression::ConvertExplicit): Modify to use ConversionExists to check
30736 and only then attempt the implicit conversion.
30738 2001-09-28 Ravi Pratap <ravi@ximian.com>
30740 * expression.cs (ConvertImplicit): Use a cache for conversions
30741 already found. Check level of recursion and bail out if necessary.
30743 2001-09-28 Miguel de Icaza <miguel@ximian.com>
30745 * typemanager.cs (string_concat_string_string, string_concat_object_object):
30746 Export standard methods that we expect for string operations.
30748 * statement.cs (Block::UsageWarning): Track usage of variables and
30749 report the errors for not used variables.
30751 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30754 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30756 * codegen.cs: remove unnneded code
30758 * expression.cs: Removed BuiltinTypeAccess class
30760 Fix the order in which implicit conversions are
30763 The previous fixed dropped support for boxed conversions (adding a
30764 test to the test suite now)
30766 (UserImplicitCast::CanConvert): Remove test for source being null,
30767 that code is broken. We should not feed a null to begin with, if
30768 we do, then we should track the bug where the problem originates
30769 and not try to cover it up here.
30771 Return a resolved expression of type UserImplicitCast on success
30772 rather than true/false. Ravi: this is what I was talking about,
30773 the pattern is to use a static method as a "constructor" for
30776 Also, do not create arguments until the very last minute,
30777 otherwise we always create the arguments even for lookups that
30778 will never be performed.
30780 (UserImplicitCast::Resolve): Eliminate, objects of type
30781 UserImplicitCast are born in a fully resolved state.
30783 * typemanager.cs (InitCoreTypes): Init also value_type
30784 (System.ValueType).
30786 * expression.cs (Cast::Resolve): First resolve the child expression.
30788 (LValue): Add new method AddressOf to be used by
30791 Change the argument of Store to take an EmitContext instead of an
30792 ILGenerator, because things like FieldExpr need to be able to call
30793 their children expression to generate the instance code.
30795 (Expression::Error, Expression::Warning): Sugar functions for
30798 (Expression::MemberLookup): Accept a TypeContainer instead of a
30799 Report as the first argument.
30801 (Expression::ResolvePrimary): Killed. I still want to improve
30802 this as currently the code is just not right.
30804 (Expression::ResolveMemberAccess): Simplify, but it is still
30807 (Unary::Resolve): Catch errors in AddressOf operators.
30809 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30810 index to a byte for the short-version, or the compiler will choose
30811 the wrong Emit call, which generates the wrong data.
30813 (ParameterReference::Emit, ::Store): same.
30815 (FieldExpr::AddressOf): Implement.
30817 * typemanager.cs: TypeManager: made public variable instead of
30820 * driver.cs: document --fatal.
30822 * report.cs (ErrorMessage, WarningMessage): new names for the old
30823 Error and Warning classes.
30825 * cs-parser.jay (member_access): Turn built-in access to types
30826 into a normal simplename
30828 2001-09-27 Ravi Pratap <ravi@ximian.com>
30830 * expression.cs (Invocation::BetterConversion): Fix to cope
30831 with q being null, since this was introducing a bug.
30833 * expression.cs (ConvertImplicit): Do built-in conversions first.
30835 2001-09-27 Ravi Pratap <ravi@ximian.com>
30837 * expression.cs (UserImplicitCast::Resolve): Fix bug.
30839 2001-09-27 Ravi Pratap <ravi@ximian.com>
30841 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30842 I had introduced long ago (what's new ?).
30844 * expression.cs (UserImplicitCast::CanConvert): Static method to do
30845 the work of all the checking.
30846 (ConvertImplicit): Call CanConvert and only then create object if necessary.
30847 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30849 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30850 that is the right way.
30852 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
30853 overloading resolution. Use everywhere instead of cutting and pasting code.
30855 (Binary::ResolveOperator): Use MakeUnionSet.
30857 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
30858 we have to convert to bool types. Not complete yet.
30860 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30862 * typemanager.cs (TypeManager::CSharpName): support ushort.
30864 * expression.cs (Expression::TryImplicitIntConversion): Attempts
30865 to provide an expression that performsn an implicit constant int
30866 conversion (section 6.1.6).
30867 (Expression::ConvertImplicitRequired): Reworked to include
30868 implicit constant expression conversions.
30870 (Expression::ConvertNumericExplicit): Finished.
30872 (Invocation::Emit): If InstanceExpression is null, then it means
30873 that we perform a call on this.
30875 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30877 * expression.cs (Unary::Emit): Remove some dead code.
30878 (Probe): Implement Resolve and Emit for `is'.
30879 (Expression::ConvertImplicitRequired): Attempt to do constant
30880 expression conversions here. Maybe should be moved to
30881 ConvertImplicit, but I am not sure.
30882 (Expression::ImplicitLongConstantConversionPossible,
30883 Expression::ImplicitIntConstantConversionPossible): New functions
30884 that tell whether is it possible to apply an implicit constant
30885 expression conversion.
30887 (ConvertNumericExplicit): Started work on explicit numeric
30890 * cs-parser.jay: Update operator constants.
30892 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30893 (Parameters::GetSignature): Hook up VerifyArgs here.
30894 (Parameters::VerifyArgs): Verifies that no two arguments have the
30897 * class.cs (Operator): Update the operator names to reflect the
30898 ones that the spec expects (as we are just stringizing the
30901 * expression.cs (Unary::ResolveOperator): Fix bug: Use
30902 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30903 previous usage did only work for our methods.
30904 (Expression::ConvertImplicit): Handle decimal implicit numeric
30905 conversions as well.
30906 (Expression::InternalTypeConstructor): Used to invoke constructors
30907 on internal types for default promotions.
30909 (Unary::Emit): Implement special handling for the pre/post
30910 increment/decrement for overloaded operators, as they need to have
30911 the same semantics as the other operators.
30913 (Binary::ResolveOperator): ditto.
30914 (Invocation::ConversionExists): ditto.
30915 (UserImplicitCast::Resolve): ditto.
30917 2001-09-26 Ravi Pratap <ravi@ximian.com>
30919 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30920 operator, return after emitting body. Regression tests pass again !
30922 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30923 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30924 (Invocation::OverloadResolve): Ditto.
30925 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30927 * everywhere : update calls to the above methods accordingly.
30929 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30931 * assign.cs (Assign): Make it inherit from ExpressionStatement.
30933 * expression.cs (ExpressionStatement): New base class used for
30934 expressions that can appear in statements, so that we can provide
30935 an alternate path to generate expression that do not leave a value
30938 (Expression::Emit, and all the derivatives): We no longer return
30939 whether a value is left on the stack or not. Every expression
30940 after being emitted leaves a single value on the stack.
30942 * codegen.cs (EmitContext::EmitStatementExpression): Use the
30943 facilties of ExpressionStatement if possible.
30945 * cs-parser.jay: Update statement_expression.
30947 2001-09-25 Miguel de Icaza <miguel@ximian.com>
30949 * driver.cs: Change the wording of message
30951 2001-09-25 Ravi Pratap <ravi@ximian.com>
30953 * expression.cs (Binary::ResolveOperator): Had forgottten to set
30954 the type of the expression to the return type of the method if
30955 we have an overloaded operator match ! The regression tests pass again !
30956 (Unary::ResolveOperator): Ditto.
30958 * expression.cs (Invocation::ConversionExists): Correct the member lookup
30959 to find "op_Implicit", not "implicit" ;-)
30960 (UserImplicitCast): New class to take care of user-defined implicit conversions.
30961 (ConvertImplicit, ForceConversion): Take TypeContainer argument
30963 * everywhere : Correct calls to the above accordingly.
30965 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30966 (ConvertImplicit): Do user-defined conversion if it exists.
30968 2001-09-24 Miguel de Icaza <miguel@ximian.com>
30970 * assign.cs: track location.
30971 (Resolve): Use implicit conversions on assignment.
30973 * literal.cs: Oops. Not good, Emit of short access values should
30974 pass (Bytes) or the wrong argument will be selected.
30976 * expression.cs (Unary::Emit): Emit code for -expr.
30978 (Unary::ResolveOperator): Handle `Substract' for non-constants
30979 (substract from zero from the non-constants).
30980 Deal with Doubles as well.
30982 (Expression::ConvertImplicitRequired): New routine that reports an
30983 error if no implicit conversion exists.
30985 (Invocation::OverloadResolve): Store the converted implicit
30986 expressions if we make them
30988 2001-09-24 Ravi Pratap <ravi@ximian.com>
30990 * class.cs (ConstructorInitializer): Take a Location argument.
30991 (ConstructorBaseInitializer): Same here.
30992 (ConstructorThisInitializer): Same here.
30994 * cs-parser.jay : Update all calls accordingly.
30996 * expression.cs (Unary, Binary, New): Take location argument.
30997 Update accordingly everywhere.
30999 * cs-parser.jay : Update all calls to the above to take a location
31002 * class.cs : Ditto.
31004 2001-09-24 Ravi Pratap <ravi@ximian.com>
31006 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
31007 (Invocation::BetterConversion): Same here
31008 (Invocation::ConversionExists): Ditto.
31010 (Invocation::ConversionExists): Implement.
31012 2001-09-22 Ravi Pratap <ravi@ximian.com>
31014 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
31015 Also take an additional TypeContainer argument.
31017 * All over : Pass in TypeContainer as argument to OverloadResolve.
31019 * typemanager.cs (CSharpName): Update to check for the string type and return
31022 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
31025 2001-09-21 Ravi Pratap <ravi@ximian.com>
31027 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
31028 (Invocation::BetterFunction): Implement.
31029 (Invocation::BetterConversion): Implement.
31030 (Invocation::ConversionExists): Skeleton, no implementation yet.
31032 Okay, things work fine !
31034 2001-09-21 Miguel de Icaza <miguel@ximian.com>
31036 * typemanager.cs: declare and load enum_type, delegate_type and
31039 * expression.cs (Expression::Emit): Now emit returns a value that
31040 tells whether a value is left on the stack or not. This strategy
31041 might be reveted tomorrow with a mechanism that would address
31042 multiple assignments.
31043 (Expression::report118): Utility routine to report mismatches on
31046 (Unary::Report23): Report impossible type/operator combination
31049 (Unary::IsIncrementableNumber): Whether the type can be
31050 incremented or decremented with add.
31051 (Unary::ResolveOperator): Also allow enumerations to be bitwise
31053 (Unary::ResolveOperator): Implement ++, !, ~,
31055 (Invocation::Emit): Deal with new Emit convetion.
31057 * All Expression derivatives: Updated their Emit method to return
31058 whether they leave values on the stack or not.
31060 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
31061 stack for expressions that are statements.
31063 2001-09-20 Miguel de Icaza <miguel@ximian.com>
31065 * expression.cs (LValue): New interface. Must be implemented by
31067 (LocalVariableReference, ParameterReference, FieldExpr): Implement
31070 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
31071 interface for generating code, simplifies the code.
31073 2001-09-20 Ravi Pratap <ravi@ximian.com>
31075 * expression.cs (everywhere): Comment out return statements in ::Resolve
31076 methods to avoid the warnings.
31078 2001-09-20 Miguel de Icaza <miguel@ximian.com>
31080 * driver.cs (parse): Report error 2001 if we can not open the
31083 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
31086 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
31089 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
31090 otherwise nested blocks end up with the same index.
31092 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
31094 * expression.cs: Instead of having FIXMEs in the Resolve
31095 functions, throw exceptions so it is obvious that we are facing a
31098 * cs-parser.jay (invocation_expression): Pass Location information.
31100 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
31101 Use a basename for those routines because .NET does not like paths
31104 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
31107 2001-09-19 Miguel de Icaza <miguel@ximian.com>
31109 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
31110 are loading the correct data types (throws an exception if not).
31111 (TypeManager::InitCoreTypes): Use CoreLookupType
31113 * expression.cs (Unary::ResolveOperator): return the child
31114 expression for expressions which are just +expr.
31115 (Unary::ResolveOperator): Return negative literals for -LITERAL
31116 expressions (otherwise they are Unary {Literal}).
31117 (Invocation::Badness): Take into account `Implicit constant
31118 expression conversions'.
31120 * literal.cs (LongLiteral): Implement long literal class.
31121 (IntLiteral): export the `Value' of the intliteral.
31123 2001-09-19 Ravi Pratap <ravi@ximian.com>
31125 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
31127 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
31128 instead of 'Operator'
31130 * expression.cs (Binary::ResolveOperator): Update accordingly.
31131 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
31134 * cs-parser.jay (unary_expression): Update to use the new names.
31136 * gen-treedump.cs (GetUnary): Same here.
31138 * expression.cs (Unary::Resolve): Implement.
31139 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
31140 operators are found instead of making noise ;-)
31141 (Unary::ResolveOperator): New method to do precisely the same thing which
31142 Binary::ResolveOperator does for Binary expressions.
31143 (Unary.method, .Arguments): Add.
31144 (Unary::OperName): Implement.
31145 (Unary::ForceConversion): Copy and Paste !
31147 * class.cs (Operator::Define): Fix a small bug for the case when we have
31150 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
31151 for the inbuilt operators. Only overloading works for now ;-)
31153 2001-09-18 Miguel de Icaza <miguel@ximian.com>
31155 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
31156 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
31158 * expression.cs (This::Emit): Implement.
31159 (This::Resolve): Implement.
31160 (TypeOf:Resolve): Implement.
31161 (Expression::ResolveSimpleName): Add an implicit this to instance
31163 (MemberAccess::Resolve): Deal with Parameters and Fields.
31164 Bind instance variable to Field expressions.
31165 (FieldExpr::Instance): New field used to track the expression that
31166 represents the object instance.
31167 (FieldExpr::Resolve): Track potential errors from MemberLookup not
31169 (FieldExpr::Emit): Implement.
31171 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
31172 the last instruction contains a return opcode to avoid generating
31173 the last `ret' instruction (this generates correct code, and it is
31174 nice to pass the peverify output).
31176 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
31177 initializer for static and instance variables.
31178 (Constructor::Emit): Allow initializer to be null in the case of
31179 static constructors. Only emit initializer for instance
31182 (TypeContainer::FindMembers): Return a null array if there are no
31185 Also fix the code for the MemberTypes.Method branch, as it was not
31186 scanning that for operators (or tried to access null variables before).
31188 * assign.cs (Assign::Emit): Handle instance and static fields.
31192 * driver.cs: Stop compilation if there are parse errors.
31194 * cs-parser.jay (constructor_declaration): Provide default base
31195 initializer for non-static constructors.
31196 (constructor_declarator): Do not provide a default base
31197 initializers if none was specified.
31198 Catch the fact that constructors should not have parameters.
31200 * class.cs: Do not emit parent class initializers for static
31201 constructors, that should be flagged as an error.
31203 2001-09-18 Ravi Pratap <ravi@ximian.com>
31205 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
31206 Move back code into TypeContainer::Populate.
31208 2001-09-18 Ravi Pratap <ravi@ximian.com>
31210 * class.cs (TypeContainer::AddConstructor): Fix the check to
31211 compare against Name, not Basename.
31212 (Operator::OpType): Change Plus and Minus to Add and Subtract.
31214 * cs-parser.jay : Update accordingly.
31216 * class.cs (TypeContainer::FindMembers): For the case where we are searching
31217 for methods, don't forget to look into the operators too.
31218 (RegisterMethodBuilder): Helper method to take care of this for
31219 methods, constructors and operators.
31220 (Operator::Define): Completely revamp.
31221 (Operator.OperatorMethod, MethodName): New fields.
31222 (TypeContainer::Populate): Move the registering of builders into
31223 RegisterMethodBuilder.
31224 (Operator::Emit): Re-write.
31226 * expression.cs (Binary::Emit): Comment out code path to emit method
31227 invocation stuff for the case when we have a user defined operator. I am
31228 just not able to get it right !
31230 2001-09-17 Miguel de Icaza <miguel@ximian.com>
31232 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
31235 (Expression::MemberLookup): Provide a version that allows to
31236 specify the MemberTypes and BindingFlags.
31238 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
31239 so it was not fetching variable information from outer blocks.
31241 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
31242 Beforefieldinit as it was buggy.
31244 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
31245 that Ravi put here.
31247 * class.cs (Constructor::Emit): Only emit if block is not null.
31248 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
31249 deal with this by semantically definining it as if the user had
31252 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
31253 constructors as we now "emit" them at a higher level.
31255 (TypeContainer::DefineDefaultConstructor): Used to define the
31256 default constructors if none was provided.
31258 (ConstructorInitializer): Add methods Resolve and Emit.
31260 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
31262 2001-09-17 Ravi Pratap <ravi@ximian.com>
31264 * class.cs (TypeContainer::EmitDefaultConstructor): Register
31265 the default constructor builder with our hashtable for methodbuilders
31268 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
31269 and argument_count is 0 in which case we have a match.
31270 (Binary::ResolveOperator): More null checking and miscellaneous coding
31273 2001-09-17 Ravi Pratap <ravi@ximian.com>
31275 * rootcontext.cs (IsNameSpace): Compare against null.
31277 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
31279 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
31280 and Unary::Operator.
31282 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
31285 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
31286 we have overloaded operators.
31287 (Binary::ResolveOperator): Implement the part which does the operator overload
31290 * class.cs (Operator::Emit): Implement.
31291 (TypeContainer::Emit): Emit the operators we have too.
31293 * expression.cs (Binary::Emit): Update to emit the appropriate code for
31294 the case when we have a user-defined operator.
31296 2001-09-17 Miguel de Icaza <miguel@ximian.com>
31298 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
31300 2001-09-16 Ravi Pratap <ravi@ximian.com>
31302 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
31303 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
31304 (Constructor::Emit): Implement.
31305 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
31306 if we have no work to do.
31307 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
31310 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
31311 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
31313 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
31316 2001-09-15 Ravi Pratap <ravi@ximian.com>
31318 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
31320 (Tree::RecordNamespace): Method to do what the name says ;-)
31321 (Tree::Namespaces): Property to get at the namespaces hashtable.
31323 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
31326 * rootcontext.cs (IsNamespace): Fixed it :-)
31328 2001-09-14 Miguel de Icaza <miguel@ximian.com>
31330 * class.cs (TypeContainer::FindMembers): Add support for
31332 (MethodCore): New class that encapsulates both the shared aspects
31333 of a Constructor and a Method.
31334 (Method, Constructor): Factored pieces into MethodCore.
31336 * driver.cs: Added --fatal which makes errors throw exceptions.
31337 Load System assembly as well as part of the standard library.
31339 * report.cs: Allow throwing exceptions on errors for debugging.
31341 * modifiers.cs: Do not use `parent', instead use the real type
31342 container to evaluate permission settings.
31344 * class.cs: Put Ravi's patch back in. He is right, and we will
31345 have to cope with the
31347 2001-09-14 Ravi Pratap <ravi@ximian.com>
31349 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
31350 FamORAssem, not FamANDAssem.
31352 2001-09-14 Miguel de Icaza <miguel@ximian.com>
31354 * driver.cs: Added --parse option that only parses its input files
31357 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
31358 incorrect. IsTopLevel is not used to tell whether an object is
31359 root_types or not (that can be achieved by testing this ==
31360 root_types). But to see if this is a top-level *class* (not
31361 necessarly our "toplevel" container).
31363 2001-09-14 Ravi Pratap <ravi@ximian.com>
31365 * enum.cs (Enum::Define): Modify to call the Lookup method on the
31366 parent instead of a direct call to GetType.
31368 2001-09-14 Ravi Pratap <ravi@ximian.com>
31370 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
31371 Modifiers.TypeAttr. This should just be a call to that method.
31373 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
31374 object so that we can determine if we are top-level or not.
31376 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
31379 * enum.cs (Enum::Define): Ditto.
31381 * modifiers.cs (FieldAttr): Re-write.
31383 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
31384 (TypeContainer::HaveStaticConstructor): New property to provide access
31385 to precisely that info.
31387 * modifiers.cs (MethodAttr): Re-write.
31388 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
31390 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
31391 of top-level types as claimed.
31393 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31395 * expression.cs (MemberLookup): Fruitless attempt to lookup
31396 constructors. Maybe I need to emit default constructors? That
31397 might be it (currently .NET emits this for me automatically).
31398 (Invocation::OverloadResolve): Cope with Arguments == null.
31399 (Invocation::EmitArguments): new function, shared by the new
31400 constructor and us.
31401 (Invocation::Emit): Handle static and instance methods. Emit
31402 proper call instruction for virtual or non-virtual invocations.
31403 (New::Emit): Implement.
31404 (New::Resolve): Implement.
31405 (MemberAccess:Resolve): Implement.
31406 (MethodGroupExpr::InstanceExpression): used conforming to the spec
31407 to track instances.
31408 (FieldExpr::Resolve): Set type.
31410 * support.cs: Handle empty arguments.
31412 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31413 SimpleLookup): Auxiliary routines to help parse a qualifier
31416 Update qualifier_identifier rule.
31418 * codegen.cs: Removed debugging messages.
31420 * class.cs: Make this a global thing, this acts just as a "key" to
31421 objects that we might have around.
31423 (Populate): Only initialize method_builders_to_methods once.
31425 * expression.cs (PropertyExpr): Initialize type from the
31428 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31429 Resolve pattern. Attempt to implicitly convert value to boolean.
31432 * expression.cs: Set the type for the int32/int32 argument case.
31433 (Binary::ResolveOperator): Set the return type to boolean for
31434 comparission operators
31436 * typemanager.cs: Remove debugging print code.
31438 (Invocation::Resolve): resolve type.
31440 * class.cs: Allocate a MemberInfo of the correct size, as the code
31441 elsewhere depends on the test to reflect the correct contents.
31443 (Method::) Keep track of parameters, due to System.Reflection holes
31445 (TypeContainer::Populate): Keep track of MethodBuilders to Method
31448 (TypeContainer::FindMembers): Use ArrayList and then copy an array
31449 of the exact size and return that.
31451 (Class::LookupMethodByBuilder): New function that maps
31452 MethodBuilders to its methods. Required to locate the information
31453 on methods because System.Reflection bit us again.
31455 * support.cs: New file, contains an interface ParameterData and
31456 two implementations: ReflectionParameters and InternalParameters
31457 used to access Parameter information. We will need to grow this
31460 * expression.cs (Invocation::GetParameterData): implement a cache
31461 and a wrapper around the ParameterData creation for methods.
31462 (Invocation::OverloadResolve): Use new code.
31464 2001-09-13 Ravi Pratap <ravi@ximian.com>
31466 * class.cs (TypeContainer::EmitField): Remove and move into
31467 (Field::Define): here and modify accordingly.
31468 (Field.FieldBuilder): New member.
31469 (TypeContainer::Populate): Update accordingly.
31470 (TypeContainer::FindMembers): Implement.
31472 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31474 * statement.cs: (VariableInfo::VariableType): New field to be
31475 initialized with the full type once it is resolved.
31477 2001-09-12 Miguel de Icaza <miguel@ximian.com>
31479 * parameter.cs (GetParameterInfo): Use a type cache to compute
31480 things only once, and to reuse this information
31482 * expression.cs (LocalVariableReference::Emit): Implement.
31483 (OpcodeCast::Emit): fix.
31485 (ParameterReference::Resolve): Implement.
31486 (ParameterReference::Emit): Implement.
31488 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31489 that are expressions need to stay as Expressions.
31491 * typemanager.cs (CSharpName): Returns the C# name of a type if
31494 * expression.cs (Expression::ConvertImplicit): New function that
31495 implements implicit type conversions.
31497 (Expression::ImplicitReferenceConversion): Implements implicit
31498 reference conversions.
31500 (EmptyCast): New type for transparent casts.
31502 (OpcodeCast): New type for casts of types that are performed with
31503 a sequence of bytecodes.
31505 (BoxedCast): New type used for casting value types into reference
31506 types. Emits a box opcode.
31508 (Binary::DoNumericPromotions): Implements numeric promotions of
31509 and computation of the Binary::Type.
31511 (Binary::EmitBranchable): Optimization.
31513 (Binary::Emit): Implement code emission for expressions.
31515 * typemanager.cs (TypeManager): Added two new core types: sbyte
31518 2001-09-12 Ravi Pratap <ravi@ximian.com>
31520 * class.cs (TypeContainer::FindMembers): Method which does exactly
31521 what Type.FindMembers does, only we don't have to use reflection. No
31522 implementation yet.
31524 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31525 typecontainer objects as we need to get at them.
31526 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31528 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31529 typecontainer object.
31531 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31532 of just a Report object.
31534 2001-09-11 Ravi Pratap <ravi@ximian.com>
31536 * class.cs (Event::Define): Go back to using the prefixes "add_" and
31538 (TypeContainer::Populate): Now define the delegates of the type too.
31539 (TypeContainer.Delegates): Property to access the list of delegates defined
31542 * delegates.cs (Delegate::Define): Implement partially.
31544 * modifiers.cs (TypeAttr): Handle more flags.
31546 2001-09-11 Ravi Pratap <ravi@ximian.com>
31548 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31550 (Operator::Define): Re-write logic to get types by using the LookupType method
31551 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31552 (Indexer::Define): Ditto.
31553 (Event::Define): Ditto.
31554 (Property::Define): Ditto.
31556 2001-09-10 Ravi Pratap <ravi@ximian.com>
31558 * class.cs (TypeContainer::Populate): Now define operators too.
31559 (TypeContainer.Operators): New property to access the list of operators
31561 (Operator.OperatorMethodBuilder): New member to hold the method builder
31562 for the operator we are defining.
31563 (Operator::Define): Implement.
31565 2001-09-10 Ravi Pratap <ravi@ximian.com>
31567 * class.cs (Event::Define): Make the prefixes of the accessor methods
31568 addOn_ and removeOn_
31570 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31571 of the location being passed in too. Ideally, this should go later since all
31572 error reporting should be done through the Report object.
31574 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31575 (Populate): Iterate thru the indexers we have and define them too.
31576 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31577 for the get and set accessors.
31578 (Indexer::Define): Implement.
31580 2001-09-09 Miguel de Icaza <miguel@ximian.com>
31582 * expression.cs (Binary::Resolve): Beginning of it. I scratched
31583 my previous implementation, did not work.
31585 * typemanager.cs: Add a couple of missing types (the longs).
31587 * literal.cs: Use TypeManager.bool_type instead of getting it.
31589 * expression.cs (EventExpr): New kind of expressions.
31590 (Expressio::ExprClassFromMemberInfo): finish
31592 2001-09-08 Miguel de Icaza <miguel@ximian.com>
31594 * assign.cs: Emit stores to static fields differently.
31596 2001-09-08 Ravi Pratap <ravi@ximian.com>
31598 * Merge in changes and adjust code to tackle conflicts. Backed out my
31599 code in Assign::Resolve ;-)
31601 2001-09-08 Ravi Pratap <ravi@ximian.com>
31603 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31604 instead Report.Error and also pass in the location.
31605 (CSharpParser::Lexer): New readonly property to return the reference
31606 to the Tokenizer object.
31607 (declare_local_variables): Use Report.Error with location instead of plain
31611 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31612 (Operator.CheckBinaryOperator): Ditto.
31614 * cs-parser.jay (operator_declarator): Update accordingly.
31616 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31617 (CheckBinaryOperator): Same here.
31619 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31620 on the name without any prefixes of namespace names etc. This is because we
31621 already might have something already fully qualified like
31622 'System.Console.WriteLine'
31624 * assign.cs (Resolve): Begin implementation. Stuck ;-)
31626 2001-09-07 Ravi Pratap <ravi@ximian.com>
31628 * cs-tokenizer.cs (location): Return a string which also contains
31631 * expression.cs (ElementAccess): New class for expressions of the
31632 type 'element access.'
31633 (BaseAccess): New class for expressions of the type 'base access.'
31634 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31637 * cs-parser.jay (element_access): Implement action.
31638 (base_access): Implement actions.
31639 (checked_expression, unchecked_expression): Implement.
31641 * cs-parser.jay (local_variable_type): Correct and implement.
31642 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31644 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31646 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31647 name and the specifiers.
31649 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31651 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
31652 making them all public ;-)
31654 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31657 2001-09-07 Miguel de Icaza <miguel@ximian.com>
31659 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31661 (FieldExpr, PropertyExprs): New resolved expressions.
31662 (SimpleName::MemberStaticCheck): Perform static checks for access
31663 to non-static fields on static methods. Maybe this should be
31664 generalized for MemberAccesses.
31665 (SimpleName::ResolveSimpleName): More work on simple name
31668 * cs-parser.jay (primary_expression/qualified_identifier): track
31669 the parameter index.
31671 * codegen.cs (CodeGen::Save): Catch save exception, report error.
31672 (EmitContext::EmitBoolExpression): Chain to expression generation
31673 instead of temporary hack.
31674 (::EmitStatementExpression): Put generic expression code generation.
31676 * assign.cs (Assign::Emit): Implement variable assignments to
31677 local variables, parameters and fields.
31679 2001-09-06 Miguel de Icaza <miguel@ximian.com>
31681 * statement.cs (Block::GetVariableInfo): New method, returns the
31682 VariableInfo for a variable name in a block.
31683 (Block::GetVariableType): Implement in terms of GetVariableInfo
31685 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31686 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31688 2001-09-06 Ravi Pratap <ravi@ximian.com>
31690 * cs-parser.jay (operator_declaration): Continue on my quest : update
31691 to take attributes argument.
31692 (event_declaration): Ditto.
31693 (enum_declaration): Ditto.
31694 (indexer_declaration): Ditto.
31696 * class.cs (Operator::Operator): Update constructor accordingly.
31697 (Event::Event): Ditto.
31699 * delegate.cs (Delegate::Delegate): Same here.
31701 * enum.cs (Enum::Enum): Same here.
31703 2001-09-05 Ravi Pratap <ravi@ximian.com>
31705 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31707 * ../tests/cs0658.cs : New file to demonstrate error 0658.
31709 * attribute.cs (Attributes): New class to encapsulate all attributes which were
31710 being passed around as an arraylist.
31711 (Attributes::AddAttribute): Method to add attribute sections.
31713 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31714 (struct_declaration): Update accordingly.
31715 (constant_declaration): Update.
31716 (field_declaration): Update.
31717 (method_header): Update.
31718 (fixed_parameter): Update.
31719 (parameter_array): Ditto.
31720 (property_declaration): Ditto.
31721 (destructor_declaration): Ditto.
31723 * class.cs (Struct::Struct): Update constructors accordingly.
31724 (Class::Class): Ditto.
31725 (Field::Field): Ditto.
31726 (Method::Method): Ditto.
31727 (Property::Property): Ditto.
31728 (TypeContainer::OptAttribute): update property's return type.
31730 * interface.cs (Interface.opt_attributes): New member.
31731 (Interface::Interface): Update to take the extra Attributes argument.
31733 * parameter.cs (Parameter::Parameter): Ditto.
31735 * constant.cs (Constant::Constant): Ditto.
31737 * interface.cs (InterfaceMemberBase): New OptAttributes field.
31738 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
31739 the attributes as a parameter.
31740 (InterfaceProperty): Update constructor call.
31741 (InterfaceEvent): Ditto.
31742 (InterfaceMethod): Ditto.
31743 (InterfaceIndexer): Ditto.
31745 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
31746 pass the attributes too.
31747 (interface_event_declaration): Ditto.
31748 (interface_property_declaration): Ditto.
31749 (interface_method_declaration): Ditto.
31750 (interface_declaration): Ditto.
31752 2001-09-05 Miguel de Icaza <miguel@ximian.com>
31754 * class.cs (Method::Define): Track the "static Main" definition to
31755 create an entry point.
31757 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31758 EntryPoint if we find it.
31760 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31761 (EmitContext::ig): Make this variable public.
31763 * driver.cs: Make the default output file be the first file name
31764 with the .exe extension.
31766 Detect empty compilations
31768 Handle various kinds of output targets. Handle --target and
31769 rename -t to --dumper.
31771 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31772 methods inherited from Expression return now an Expression. This
31773 will is used during the tree rewriting as we resolve them during
31776 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31777 the spec. Missing entirely is the information about
31778 accessability of elements of it.
31780 (Expression::ExprClassFromMemberInfo): New constructor for
31781 Expressions that creates a fully initialized Expression based on
31782 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31785 (Invocation::Resolve): Begin implementing resolution of invocations.
31787 * literal.cs (StringLiteral): Implement Emit.
31789 2001-09-05 Ravi Pratap <ravi@ximian.com>
31791 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31794 2001-09-04 Ravi Pratap <ravi@ximian.com>
31796 * cs-parser.jay (attribute_arguments): Implement actions.
31797 (attribute): Fix bug in production. Implement action.
31798 (attribute_list): Implement.
31799 (attribute_target): Implement.
31800 (attribute_target_specifier, opt_target_specifier): Implement
31801 (CheckAttributeTarget): New method to check if the attribute target
31803 (attribute_section): Implement.
31804 (opt_attributes): Implement.
31806 * attribute.cs : New file to handle attributes.
31807 (Attribute): Class to hold attribute info.
31809 * cs-parser.jay (opt_attribute_target_specifier): Remove production
31810 (attribute_section): Modify production to use 2 different rules to
31811 achieve the same thing. 1 s/r conflict down !
31812 Clean out commented, useless, non-reducing dimension_separator rules.
31814 * class.cs (TypeContainer.attributes): New member to hold list
31815 of attributes for a type.
31816 (Struct::Struct): Modify to take one more argument, the attribute list.
31817 (Class::Class): Ditto.
31818 (Field::Field): Ditto.
31819 (Method::Method): Ditto.
31820 (Property::Property): Ditto.
31822 * cs-parser.jay (struct_declaration): Update constructor call to
31823 pass in the attributes too.
31824 (class_declaration): Ditto.
31825 (constant_declaration): Ditto.
31826 (field_declaration): Ditto.
31827 (method_header): Ditto.
31828 (fixed_parameter): Ditto.
31829 (parameter_array): Ditto.
31830 (property_declaration): Ditto.
31832 * constant.cs (Constant::Constant): Update constructor similarly.
31833 Use System.Collections.
31835 * parameter.cs (Parameter::Parameter): Update as above.
31837 2001-09-02 Ravi Pratap <ravi@ximian.com>
31839 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31840 (TypeContainer.delegates): New member to hold list of delegates.
31842 * cs-parser.jay (delegate_declaration): Implement the action correctly
31843 this time as I seem to be on crack ;-)
31845 2001-09-02 Miguel de Icaza <miguel@ximian.com>
31847 * rootcontext.cs (RootContext::IsNamespace): new function, used to
31848 tell whether an identifier represents a namespace.
31850 * expression.cs (NamespaceExpr): A namespace expression, used only
31851 temporarly during expression resolution.
31852 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31853 utility functions to resolve names on expressions.
31855 2001-09-01 Miguel de Icaza <miguel@ximian.com>
31857 * codegen.cs: Add hook for StatementExpressions.
31859 * class.cs: Fix inverted test for static flag in methods.
31861 2001-09-02 Ravi Pratap <ravi@ximian.com>
31863 * class.cs (Operator::CheckUnaryOperator): Correct error number used
31864 to make it coincide with MS' number.
31865 (Operator::CheckBinaryOperator): Ditto.
31867 * ../errors/errors.txt : Remove error numbers added earlier.
31869 * ../errors/cs1019.cs : Test case for error # 1019
31871 * ../errros/cs1020.cs : Test case for error # 1020
31873 * cs-parser.jay : Clean out commented cruft.
31874 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31875 used anywhere - non-reducing rule.
31876 (namespace_declarations): Non-reducing rule - comment out.
31878 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31879 with TypeContainer::AddEnum.
31881 * delegate.cs : New file for delegate handling classes.
31882 (Delegate): Class for declaring delegates.
31884 * makefile : Update.
31886 * cs-parser.jay (delegate_declaration): Implement.
31888 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
31890 * class.cs (Event::Define): Implement.
31891 (Event.EventBuilder): New member.
31893 * class.cs (TypeContainer::Populate): Update to define all enums and events
31895 (Events): New property for the events arraylist we hold. Shouldn't we move to using
31896 readonly fields for all these cases ?
31898 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31900 * class.cs (Property): Revamp to use the convention of making fields readonly.
31901 Accordingly modify code elsewhere.
31903 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31904 the Define method of the Property class.
31906 * class.cs : Clean up applied patch and update references to variables etc. Fix
31908 (TypeContainer::Populate): Update to define all the properties we have. Also
31909 define all enumerations.
31911 * enum.cs (Define): Implement.
31913 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31915 * cs-parser.jay (overloadable_operator): The semantic value is an
31916 enum of the Operator class.
31917 (operator_declarator): Implement actions.
31918 (operator_declaration): Implement.
31920 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31921 validity of definitions.
31922 (Operator::CheckBinaryOperator): Static method to check for binary operators
31923 (TypeContainer::AddOperator): New method to add an operator to a type.
31925 * cs-parser.jay (indexer_declaration): Added line to actually call the
31926 AddIndexer method so it gets added ;-)
31928 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
31929 already taken care of by the MS compiler ?
31931 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31933 * class.cs (Operator): New class for operator declarations.
31934 (Operator::OpType): Enum for the various operators.
31936 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31938 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31939 ostensibly handle this in semantic analysis.
31941 * cs-parser.jay (general_catch_clause): Comment out
31942 (specific_catch_clauses, specific_catch_clause): Ditto.
31943 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31944 (catch_args, opt_catch_args): New productions.
31945 (catch_clause): Rewrite to use the new productions above
31946 (catch_clauses): Modify accordingly.
31947 (opt_catch_clauses): New production to use in try_statement
31948 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31949 and re-write the code in the actions to extract the specific and
31950 general catch clauses by being a little smart ;-)
31952 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31953 Hooray, try and catch statements parse fine !
31955 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31957 * statement.cs (Block::GetVariableType): Fix logic to extract the type
31958 string from the hashtable of variables.
31960 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31961 I end up making that mistake ;-)
31962 (catch_clauses): Fixed gross error which made Key and Value of the
31963 DictionaryEntry the same : $1 !!
31965 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31967 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31969 * cs-parser.jay (event_declaration): Correct to remove the semicolon
31970 when the add and remove accessors are specified.
31972 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31974 * cs-parser.jay (IndexerDeclaration): New helper class to hold
31975 information about indexer_declarator.
31976 (indexer_declarator): Implement actions.
31977 (parsing_indexer): New local boolean used to keep track of whether
31978 we are parsing indexers or properties. This is necessary because
31979 implicit_parameters come into picture even for the get accessor in the
31980 case of an indexer.
31981 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31983 * class.cs (Indexer): New class for indexer declarations.
31984 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31985 (TypeContainer::indexers): New member to hold list of indexers for the
31988 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31990 * cs-parser.jay (add_accessor_declaration): Implement action.
31991 (remove_accessor_declaration): Implement action.
31992 (event_accessors_declaration): Implement
31993 (variable_declarators): swap statements for first rule - trivial.
31995 * class.cs (Event): New class to hold information about event
31997 (TypeContainer::AddEvent): New method to add an event to a type
31998 (TypeContainer::events): New member to hold list of events.
32000 * cs-parser.jay (event_declaration): Implement actions.
32002 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
32004 * cs-parser.jay (dim_separators): Implement. Make it a string
32005 concatenating all the commas together, just as they appear.
32006 (opt_dim_separators): Modify accordingly
32007 (rank_specifiers): Update accordingly. Basically do the same
32008 thing - instead, collect the brackets here.
32009 (opt_rank_sepcifiers): Modify accordingly.
32010 (array_type): Modify to actually return the complete type string
32011 instead of ignoring the rank_specifiers.
32012 (expression_list): Implement to collect the expressions
32013 (variable_initializer): Implement. We make it a list of expressions
32014 essentially so that we can handle the array_initializer case neatly too.
32015 (variable_initializer_list): Implement.
32016 (array_initializer): Make it a list of variable_initializers
32017 (opt_array_initializer): Modify accordingly.
32019 * expression.cs (New::NType): Add enumeration to help us
32020 keep track of whether we have an object/delegate creation
32021 or an array creation.
32022 (New:NewType, New::Rank, New::Indices, New::Initializers): New
32023 members to hold data about array creation.
32024 (New:New): Modify to update NewType
32025 (New:New): New Overloaded contructor for the array creation
32028 * cs-parser.jay (array_creation_expression): Implement to call
32029 the overloaded New constructor.
32031 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
32033 * class.cs (TypeContainer::Constructors): Return member
32034 constructors instead of returning null.
32036 2001-08-26 Miguel de Icaza <miguel@ximian.com>
32038 * typemanager.cs (InitCoreTypes): Initialize the various core
32039 types after we have populated the type manager with the user
32040 defined types (this distinction will be important later while
32041 compiling corlib.dll)
32043 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
32044 on Expression Classification. Now all expressions have a method
32045 `Resolve' and a method `Emit'.
32047 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
32048 generation from working. Also add some temporary debugging
32051 2001-08-24 Miguel de Icaza <miguel@ximian.com>
32053 * codegen.cs: Lots of code generation pieces. This is only the
32054 beginning, will continue tomorrow with more touches of polish. We
32055 handle the fundamentals of if, while, do, for, return. Others are
32056 trickier and I need to start working on invocations soon.
32058 * gen-treedump.cs: Bug fix, use s.Increment here instead of
32061 * codegen.cs (EmitContext): New struct, used during code
32062 emission to keep a context. Most of the code generation will be
32065 * cs-parser.jay: Add embedded blocks to the list of statements of
32066 this block. So code generation proceeds in a top down fashion.
32068 2001-08-23 Miguel de Icaza <miguel@ximian.com>
32070 * statement.cs: Add support for multiple child blocks.
32072 2001-08-22 Miguel de Icaza <miguel@ximian.com>
32074 * codegen.cs (EmitCode): New function, will emit the code for a
32075 Block of code given a TypeContainer and its ILGenerator.
32077 * statement.cs (Block): Standard public readonly optimization.
32078 (Block::Block constructors): Link children.
32079 (Block::Child): Child Linker.
32080 (Block::EmitVariables): Emits IL variable declarations.
32082 * class.cs: Drop support for MethodGroups here, delay until
32084 (Method::): Applied the same simplification that I did before, and
32085 move from Properties to public readonly fields.
32086 (Method::ParameterTypes): Returns the parameter types for the
32087 function, and implements a cache that will be useful later when I
32088 do error checking and the semantic analysis on the methods is
32090 (Constructor::GetCallingConvention): Renamed from CallingConvetion
32091 and made a method, optional argument tells whether this is a class
32092 or a structure to apply the `has-this' bit.
32093 (Method::GetCallingConvention): Implement, returns the calling
32095 (Method::Define): Defines the type, a second pass is performed
32096 later to populate the methods.
32098 (Constructor::ParameterTypes): implement a cache similar to the
32099 one on Method::ParameterTypes, useful later when we do semantic
32102 (TypeContainer::EmitMethod): New method. Emits methods.
32104 * expression.cs: Removed MethodGroup class from here.
32106 * parameter.cs (Parameters::GetCallingConvention): new method.
32108 2001-08-21 Miguel de Icaza <miguel@ximian.com>
32110 * class.cs (TypeContainer::Populate): Drop RootContext from the
32113 (Constructor::CallingConvention): Returns the calling convention.
32114 (Constructor::ParameterTypes): Returns the constructor parameter
32117 (TypeContainer::AddConstructor): Keep track of default constructor
32118 and the default static constructor.
32120 (Constructor::) Another class that starts using `public readonly'
32121 instead of properties.
32123 (Constructor::IsDefault): Whether this is a default constructor.
32125 (Field::) use readonly public fields instead of properties also.
32127 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
32128 track of static constructors; If none is used, turn on
32129 BeforeFieldInit in the TypeAttributes.
32131 * cs-parser.jay (opt_argument_list): now the return can be null
32132 for the cases where there are no arguments.
32134 (constructor_declarator): If there is no implicit `base' or
32135 `this', then invoke the default parent constructor.
32137 * modifiers.cs (MethodAttr): New static function maps a set of
32138 modifiers flags into a MethodAttributes enum
32139 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
32140 MethodAttr, TypeAttr to represent the various mappings where the
32141 modifiers are used.
32142 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
32144 2001-08-19 Miguel de Icaza <miguel@ximian.com>
32146 * parameter.cs (GetParameterInfo): Fix bug where there would be no
32149 * interface.cs (PopulateIndexer): Implemented the code generator
32150 for interface indexers.
32152 2001-08-17 Miguel de Icaza <miguel@ximian.com>
32154 * interface.cs (InterfaceMemberBase): Now we track the new status
32157 (PopulateProperty): Implement property population. Woohoo! Got
32158 Methods and Properties going today.
32160 Removed all the properties for interfaces, and replaced them with
32161 `public readonly' fields.
32163 2001-08-16 Miguel de Icaza <miguel@ximian.com>
32165 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
32166 initialize their hashtables/arraylists only when they are needed
32167 instead of doing this always.
32169 * parameter.cs: Handle refs and out parameters.
32171 * cs-parser.jay: Use an ArrayList to construct the arguments
32172 instead of the ParameterCollection, and then cast that to a
32175 * parameter.cs: Drop the use of ParameterCollection and use
32176 instead arrays of Parameters.
32178 (GetParameterInfo): Use the Type, not the Name when resolving
32181 2001-08-13 Miguel de Icaza <miguel@ximian.com>
32183 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
32184 and instead use public readonly fields.
32186 * class.cs: Put back walking code for type containers.
32188 2001-08-11 Miguel de Icaza <miguel@ximian.com>
32190 * class.cs (MakeConstant): Code to define constants.
32192 * rootcontext.cs (LookupType): New function. Used to locate types
32195 2001-08-08 Miguel de Icaza <miguel@ximian.com>
32197 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
32198 this System.Reflection code is. Kudos to Microsoft
32200 * typemanager.cs: Implement a type cache and avoid loading all
32201 types at boot time. Wrap in LookupType the internals. This made
32202 the compiler so much faster. Wow. I rule!
32204 * driver.cs: Make sure we always load mscorlib first (for
32205 debugging purposes, nothing really important).
32207 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
32208 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
32210 * rootcontext.cs: Lookup types on their namespace; Lookup types
32211 on namespaces that have been imported using the `using' keyword.
32213 * class.cs (TypeContainer::TypeAttr): Virtualize.
32214 (Class::TypeAttr): Return attributes suitable for this bad boy.
32215 (Struct::TypeAttr): ditto.
32216 Handle nested classes.
32217 (TypeContainer::) Remove all the type visiting code, it is now
32218 replaced with the rootcontext.cs code
32220 * rootcontext.cs (GetClassBases): Added support for structs.
32222 2001-08-06 Miguel de Icaza <miguel@ximian.com>
32224 * interface.cs, statement.cs, class.cs, parameter.cs,
32225 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
32226 Drop use of TypeRefs, and use strings instead.
32228 2001-08-04 Miguel de Icaza <miguel@ximian.com>
32232 * class.cs (Struct::Struct): set the SEALED flags after
32233 checking the modifiers.
32234 (TypeContainer::TypeAttr): new property, returns the
32235 TypeAttributes for a class.
32237 * cs-parser.jay (type_list): Oops, list production was creating a
32238 new list of base types.
32240 * rootcontext.cs (StdLib): New property.
32241 (GetInterfaceTypeByName): returns an interface by type name, and
32242 encapsulates error handling here.
32243 (GetInterfaces): simplified.
32244 (ResolveTree): Encapsulated all the tree resolution here.
32245 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
32248 * driver.cs: Add support for --nostdlib, to avoid loading the
32249 default assemblies.
32250 (Main): Do not put tree resolution here.
32252 * rootcontext.cs: Beginning of the class resolution.
32254 2001-08-03 Miguel de Icaza <miguel@ximian.com>
32256 * rootcontext.cs: Provide better error reporting.
32258 * cs-parser.jay (interface_base): set our $$ to be interfaces.
32260 * rootcontext.cs (CreateInterface): Handle the case where there
32261 are no parent interfaces.
32263 (CloseTypes): Routine to flush types at the end.
32264 (CreateInterface): Track types.
32265 (GetInterfaces): Returns an array of Types from the list of
32266 defined interfaces.
32268 * typemanager.c (AddUserType): Mechanism to track user types (puts
32269 the type on the global type hash, and allows us to close it at the
32272 2001-08-02 Miguel de Icaza <miguel@ximian.com>
32274 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
32275 RecordInterface instead.
32277 * cs-parser.jay: Updated to reflect changes above.
32279 * decl.cs (Definition): Keep track of the TypeBuilder type that
32280 represents this type here. Not sure we will use it in the long
32281 run, but wont hurt for now.
32283 * driver.cs: Smaller changes to accomodate the new code.
32285 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
32288 * rootcontext.cs (CreateInterface): New method, used to create
32289 the System.TypeBuilder type for interfaces.
32290 (ResolveInterfaces): new entry point to resolve the interface
32292 (CodeGen): Property, used to keep track of the code generator.
32294 2001-07-26 Miguel de Icaza <miguel@ximian.com>
32296 * cs-parser.jay: Add a second production for delegate_declaration
32299 (enum_body): Put an opt_comma here instead of putting it on
32300 enum_body or enum_member_declarations so we can handle trailing
32301 commas on enumeration members. Gets rid of a shift/reduce.
32303 (type_list): Need a COMMA in the middle.
32305 (indexer_declaration): Tell tokenizer to recognize get/set
32307 * Remove old targets.
32309 * Re-add the parser target.
32311 2001-07-13 Simon Cozens <simon@simon-cozens.org>
32313 * cs-parser.jay: Add precendence rules for a number of operators
32314 ot reduce the number of shift/reduce conflicts in the grammar.
32316 2001-07-17 Miguel de Icaza <miguel@ximian.com>
32318 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
32321 Get rid of old crufty code.
32323 * rootcontext.cs: Use this to keep track of the parsed
32324 representation and the defined types available to the program.
32326 * gen-treedump.cs: adjust for new convention.
32328 * type.cs: Split out the type manager, and the assembly builder
32331 * typemanager.cs: the type manager will live here now.
32333 * cil-codegen.cs: And the code generator here.
32335 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
32337 * makefile: Fixed up for easy making.
32339 2001-07-13 Simon Cozens <simon@simon-cozens.org>
32341 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
32344 (unary_expression): Expand pre_increment_expression and
32345 post_decrement_expression to reduce a shift/reduce.
32347 2001-07-11 Simon Cozens
32349 * cs-tokenizer.cs: Hex numbers should begin with a 0.
32351 Improve allow_keyword_as_indent name.
32353 2001-06-19 Miguel de Icaza <miguel@ximian.com>
32355 * Adjustments for Beta2.
32357 2001-06-13 Miguel de Icaza <miguel@ximian.com>
32359 * decl.cs: Added `Define' abstract method.
32360 (InTransit): new property, used to catch recursive definitions.
32362 * interface.cs: Implement `Define'.
32364 * modifiers.cs: Map Modifiers.constants to
32365 System.Reflection.TypeAttribute flags.
32367 * class.cs: Keep track of types and user-defined types.
32368 (BuilderInit): New method for creating an assembly
32369 (ResolveType): New function to launch the resolution process, only
32370 used by interfaces for now.
32372 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
32373 that are inserted into the name space.
32375 2001-06-08 Miguel de Icaza <miguel@ximian.com>
32377 * ARGH. I have screwed up my tree so many times due to the use of
32378 rsync rather than using CVS. Going to fix this at once.
32380 * driver.cs: Objetify driver. Load assemblies, use assemblies to
32383 2001-06-07 Miguel de Icaza <miguel@ximian.com>
32385 * Experiment successful: Use System.Type rather that our own
32388 2001-05-25 Miguel de Icaza <miguel@ximian.com>
32390 * cs-parser.jay: Removed nsAliases from here.
32392 Use new namespaces, handle `using XXX;'
32394 * namespace.cs: Reimplemented namespace handling, use a recursive
32395 definition of the class. Now we can keep track of using clauses
32396 and catch invalid using clauses.
32398 2001-05-24 Miguel de Icaza <miguel@ximian.com>
32400 * gen-treedump.cs: Adapted for all the renaming.
32402 * expression.cs (Expression): this class now has a Type property
32403 which returns an expression Type.
32405 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32406 `Type', as this has a different meaning now in the base
32408 2001-05-22 Miguel de Icaza <miguel@ximian.com>
32410 * interface.cs, class.cs: Removed from all the sources the
32411 references to signature computation, as we can not do method
32412 signature computation during the parsing time, as we are not
32413 trying to solve at that point distinguishing:
32417 void a (NS.Blah x) {}
32420 Which depending on the context might be valid or not, as we do not
32421 know if Blah is the same thing as NS.Blah at that point.
32423 * Redid everything so the code uses TypeRefs now instead of
32424 Types. TypeRefs are just temporary type placeholders, that need
32425 to be resolved. They initially have a pointer to a string and the
32426 current scope in which they are used. This is used later by the
32427 compiler to resolve the reference to an actual Type.
32429 * DeclSpace is no longer a CIR.Type, and neither are
32430 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
32431 are all DeclSpaces, but no Types.
32433 * type.cs (TypeRefManager): This implements the TypeRef manager,
32434 which keeps track of all the types that need to be resolved after
32435 the parsing has finished.
32437 2001-05-13 Miguel de Icaza <miguel@ximian.com>
32439 * ARGH. We are going to have to store `foreach' as a class rather
32440 than resolving it, as we need to verify error 1579 after name
32441 resolution. *OR* we could keep a flag that says `This request to
32442 IEnumerator comes from a foreach statement' which we can then use
32443 to generate the error.
32445 2001-05-10 Miguel de Icaza <miguel@ximian.com>
32447 * class.cs (TypeContainer.AddMethod): we now add methods to the
32448 MethodGroup instead of the method hashtable.
32450 * expression.cs: Add MethodGroup abstraction, which gets us one
32451 step closer to the specification in the way we handle method
32454 * cs-parser.jay (primary_expression): qualified_identifier now
32455 tried to match up an identifier to a local variable reference or
32456 to a parameter reference.
32458 current_local_parameters is now a parser global variable that
32459 points to the current parameters for the block, used during name
32462 (property_declaration): Now creates an implicit `value' argument to
32465 2001-05-09 Miguel de Icaza <miguel@ximian.com>
32467 * parameter.cs: Do not use `param' arguments as part of the
32468 signature, per the spec.
32470 2001-05-08 Miguel de Icaza <miguel@ximian.com>
32472 * decl.cs: Base class for classes, structs and interfaces. This
32473 is the "Declaration Space"
32475 * cs-parser.jay: Use CheckDef for checking declaration errors
32476 instead of having one on each function.
32478 * class.cs: Factor out some code for handling error handling in
32479 accordance to the "Declarations" section in the "Basic Concepts"
32480 chapter in the ECMA C# spec.
32482 * interface.cs: Make all interface member classes derive from
32483 InterfaceMemberBase.
32485 2001-05-07 Miguel de Icaza <miguel@ximian.com>
32487 * Many things: all interfaces are parsed and generated in
32488 gen-treedump. Support for member variables, constructors,
32489 destructors, properties, constants is there.
32491 Beginning of the IL backend, but very little done, just there for
32494 2001-04-29 Miguel de Icaza <miguel@ximian.com>
32496 * cs-parser.jay: Fix labeled statement.
32498 * cs-tokenizer.cs (escape): Escape " and ' always.
32499 ref_line, ref_name: keep track of the line/filename as instructed
32500 by #line by the compiler.
32503 2001-04-27 Miguel de Icaza <miguel@ximian.com>
32505 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32506 to match the values in System.CodeDOM.
32508 Divid renamed to Divide.
32510 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32512 (Statements.set): remove.
32514 * System.CodeDOM/CodeCatchClause.cs: always have a valid
32517 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32518 falseStatements always have valid values.
32520 * cs-parser.jay: Use System.CodeDOM now.